summaryrefslogtreecommitdiff
path: root/sunshine/channel
diff options
context:
space:
mode:
authorKrzysztof Klinikowski <kkszysiu@gmail.com>2010-01-24 18:28:45 +0100
committerKrzysztof Klinikowski <kkszysiu@gmail.com>2010-01-24 18:28:45 +0100
commitfa78eb96e67b271faa02fee700797b2f91429ce2 (patch)
treea3d3536d18f14c021b62a051b25afd58dae4c273 /sunshine/channel
parentabb9c98ae71d4cd569f12aead48a992abc0e3be1 (diff)
Text channel even for user that you have not in your contacts implemented.
Diffstat (limited to 'sunshine/channel')
-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)