# HG changeset patch # User Goffi # Date 1318093468 -7200 # Node ID b03b38b20c1810c9ec9f87247b8076954af19971 # Parent 10b4f577d0c02c823247813ab6b17f3e9c8f15fb plugin XEP-0045: send error on invalid room jid on _join diff -r 10b4f577d0c0 -r b03b38b20c18 src/plugins/plugin_xep_0045.py --- a/src/plugins/plugin_xep_0045.py Sat Oct 08 18:43:17 2011 +0200 +++ b/src/plugins/plugin_xep_0045.py Sat Oct 08 19:04:28 2011 +0200 @@ -154,9 +154,19 @@ return self.clients[profile].join(room_jid, nick, history_options, password).addCallbacks(self.__room_joined, self.__err_joining_room, callbackKeywords={'profile':profile}, errbackKeywords={'profile':profile}) - def _join(self, room_jid, nick, options={}, profile_key='@DEFAULT@'): + 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""" - d = self.join(jid.JID(room_jid), nick, options, profile_key) + profile = self.host.memory.getProfileName(profile_key) + if not self.__check_profile(profile): + return + try: + room_jid = jid.JID(room_jid_s) + except: + mess = _("Invalid room jid: %s") % room_jid_s + warning(mess) + self.host.bridge.newAlert(mess, _("Group chat error"), "ERROR", profile) + return + d = self.join(jid.JID(room_jid), nick, options, profile) d.addErrback(lambda x: warning(_('Error while joining room'))) #TODO: error management + signal in bridge def getHandler(self, profile):