Mercurial > xib
comparison muc.py @ 111:59401ac0f47a
handle XMPP remote-server-not-found
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Fri, 27 Nov 2009 22:47:27 +0100 |
parents | 965dd6f5fcc3 |
children | 11717d14e22f |
comparison
equal
deleted
inserted
replaced
110:ec4fbec1f160 | 111:59401ac0f47a |
---|---|
27 class NicknameConflict(Exception): pass | 27 class NicknameConflict(Exception): pass |
28 class RoomIsFull(Exception): pass | 28 class RoomIsFull(Exception): pass |
29 class RoomIsLocked(Exception): pass | 29 class RoomIsLocked(Exception): pass |
30 class ForgotNickname(Exception): pass | 30 class ForgotNickname(Exception): pass |
31 class UnknownError(Exception): pass | 31 class UnknownError(Exception): pass |
32 class RemoteServerNotFound(Exception): pass | |
32 | 33 |
33 def __init__(self, room_jid): | 34 def __init__(self, room_jid): |
34 self.room_jid = room_jid | 35 self.room_jid = room_jid |
35 self.connected = False | 36 self.connected = False |
36 self.participants = {} | 37 self.participants = {} |
87 # room is locked | 88 # room is locked |
88 errors.append(self.__class__.RoomIsLocked(self.jid)) | 89 errors.append(self.__class__.RoomIsLocked(self.jid)) |
89 elif err == 'modify jid-malformed': | 90 elif err == 'modify jid-malformed': |
90 # forgot to give a nickname | 91 # forgot to give a nickname |
91 errors.append(self.__class__.ForgotNickname(self.jid)) | 92 errors.append(self.__class__.ForgotNickname(self.jid)) |
93 elif err == 'cancel remote-server-not-found': | |
94 # MUC server is down or doesn't exist | |
95 errors.append(self.__class__.RemoteServerNotFound(self.jid)) | |
92 else: | 96 else: |
93 errors.append(self.__class__.UnknownError(presence.__str__(fancy=1).encode('utf-8'))) | 97 errors.append(self.__class__.UnknownError(presence.__str__(fancy=1).encode('utf-8'))) |
94 break | 98 break |
95 if len(errors) == 0: | 99 if len(errors) == 0: |
96 errors.append(self.__class__.UnknownError(presence.__str__(fancy=1).encode('utf-8'))) | 100 errors.append(self.__class__.UnknownError(presence.__str__(fancy=1).encode('utf-8'))) |