diff plugins/plugin_xep_0045.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 1ae680f9682e
line wrap: on
line diff
--- a/plugins/plugin_xep_0045.py	Mon Mar 29 16:54:53 2010 +1100
+++ b/plugins/plugin_xep_0045.py	Tue Mar 30 13:15:05 2010 +1100
@@ -72,6 +72,7 @@
         host.bridge.addSignal("roomJoined", ".communication", signature='ssasss') #args: room_id, room_service, room_nicks, user_nick, profile
         host.bridge.addSignal("roomUserJoined", ".communication", signature='sssa{ss}s') #args: room_id, room_service, user_nick, user_data, profile
         host.bridge.addSignal("roomUserLeft", ".communication", signature='sssa{ss}s') #args: room_id, room_service, user_nick, user_data, profile
+        host.bridge.addSignal("roomNewSubject", ".communication", signature='ssss') #args: room_id, room_service, subject, profile
 
     def __check_profile(self, profile):
         """check if profile is used and connected
@@ -95,7 +96,7 @@
     def __err_joining_room(self, failure, profile):
         """Called when something is going wrong when joining the room"""
         error ("Error when joining the room")
-        pdb.set_trace()
+        #TODO: gof: send an error message throught the bridge
 
     def join(self, service, roomId, nick, profile_key='@DEFAULT@'):
         profile = self.host.memory.getProfileName(profile_key)
@@ -138,6 +139,10 @@
         user_data={'entity':user.entity or '', 'affiliation':user.affiliation, 'role':user.role} 
         self.host.bridge.roomUserLeft(room.roomIdentifier, room.service, user.nick, user_data, self.parent.profile)
 
+    def receivedSubject(self, room, subject):
+        debug (_("New subject for room (%(room_id)s): %(subject)s") % {'room_id':room.occupantJID.userhost(),'subject':subject})
+        self.host.bridge.roomNewSubject(room.roomIdentifier, room.service, subject, self.parent.profile)
+
     #def connectionInitialized(self):
         #pass