summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sunshine/channel/text.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/sunshine/channel/text.py b/sunshine/channel/text.py
index 03ccc9e..05e8470 100644
--- a/sunshine/channel/text.py
+++ b/sunshine/channel/text.py
@@ -40,15 +40,14 @@ class SunshineTextChannel(telepathy.server.ChannelTypeText):
self._conn_ref = weakref.ref(conn)
self.conn = conn
- self.contact = handle.contact
-
+ self.handle = handle
telepathy.server.ChannelTypeText.__init__(self, conn, manager, props)
def Send(self, message_type, text):
if message_type == telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL:
- logger.info("Sending message : %s" % unicode(text))
+ logger.info("Sending message to %s, id %s, body: '%s'" % (str(self.handle.name), str(self.handle.id), unicode(text)))
msg = text.encode('windows-1250')
- self.conn.gadu_client.sendTo(int(self.contact.uin), str(text), str(msg))
+ self.conn.gadu_client.sendTo(int(self.handle.name), str(text), str(msg))
else:
raise telepathy.NotImplemented("Unhandled message type")
self.Sent(int(time.time()), message_type, text)