diff src/plugins/plugin_misc_room_game.py @ 2129:6a66c8c5a567

core: replaced calls to client.xmlstream.send by client.send which is the right method to use. client.xmlstream should not be used directly
author Goffi <goffi@goffi.org>
date Sat, 04 Feb 2017 17:59:13 +0100
parents 200cd707a46d
children 1d3f73e065e1
line wrap: on
line diff
--- a/src/plugins/plugin_misc_room_game.py	Wed Feb 01 21:44:24 2017 +0100
+++ b/src/plugins/plugin_misc_room_game.py	Sat Feb 04 17:59:13 2017 +0100
@@ -653,9 +653,7 @@
         @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 @@
                     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):