Skip to content
Snippets Groups Projects
Commit 2cfe7ad0 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

don't print empty messages (especialy with typing notif)

parent 92c0c5fd
No related branches found
No related tags found
No related merge requests found
......@@ -377,6 +377,20 @@ class Interface:
not gajim.contacts[account].has_key(jid):
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
if not self.windows[account]['chats'].has_key(jid) and \
not gajim.awaiting_messages[account].has_key(jid):
......@@ -409,18 +423,7 @@ class Interface:
self.play_sound('next_message_received')
if self.remote and self.remote.is_enabled():
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):
#('MSGERROR', account, (jid, error_code, error_msg, msg, time))
fjid = array[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment