core, plugins: host.getClient now raise an exception instead of returning None when no profile is found, plugins have been adapted consequently and a bit cleaned
This commit is contained in:
parent
ed9df2984d
commit
a6897c76e0
1 changed files with 25 additions and 140 deletions
|
|
@ -21,11 +21,8 @@ from sat.core.i18n import _
|
|||
from sat.core.constants import Const as C
|
||||
from logging import debug, info, error, warning
|
||||
from twisted.words.xish import domish
|
||||
from twisted.words.protocols.jabber import client, jid, xmlstream
|
||||
from twisted.words.protocols.jabber import error as jab_error
|
||||
from twisted.words.protocols.jabber.xmlstream import IQ
|
||||
from twisted.words.protocols.jabber import jid
|
||||
from sat.memory.persistent import PersistentBinaryDict
|
||||
import os.path
|
||||
import types
|
||||
|
||||
from zope.interface import implements
|
||||
|
|
@ -126,9 +123,6 @@ class XEP_0115(object):
|
|||
raise HashGenerationError
|
||||
|
||||
client = self.host.getClient(profile_key)
|
||||
if not client:
|
||||
error('Requesting hash for an inexistant client')
|
||||
raise HashGenerationError
|
||||
|
||||
def generateHash_2(services, profile):
|
||||
_s = []
|
||||
|
|
@ -149,7 +143,7 @@ class XEP_0115(object):
|
|||
debug(_('Capability hash generated: [%s]') % XEP_0115.cap_hash)
|
||||
self.presenceHack(profile)
|
||||
|
||||
services = client.discoHandler.info(client.jid, client.jid, '').addCallback(generateHash_2, profile)
|
||||
client.discoHandler.info(client.jid, client.jid, '').addCallback(generateHash_2, profile)
|
||||
|
||||
|
||||
class XEP_0115_handler(XMPPHandler):
|
||||
|
|
|
|||
Loading…
Reference in a new issue