# HG changeset patch # User Goffi # Date 1327360931 -3600 # Node ID ba6e1feda03e9aa9fd205c374f225153237720a5 # Parent 72522263cbc9cd0c908d53ff1575effdba372e81 plugin radiocol: fixed autocreation of radiocol for new comers diff -r 72522263cbc9 -r ba6e1feda03e src/plugins/plugin_misc_radiocol.py --- a/src/plugins/plugin_misc_radiocol.py Mon Jan 23 00:14:33 2012 +0100 +++ b/src/plugins/plugin_misc_radiocol.py Tue Jan 24 00:22:11 2012 +0100 @@ -89,10 +89,10 @@ def userJoinedTrigger(self, room, user, profile): """This trigger is used to check if we are waiting people in this room, and to create a game if everybody is here""" - room_jid = room.occupantJID.userhostJID() - if self.radios.has_key(room_jid): + room_jid = room.occupantJID.userhost() + if self.radios.has_key(room_jid) and self.radios[room_jid]["referee"] == room.occupantJID.full(): #we are in a radiocol room, let's start the party ! - mess = self.createRadiocolElt(jid.JID(room_jid.userhost()+'/'+occupant)) + mess = self.createRadiocolElt(jid.JID(room_jid+'/'+user.nick)) mess.firstChildElement().addChild(self.__create_started_elt()) self.host.profiles[profile].xmlstream.send(mess) return True @@ -109,9 +109,9 @@ def radiocolRoomJoined(room): print "radiocolRoomJoined" _room_jid = room.occupantJID.userhostJID() + self.radiocolCreate(_room_jid.userhost(), profile_key=profile) for occupant in occupants: self.host.plugins["XEP-0249"].invite(jid.JID(occupant), room.occupantJID.userhostJID(), {"game":"Radiocol"}, profile) - self.radiocolCreate(_room_jid.userhost(), profile_key=profile) def after_init(ignore): room_name = "sat_radiocol_%s" % self.host.plugins["XEP-0045"].getUniqueName(profile_key)