don't print empty messages (especialy with typing notif)
This commit is contained in:
parent
92c0c5fdb2
commit
2cfe7ad0d4
25
src/gajim.py
25
src/gajim.py
|
@ -377,6 +377,20 @@ class Interface:
|
||||||
not gajim.contacts[account].has_key(jid):
|
not gajim.contacts[account].has_key(jid):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if self.windows[account]['chats'].has_key(jid):
|
||||||
|
chat_win = self.windows[account]['chats'][jid]
|
||||||
|
# chatstates - display jep85 events in window
|
||||||
|
if chatstate_tag != None:
|
||||||
|
if chat_win.chatstates[jid] == 'ask':
|
||||||
|
chat_win.chatstates[jid] = 'active'
|
||||||
|
chat_win.print_conversation(jid + ' is now ' + chatstate_tag, jid, 'status', tim = array[2])
|
||||||
|
else:
|
||||||
|
# got no valid jep85 answer, peer does not support it
|
||||||
|
chat_win.chatstates[jid] = -1
|
||||||
|
|
||||||
|
if not array[1]: #empty message
|
||||||
|
return
|
||||||
|
|
||||||
first = False
|
first = False
|
||||||
if not self.windows[account]['chats'].has_key(jid) and \
|
if not self.windows[account]['chats'].has_key(jid) and \
|
||||||
not gajim.awaiting_messages[account].has_key(jid):
|
not gajim.awaiting_messages[account].has_key(jid):
|
||||||
|
@ -409,17 +423,6 @@ class Interface:
|
||||||
self.play_sound('next_message_received')
|
self.play_sound('next_message_received')
|
||||||
if self.remote and self.remote.is_enabled():
|
if self.remote and self.remote.is_enabled():
|
||||||
self.remote.raise_signal('NewMessage', (account, array))
|
self.remote.raise_signal('NewMessage', (account, array))
|
||||||
if self.windows[account]['chats'].has_key(jid):
|
|
||||||
chat_win = self.windows[account]['chats'][jid]
|
|
||||||
# chatstates - display jep85 events in window
|
|
||||||
if chatstate_tag != None:
|
|
||||||
if chat_win.chatstates[jid] == 'ask':
|
|
||||||
chat_win.chatstates[jid] = 'active'
|
|
||||||
chat_win.print_conversation(jid + ' is now ' + chatstate_tag, jid, 'status', tim = array[2])
|
|
||||||
else:
|
|
||||||
# got no valid jep85 answer, peer does not support it
|
|
||||||
chat_win.chatstates[jid] = -1
|
|
||||||
|
|
||||||
|
|
||||||
def handle_event_msgerror(self, account, array):
|
def handle_event_msgerror(self, account, array):
|
||||||
#('MSGERROR', account, (jid, error_code, error_msg, msg, time))
|
#('MSGERROR', account, (jid, error_code, error_msg, msg, time))
|
||||||
|
|
Loading…
Reference in New Issue