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:
Goffi 2014-03-28 18:07:02 +01:00
commit a6897c76e0

View file

@ -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):