Mercurial > xib
comparison muc.py @ 81:22cfc31f9c90
Fixed muc.py
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sat, 05 Sep 2009 20:01:31 +0200 |
parents | faa468731d8a |
children | 965dd6f5fcc3 |
comparison
equal
deleted
inserted
replaced
80:4e18b435566a | 81:22cfc31f9c90 |
---|---|
62 for cc in c.getChildren(): | 62 for cc in c.getChildren(): |
63 if cc.getNamespace() == 'urn:ietf:params:xml:ns:xmpp-stanzas' and cc.getName() != 'text': | 63 if cc.getNamespace() == 'urn:ietf:params:xml:ns:xmpp-stanzas' and cc.getName() != 'text': |
64 err = c.getAttr('type')+' '+cc.getName() | 64 err = c.getAttr('type')+' '+cc.getName() |
65 if err == 'auth not-authorized': | 65 if err == 'auth not-authorized': |
66 # password-protected room | 66 # password-protected room |
67 errors.append(self.__class__.PasswordNeeded()) | 67 errors.append(self.__class__.PasswordNeeded(self.jid)) |
68 elif err == 'auth registration-required': | 68 elif err == 'auth registration-required': |
69 # members-only room | 69 # members-only room |
70 errors.append(self.__class__.MembersOnlyRoom()) | 70 errors.append(self.__class__.MembersOnlyRoom(self.jid)) |
71 elif err == 'auth forbidden': | 71 elif err == 'auth forbidden': |
72 # banned from room | 72 # banned from room |
73 errors.append(self.__class__.BannedFromRoom()) | 73 errors.append(self.__class__.BannedFromRoom(self.jid)) |
74 elif err == 'cancel conflict': | 74 elif err == 'cancel conflict': |
75 # nickname conflict | 75 # nickname conflict |
76 errors.append(self.__class__.NicknameConflict()) | 76 errors.append(self.__class__.NicknameConflict(self.jid)) |
77 elif err == 'wait service-unavailable': | 77 elif err == 'wait service-unavailable': |
78 # room is full | 78 # room is full |
79 errors.append(self.__class__.RoomIsFull()) | 79 errors.append(self.__class__.RoomIsFull(self.jid)) |
80 elif err == 'cancel item-not-found': | 80 elif err == 'cancel item-not-found': |
81 # room is locked | 81 # room is locked |
82 errors.append(self.__class__.RoomIsLocked()) | 82 errors.append(self.__class__.RoomIsLocked(self.jid)) |
83 elif err == 'modify jid-malformed': | 83 elif err == 'modify jid-malformed': |
84 # forgot to give a nickname | 84 # forgot to give a nickname |
85 errors.append(self.__class__.ForgotNickname()) | 85 errors.append(self.__class__.ForgotNickname(self.jid)) |
86 else: | 86 else: |
87 errors.append(self.__class__.UnknownError(presence.__str__(fancy=1).decode('utf-8'))) | 87 errors.append(self.__class__.UnknownError(presence.__str__(fancy=1).encode('utf-8'))) |
88 break | 88 break |
89 if len(errors) == 0: | 89 if len(errors) == 0: |
90 errors.append(self.__class__.UnknownError(presence.__str__(fancy=1).decode('utf-8'))) | 90 errors.append(self.__class__.UnknownError(presence.__str__(fancy=1).encode('utf-8'))) |
91 else: | 91 else: |
92 self.connected = True | 92 self.connected = True |
93 xmpp_c.UnregisterHandler('presence', self._xmpp_presence_handler) | 93 xmpp_c.UnregisterHandler('presence', self._xmpp_presence_handler) |
94 if self.callback != None: | 94 if self.callback != None: |
95 self.callback(errors) | 95 self.callback(errors) |