comparison plugins/plugin_xep_0045.py @ 93:2f87651a5ad8

Tarot game: basic trick - plugin xep-0045: new method getRoomNick - plugin tarot: basic trick - wix: played card are shown in CardPanel
author Goffi <goffi@goffi.org>
date Sun, 30 May 2010 15:33:08 +0930
parents 39c672544593
children 7201851d9aed
comparison
equal deleted inserted replaced
92:2503de7fb4c7 93:2f87651a5ad8
108 return result 108 return result
109 for room in self.clients[profile].joined_rooms.values(): 109 for room in self.clients[profile].joined_rooms.values():
110 result.append((room.roomIdentifier, room.service, [user.nick for user in room.roster.values()], room.nick)) 110 result.append((room.roomIdentifier, room.service, [user.nick for user in room.roster.values()], room.nick))
111 return result 111 return result
112 112
113 def getRoomNick(self, room_jid, profile_key='@DEFAULT@'):
114 """return nick used in room by user
115 @param room_jid: unicode room id
116 @profile_key: profile
117 @return: nick or empty string in case of error"""
118 profile = self.host.memory.getProfileName(profile_key)
119 if not self.__check_profile(profile) or not self.clients[profile].joined_rooms.has_key(room_jid):
120 return ''
121 return self.clients[profile].joined_rooms[room_jid].nick
122
123
113 def getRoomSubjects(self, profile_key='@DEFAULT@'): 124 def getRoomSubjects(self, profile_key='@DEFAULT@'):
114 """Return received subjects of rooms""" 125 """Return received subjects of rooms"""
115 profile = self.host.memory.getProfileName(profile_key) 126 profile = self.host.memory.getProfileName(profile_key)
116 if not self.__check_profile(profile): 127 if not self.__check_profile(profile):
117 return [] 128 return []