comparison src/plugins/plugin_xep_0045.py @ 509:64ff046dc201

plugin text commands: added /join command
author Goffi <goffi@goffi.org>
date Fri, 28 Sep 2012 00:48:52 +0200
parents f98bef71a918
children 29b5ef129488
comparison
equal deleted inserted replaced
508:7c6609dddb2c 509:64ff046dc201
115 return result 115 return result
116 for room in self.clients[profile].joined_rooms.values(): 116 for room in self.clients[profile].joined_rooms.values():
117 result.append((room.roomJID.userhost(), [user.nick for user in room.roster.values()], room.nick)) 117 result.append((room.roomJID.userhost(), [user.nick for user in room.roster.values()], room.nick))
118 return result 118 return result
119 119
120 def getRoomNick(self, room_jid, profile_key='@DEFAULT@'): 120 def getRoomNick(self, room_jid_s, profile_key='@DEFAULT@'):
121 """return nick used in room by user 121 """return nick used in room by user
122 @param room_jid: unicode room id 122 @param room_jid_s: unicode room id
123 @profile_key: profile 123 @profile_key: profile
124 @return: nick or empty string in case of error""" 124 @return: nick or empty string in case of error"""
125 profile = self.host.memory.getProfileName(profile_key) 125 profile = self.host.memory.getProfileName(profile_key)
126 if not self.__check_profile(profile) or not self.clients[profile].joined_rooms.has_key(room_jid): 126 if not self.__check_profile(profile) or not self.clients[profile].joined_rooms.has_key(room_jid_s):
127 return '' 127 return ''
128 return self.clients[profile].joined_rooms[room_jid].nick 128 return self.clients[profile].joined_rooms[room_jid_s].nick
129 129
130 def getRoomsSubjects(self, profile_key='@DEFAULT@'): 130 def getRoomsSubjects(self, profile_key='@DEFAULT@'):
131 """Return received subjects of rooms""" 131 """Return received subjects of rooms"""
132 profile = self.host.memory.getProfileName(profile_key) 132 profile = self.host.memory.getProfileName(profile_key)
133 if not self.__check_profile(profile): 133 if not self.__check_profile(profile):