qtox screenshots support

This commit is contained in:
ingvar1995 2016-12-24 22:05:29 +03:00
parent 9d939e7439
commit 6cafd14883
2 changed files with 5 additions and 1 deletions

View file

@ -32,6 +32,10 @@ SHOW_PROGRESS_BAR = (0, 1, 4)
ALLOWED_FILES = ('toxygen_inline.png', 'utox-inline.png', 'sticker.png') ALLOWED_FILES = ('toxygen_inline.png', 'utox-inline.png', 'sticker.png')
def is_inline(file_name):
return file_name in ALLOWED_FILES or file_name.startswith('qTox_Screenshot_')
class StateSignal(QtCore.QObject): class StateSignal(QtCore.QObject):
signal = QtCore.Signal(int, float, int) # state, progress, time in sec signal = QtCore.Signal(int, float, int) # state, progress, time in sec

View file

@ -883,7 +883,7 @@ class Profile(basecontact.BaseContact, Singleton):
settings = Settings.get_instance() settings = Settings.get_instance()
friend = self.get_friend_by_number(friend_number) friend = self.get_friend_by_number(friend_number)
auto = settings['allow_auto_accept'] and friend.tox_id in settings['auto_accept_from_friends'] auto = settings['allow_auto_accept'] and friend.tox_id in settings['auto_accept_from_friends']
inline = (file_name in ALLOWED_FILES) and settings['allow_inline'] inline = is_inline(file_name) and settings['allow_inline']
file_id = self._tox.file_get_file_id(friend_number, file_number) file_id = self._tox.file_get_file_id(friend_number, file_number)
accepted = True accepted = True
if file_id in self._paused_file_transfers: if file_id in self._paused_file_transfers: