# HG changeset patch # User Goffi # Date 1408995143 -7200 # Node ID 3158f9e08760d2b7077c3537e83e63d6aa31def5 # Parent 8def4a3f55c2e99f53668d05941d3774747a6483 plugin OTR: a warning is logged when Account is instancied with a bare jid. diff -r 8def4a3f55c2 -r 3158f9e08760 src/plugins/plugin_sec_otr.py --- a/src/plugins/plugin_sec_otr.py Mon Aug 25 21:32:23 2014 +0200 +++ b/src/plugins/plugin_sec_otr.py Mon Aug 25 21:32:23 2014 +0200 @@ -80,7 +80,7 @@ def setState(self, state): old_state = self.state super(Context, self).setState(state) - log.debug(u"setState: %s (old_state=%s) " % (state, old_state)) + log.debug(u"setState: %s (old_state=%s)" % (state, old_state)) if state == potr.context.STATE_PLAINTEXT: feedback = _(u"/!\\ conversation with %(other_jid)s is now UNENCRYPTED") % {'other_jid': self.peer.full()} @@ -116,7 +116,9 @@ def __init__(self, host, client): log.debug(u"new account: %s" % client.jid) - super(Account, self).__init__(client.jid, "xmpp", 1024) + if not client.jid.resource: + log.warning("Account created without resource") + super(Account, self).__init__(unicode(client.jid), "xmpp", 1024) self.host = host self.client = client @@ -147,6 +149,8 @@ def getContextForUser(self, other): log.debug(u"getContextForUser [%s]" % other) + if not other.resource: + log.warning("getContextForUser called with a bare jid") return self.startContext(other) diff -r 8def4a3f55c2 -r 3158f9e08760 src/plugins/plugin_xep_0045.py --- a/src/plugins/plugin_xep_0045.py Mon Aug 25 21:32:23 2014 +0200 +++ b/src/plugins/plugin_xep_0045.py Mon Aug 25 21:32:23 2014 +0200 @@ -220,9 +220,9 @@ def _configureRoomMenu(self, menu_data, profile): """Return room configuration form + @param menu_data: %(menu_data)s @param profile: %(doc_profile)s - """ try: room_jid = jid.JID(menu_data['room_jid'])