diff frontends/quick_frontend/quick_app.py @ 76:8becde8a967c

MUC: added subject management - plugin xep-0045: added roomNewSubject signal - wix: added subject bar for group windows
author Goffi <goffi@goffi.org>
date Tue, 30 Mar 2010 13:15:05 +1100
parents 7322a41f8a8e
children ace2af8abc5a
line wrap: on
line diff
--- a/frontends/quick_frontend/quick_app.py	Mon Mar 29 16:54:53 2010 +1100
+++ b/frontends/quick_frontend/quick_app.py	Tue Mar 30 13:15:05 2010 +1100
@@ -45,6 +45,7 @@
         self.bridge.register("roomJoined", self.roomJoined)
         self.bridge.register("roomUserJoined", self.roomUserJoined)
         self.bridge.register("roomUserLeft", self.roomUserLeft)
+        self.bridge.register("roomNewSubject", self.roomNewSubject)
         self.bridge.register("subscribe", self.subscribe)
         self.bridge.register("paramUpdate", self.paramUpdate)
         self.bridge.register("contactDeleted", self.contactDeleted)
@@ -215,7 +216,7 @@
         room_jid=room_id+'@'+room_service
         if self.chat_wins.has_key(room_jid):
             self.chat_wins[room_jid].replaceUser(user_nick)
-        debug (_("user [%(user_nick)s] joined room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid})
+            debug (_("user [%(user_nick)s] joined room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid})
 
     def roomUserLeft(self, room_id, room_service, user_nick, user_data, profile):
         """Called when an user joined a MUC room"""
@@ -224,7 +225,17 @@
         room_jid=room_id+'@'+room_service
         if self.chat_wins.has_key(room_jid):
             self.chat_wins[room_jid].removeUser(user_nick)
-        debug (_("user [%(user_nick)s] left room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid})
+            debug (_("user [%(user_nick)s] left room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid})
+
+    def roomNewSubject(self, room_id, room_service, subject, profile):
+        """Called when subject of MUC room change"""
+        if not self.__check_profile(profile):
+            return
+        room_jid=room_id+'@'+room_service
+        if self.chat_wins.has_key(room_jid):
+            self.chat_wins[room_jid].setSubject(subject)
+            debug (_("new subject for room [%(room_jid)s]: %(subject)s") % {'room_jid':room_jid, "subject":subject})
+        
 
     def subscribe(self, type, raw_jid, profile):
         """Called when a subsciption maangement signal is received"""