summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2011-01-05 01:59:26 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2011-01-05 01:59:26 +0000
commit828ed2991be8b5592e5cddd6980cdc3335df1645 (patch)
treee94b07a43e4dcafaf01e07ce847188c19c34351c
parent98c32b05e80ee34822afe3ed37624bb3d0656bdf (diff)
downloadpoezio-828ed2991be8b5592e5cddd6980cdc3335df1645.tar.gz
poezio-828ed2991be8b5592e5cddd6980cdc3335df1645.tar.bz2
poezio-828ed2991be8b5592e5cddd6980cdc3335df1645.tar.xz
poezio-828ed2991be8b5592e5cddd6980cdc3335df1645.zip
also displays a message in ConversationTabs when a resource goes online
-rw-r--r--src/core.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core.py b/src/core.py
index 745f24d5..acb6d03d 100644
--- a/src/core.py
+++ b/src/core.py
@@ -225,11 +225,12 @@ class Core(object):
resource.set_status(status_message)
resource.set_presence(status)
resource.set_priority(priority)
- contact.add_resource(resource)
self.information("%s is online (%s)" % (resource.get_jid().full, status), "Roster")
- tab = self.get_tab_by_name(jid.full)
- if tab and isinstance(tab, tabs.ConversationTab):
- self.add_message_to_text_buffer(tab.get_room(), '%s is offline' % (resource.get_jid().full))
+ self.add_information_message_to_conversation_tab(jid.full, '%s is online' % (jid.full))
+ if not contact.get_highest_priority_resource():
+ # No connected resource yet: the user's just connecting
+ self.add_information_message_to_conversation_tab(jid.bare, '%s is online' % (jid.bare))
+ contact.add_resource(resource)
def add_information_message_to_conversation_tab(self, jid, msg):
"""