Do not create a private tab when receiving only a chatstate

This commit is contained in:
mathieui 2011-11-09 14:07:10 +01:00
parent 98b9506983
commit cc7f010aed

View file

@ -560,13 +560,14 @@ class Core(object):
jid = message['from'] jid = message['from']
nick_from = jid.resource nick_from = jid.resource
room_from = jid.bare room_from = jid.bare
body = xhtml.get_body_from_message_stanza(message)
tab = self.get_tab_by_name(jid.full, tabs.PrivateTab) # get the tab with the private conversation tab = self.get_tab_by_name(jid.full, tabs.PrivateTab) # get the tab with the private conversation
if not tab: # It's the first message we receive: create the tab if not tab: # It's the first message we receive: create the tab
tab = self.open_private_window(room_from, nick_from, False) if body:
tab = self.open_private_window(room_from, nick_from, False)
if not tab: if not tab:
return return
self.events.trigger('private_msg', message) self.events.trigger('private_msg', message)
body = xhtml.get_body_from_message_stanza(message)
if not body: if not body:
return return
tab.add_message(body, time=None, nickname=nick_from, tab.add_message(body, time=None, nickname=nick_from,