X-Git-Url: http://git.maemo.org/git/?p=theonering;a=blobdiff_plain;f=src%2Fchannel%2Ftext.py;h=380fcf365ea2341c286427943b47bfca01e28667;hp=c66d838caa06efeb05b048e3ab87ae897726ad0c;hb=613ba869ba587b74ec66c0dfd0e30978ddd11cf7;hpb=68d86d0de3ad50d14510880a8c1767de768dff7c diff --git a/src/channel/text.py b/src/channel/text.py index c66d838..380fcf3 100644 --- a/src/channel/text.py +++ b/src/channel/text.py @@ -14,8 +14,7 @@ class TextChannel(telepathy.server.ChannelTypeText): Look into implementing ChannelInterfaceMessages for rich text formatting """ - def __init__(self, connection): - h = None + def __init__(self, connection, h): telepathy.server.ChannelTypeText.__init__(self, connection, h) self._nextRecievedId = 0 @@ -34,14 +33,14 @@ class TextChannel(telepathy.server.ChannelTypeText): telepathy.server.ChannelTypeText.Close(self) self.remove_from_connection() - def _on_message_received(self, sender, message): + def _on_message_received(self, contactId, contactNumber, message): """ @todo Attatch this to receiving a message """ currentReceivedId = self._nextRecievedId timestamp = int(time.time()) - h = handle.create_handle(self._conn, "contact", sender.account) + h = handle.create_handle(self._conn, "contact", contactId, contactNumber) type = telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL message = message.content