# HG changeset patch # User souliane # Date 1385670438 -3600 # Node ID 5a131930348db13ee78bad997eb91e82129d5477 # Parent 03744d9ebc1385531d47046c18cbf998adfe076a plugin XEP-0045: remove redondant errback from _join diff -r 03744d9ebc13 -r 5a131930348d src/plugins/plugin_xep_0045.py --- a/src/plugins/plugin_xep_0045.py Wed Dec 11 17:16:53 2013 +0100 +++ b/src/plugins/plugin_xep_0045.py Thu Nov 28 21:27:18 2013 +0100 @@ -105,7 +105,7 @@ # we have a nickname conflict, we try again with "_" suffixed to current nickname nick += '_' return self.clients[profile].join(room_jid, nick, history_options, password).addCallbacks(self.__room_joined, self.__err_joining_room, callbackKeywords={'profile': profile}, errbackArgs=[room_jid, nick, history_options, password, profile]) - mess = _("Error when joining the room %s" % room_jid.userhost()) + mess = _("Error while joining the room %s" % room_jid.userhost()) error(mess) self.host.bridge.newAlert(mess, _("Group chat error"), "ERROR", profile) raise failure @@ -235,9 +235,13 @@ password = options["password"] if "password" in options else None return self.clients[profile].join(room_jid, nick, history_options, password).addCallbacks(self.__room_joined, self.__err_joining_room, callbackKeywords={'profile': profile}, errbackArgs=[room_jid, nick, history_options, password, profile]) + # FIXME: how to set the cancel method on the Deferred created by wokkel? + # This happens when the room is not reachable, e.g. no internet connection: + # > /usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py(480)_startRunCallbacks() + # -> raise AlreadyCalledError(extra) def _join(self, room_jid_s, nick, options={}, profile_key='@DEFAULT@'): - """join method used by bridge: use the _join method, but doesn't return any deferred + """join method used by bridge: use the join method, but doesn't return any deferred @return the room userhost (given value or unique generated name) """ profile = self.host.memory.getProfileName(profile_key) @@ -253,7 +257,7 @@ self.host.bridge.newAlert(mess, _("Group chat error"), "ERROR", profile) return d = self.join(room_jid, nick, options, profile) - d.addErrback(lambda x: warning(_('Error while joining room'))) # TODO: error management + signal in bridge + # TODO: error management + signal in bridge return room_jid_s def nick(self, room_jid, nick, profile_key): @@ -372,12 +376,3 @@ debug(_("New subject for room (%(room_id)s): %(subject)s") % {'room_id': room.roomJID.full(), 'subject': subject}) self.rec_subjects[room.roomJID.userhost()] = (room.roomJID.userhost(), subject) self.host.bridge.roomNewSubject(room.roomJID.userhost(), subject, self.parent.profile) - - #def connectionInitialized(self): - #pass - - #def getDiscoInfo(self, requestor, target, nodeIdentifier=''): - #return [disco.DiscoFeature(NS_VCARD)] - - #def getDiscoItems(self, requestor, target, nodeIdentifier=''): - #return []