Basic user joined/left management

- plugin XEP-0045: user joined./left signal is sended
- wix: user are adder/removed when these signals are catched
This commit is contained in:
Goffi 2010-03-29 16:54:53 +11:00
commit 39807e5b36

View file

@ -74,6 +74,10 @@ class XEP_0045():
host.bridge.addSignal("roomUserLeft", ".communication", signature='sssa{ss}s') #args: room_id, room_service, user_nick, user_data, profile
def __check_profile(self, profile):
"""check if profile is used and connected
if profile known but disconnected, remove it from known profiles
@param profile: profile to check
@return: True if the profile is known and connected, else False"""
if not profile or not self.clients.has_key(profile) or not self.host.isConnected(profile):
error (_('Unknown or disconnected profile'))
if self.clients.has_key(profile):
@ -86,9 +90,9 @@ class XEP_0045():
print "room joined (profile = %s)" % profile
room_jid = room.roomIdentifier+'@'+room.service
self.clients[profile].joined_rooms[room_jid] = room
self.host.bridge.roomJoined(room.roomIdentifier, room.service, room.roster.keys(), room.nick, profile)
self.host.bridge.roomJoined(room.roomIdentifier, room.service, [user.nick for user in room.roster.values()], room.nick, profile)
def __err_joining_room(self, failure, profile): #, profile):
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()