MUC: added subject management

- plugin xep-0045: added roomNewSubject signal
- wix: added subject bar for group windows
This commit is contained in:
Goffi 2010-03-30 13:15:05 +11:00
commit 5486458797

View file

@ -72,6 +72,7 @@ class XEP_0045():
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 @@ class XEP_0045():
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 @@ class SatMUCClient (muc.MUCClient):
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