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

@ -259,8 +259,6 @@ class XEP_0054(object):
#TODO: This is a temporary way of setting avatar, as other VCard informations are not managed.
# A proper full VCard management should be done (and more generaly a public/private profile)
client = self.host.getClient(profile_key)
if not client:
raise exceptions.NotConnectedProfileError(_('Trying to set avatar for a non-existant or not connected profile'))
vcard_set = IQ(client.xmlstream, 'set')
d = threads.deferToThread(self._buildSetAvatar, vcard_set, filepath)