plugin OTR: a warning is logged when Account is instancied with a bare jid.
This commit is contained in:
parent
ebf651226e
commit
ed3313c169
1 changed files with 7 additions and 3 deletions
|
|
@ -80,7 +80,7 @@ class Context(potr.context.Context):
|
|||
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 @@ class Account(potr.context.Account):
|
|||
|
||||
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 @@ class ContextManager(object):
|
|||
|
||||
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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue