plugin XEP-0045: fixed incorrect exceptions name

This commit is contained in:
souliane 2013-11-17 17:02:22 +01:00
commit 4ef842a213

View file

@ -134,7 +134,7 @@ class XEP_0045(object):
"""Tell if a nick is currently present in a room"""
profile = self.host.memory.getProfileName(profile)
if not self.__check_profile(profile):
raise exceptions.UnknownProfileError("Unknown or disconnected profile")
raise exceptions.ProfileUnknownError("Unknown or disconnected profile")
if room_jid.userhost() not in self.clients[profile].joined_rooms:
raise UnknownRoom("This room has not been joined")
return self.clients[profile].joined_rooms[room_jid.userhost()].inRoster(muc.User(nick))
@ -221,7 +221,7 @@ class XEP_0045(object):
def nick(self, room_jid, nick, profile_key):
profile = self.host.memory.getProfileName(profile_key)
if not self.__check_profile(profile):
raise exceptions.UnknownProfileError("Unknown or disconnected profile")
raise exceptions.ProfileUnknownError("Unknown or disconnected profile")
if room_jid.userhost() not in self.clients[profile].joined_rooms:
raise UnknownRoom("This room has not been joined")
return self.clients[profile].nick(room_jid, nick)
@ -229,7 +229,7 @@ class XEP_0045(object):
def leave(self, room_jid, profile_key):
profile = self.host.memory.getProfileName(profile_key)
if not self.__check_profile(profile):
raise exceptions.UnknownProfileError("Unknown or disconnected profile")
raise exceptions.ProfileUnknownError("Unknown or disconnected profile")
if room_jid.userhost() not in self.clients[profile].joined_rooms:
raise UnknownRoom("This room has not been joined")
return self.clients[profile].leave(room_jid)
@ -237,7 +237,7 @@ class XEP_0045(object):
def subject(self, room_jid, subject, profile_key):
profile = self.host.memory.getProfileName(profile_key)
if not self.__check_profile(profile):
raise exceptions.UnknownProfileError("Unknown or disconnected profile")
raise exceptions.ProfileUnknownError("Unknown or disconnected profile")
if room_jid.userhost() not in self.clients[profile].joined_rooms:
raise UnknownRoom("This room has not been joined")
return self.clients[profile].subject(room_jid, subject)