core: replaced calls to client.xmlstream.send by client.send which is the right method to use. client.xmlstream should not be used directly

This commit is contained in:
Goffi 2017-02-04 17:59:13 +01:00
commit 6467bdb3c3
14 changed files with 54 additions and 58 deletions

View file

@ -653,9 +653,7 @@ class RoomGame(object):
@param profile: the profile from which the message is sent
@return: a Deferred instance
"""
if profile is None:
log.error(_("Message can not be sent without a sender profile"))
return defer.fail(None)
client = self.host.getClient(profile)
msg = self._createGameElt(to_jid)
for elem, attrs, content in data:
if elem is not None:
@ -667,7 +665,7 @@ class RoomGame(object):
elem.attributes.update(attrs)
if content is not None:
elem.addContent(content)
self.host.profiles[profile].xmlstream.send(msg)
client.send(msg)
return defer.succeed(None)
def send(self, to_jid, elem=None, attrs=None, content=None, profile=None):