comparison src/plugins/plugin_xep_0045.py @ 713:8bd63daecdbf

plugin XEP-0045: fixed incorrect exceptions name
author souliane <souliane@mailoo.org>
date Sun, 17 Nov 2013 17:02:22 +0100
parents f610864eb7a5
children f47d7c09c60b
comparison
equal deleted inserted replaced
712:f610864eb7a5 713:8bd63daecdbf
132 132
133 def isNickInRoom(self, room_jid, nick, profile): 133 def isNickInRoom(self, room_jid, nick, profile):
134 """Tell if a nick is currently present in a room""" 134 """Tell if a nick is currently present in a room"""
135 profile = self.host.memory.getProfileName(profile) 135 profile = self.host.memory.getProfileName(profile)
136 if not self.__check_profile(profile): 136 if not self.__check_profile(profile):
137 raise exceptions.UnknownProfileError("Unknown or disconnected profile") 137 raise exceptions.ProfileUnknownError("Unknown or disconnected profile")
138 if room_jid.userhost() not in self.clients[profile].joined_rooms: 138 if room_jid.userhost() not in self.clients[profile].joined_rooms:
139 raise UnknownRoom("This room has not been joined") 139 raise UnknownRoom("This room has not been joined")
140 return self.clients[profile].joined_rooms[room_jid.userhost()].inRoster(muc.User(nick)) 140 return self.clients[profile].joined_rooms[room_jid.userhost()].inRoster(muc.User(nick))
141 141
142 def getRoomsSubjects(self, profile_key='@DEFAULT@'): 142 def getRoomsSubjects(self, profile_key='@DEFAULT@'):
219 return room_jid_s 219 return room_jid_s
220 220
221 def nick(self, room_jid, nick, profile_key): 221 def nick(self, room_jid, nick, profile_key):
222 profile = self.host.memory.getProfileName(profile_key) 222 profile = self.host.memory.getProfileName(profile_key)
223 if not self.__check_profile(profile): 223 if not self.__check_profile(profile):
224 raise exceptions.UnknownProfileError("Unknown or disconnected profile") 224 raise exceptions.ProfileUnknownError("Unknown or disconnected profile")
225 if room_jid.userhost() not in self.clients[profile].joined_rooms: 225 if room_jid.userhost() not in self.clients[profile].joined_rooms:
226 raise UnknownRoom("This room has not been joined") 226 raise UnknownRoom("This room has not been joined")
227 return self.clients[profile].nick(room_jid, nick) 227 return self.clients[profile].nick(room_jid, nick)
228 228
229 def leave(self, room_jid, profile_key): 229 def leave(self, room_jid, profile_key):
230 profile = self.host.memory.getProfileName(profile_key) 230 profile = self.host.memory.getProfileName(profile_key)
231 if not self.__check_profile(profile): 231 if not self.__check_profile(profile):
232 raise exceptions.UnknownProfileError("Unknown or disconnected profile") 232 raise exceptions.ProfileUnknownError("Unknown or disconnected profile")
233 if room_jid.userhost() not in self.clients[profile].joined_rooms: 233 if room_jid.userhost() not in self.clients[profile].joined_rooms:
234 raise UnknownRoom("This room has not been joined") 234 raise UnknownRoom("This room has not been joined")
235 return self.clients[profile].leave(room_jid) 235 return self.clients[profile].leave(room_jid)
236 236
237 def subject(self, room_jid, subject, profile_key): 237 def subject(self, room_jid, subject, profile_key):
238 profile = self.host.memory.getProfileName(profile_key) 238 profile = self.host.memory.getProfileName(profile_key)
239 if not self.__check_profile(profile): 239 if not self.__check_profile(profile):
240 raise exceptions.UnknownProfileError("Unknown or disconnected profile") 240 raise exceptions.ProfileUnknownError("Unknown or disconnected profile")
241 if room_jid.userhost() not in self.clients[profile].joined_rooms: 241 if room_jid.userhost() not in self.clients[profile].joined_rooms:
242 raise UnknownRoom("This room has not been joined") 242 raise UnknownRoom("This room has not been joined")
243 return self.clients[profile].subject(room_jid, subject) 243 return self.clients[profile].subject(room_jid, subject)
244 244
245 def mucNick(self, room_jid_s, nick, profile_key='@DEFAULT@'): 245 def mucNick(self, room_jid_s, nick, profile_key='@DEFAULT@'):