comparison bridge.py @ 62:61491895c607

Added bridge.hasParticipant() and fixed participant.changeNickname() Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sat, 29 Aug 2009 14:52:11 +0200
parents d8941159fd44
children 71508f22edb4
comparison
equal deleted inserted replaced
61:624c086b0a02 62:61491895c607
157 for p in self.participants: 157 for p in self.participants:
158 if p.protocol in protocols: 158 if p.protocol in protocols:
159 participants_nicknames.append('"'+p.nickname+'"') 159 participants_nicknames.append('"'+p.nickname+'"')
160 self.lock.release() 160 self.lock.release()
161 return participants_nicknames 161 return participants_nicknames
162
163
164 def hasParticipant(self, nickname):
165 try:
166 self.getParticipant(nickname)
167 return True
168 except NoSuchParticipantException:
169 return False
162 170
163 171
164 def removeParticipant(self, left_protocol, nickname, leave_message): 172 def removeParticipant(self, left_protocol, nickname, leave_message):
165 """Remove the participant using nickname from the bridge. Raises a NoSuchParticipantException if nickname is not used in the bridge.""" 173 """Remove the participant using nickname from the bridge. Raises a NoSuchParticipantException if nickname is not used in the bridge."""
166 174