plugin sec_otr: fixes bad handling of entity disconnection
This commit is contained in:
parent
57176d1018
commit
288f6aa100
1 changed files with 7 additions and 3 deletions
|
|
@ -476,7 +476,11 @@ class OTR(object):
|
|||
if show != C.PRESENCE_UNAVAILABLE:
|
||||
return True
|
||||
if not entity.resource:
|
||||
entity.resource = self.host.memory.getMainResource(entity, profile) # FIXME: temporary and unsecure, must be changed when frontends are refactored
|
||||
otrctx = self.context_managers[profile].getContextForUser(entity)
|
||||
otrctx.disconnect()
|
||||
try:
|
||||
entity.resource = self.host.memory.getMainResource(entity, profile) # FIXME: temporary and unsecure, must be changed when frontends are refactored
|
||||
except exceptions.UnknownEntityError:
|
||||
return True # entity was not connected
|
||||
if entity in self.context_managers[profile].contexts:
|
||||
otrctx = self.context_managers[profile].getContextForUser(entity)
|
||||
otrctx.disconnect()
|
||||
return True
|
||||
|
|
|
|||
Loading…
Reference in a new issue