# HG changeset patch # User Goffi # Date 1269409853 -39600 # Node ID 6e3a06b4dd3641bf04f9e8d1acf6b5ebb6ac721b # Parent 9d113b5471e6c49716d088c7da3525dc7409fd57 plugin xep-0045: added roomUserJoined and roomUserLeft signals diff -r 9d113b5471e6 -r 6e3a06b4dd36 plugins/plugin_xep_0045.py --- a/plugins/plugin_xep_0045.py Mon Mar 22 14:21:57 2010 +1100 +++ b/plugins/plugin_xep_0045.py Wed Mar 24 16:50:53 2010 +1100 @@ -70,6 +70,8 @@ self.clients={} host.bridge.addMethod("joinMUC", ".communication", in_sign='ssss', out_sign='', method=self.join) 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 def __check_profile(self, profile): if not profile or not self.clients.has_key(profile) or not self.host.isConnected(profile): @@ -122,6 +124,15 @@ def receivedGroupChat(self, room, user, body): debug('receivedGroupChat: room=%s user=%s body=%s', room, user, body) + def userJoinedRoom(self, room, user): + debug (_("user %(nick)s has joined room (%(room_id)s)") % {'nick':user.nick, 'room_id':room.occupantJID.userhost()}) + user_data={'entity':user.entity or '', 'affiliation':user.affiliation, 'role':user.role} + self.host.bridge.roomUserJoined(room.roomIdentifier, room.service, user.nick, user_data, self.parent.profile) + + def userLeftRoom(self, room, user): + debug (_("user %(nick)s left room (%(room_id)s)") % {'nick':user.nick, 'room_id':room.occupantJID.userhost()}) + 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 connectionInitialized(self): #pass diff -r 9d113b5471e6 -r 6e3a06b4dd36 sat_bridge/DBus.py --- a/sat_bridge/DBus.py Mon Mar 22 14:21:57 2010 +1100 +++ b/sat_bridge/DBus.py Wed Mar 24 16:50:53 2010 +1100 @@ -362,4 +362,5 @@ def addSignal(self, name, int_suffix, signature): self.dbus_bridge.addSignal(name, int_suffix, signature) + setattr(DBusBridge, name, getattr(self.dbus_bridge, name))