From 96c2503f24a08ee9db45ae7c19b0e915be5d341d Mon Sep 17 00:00:00 2001 From: Morgan Collett Date: Wed, 30 Jul 2008 13:24:30 +0000 Subject: #7717: Log incoming messages --- diff --git a/NEWS b/NEWS index e6ac619..262c92e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +* #7717: Log incoming messages (morgs) * #7692: Don't show pending messages when joining a chat (morgs) * Updated translations: nl, te, es diff --git a/pippy_app.py b/pippy_app.py index 54f8947..7fd1ce3 100644 --- a/pippy_app.py +++ b/pippy_app.py @@ -100,7 +100,7 @@ class Chat(ViewSourceActivity): return bus_name, connection, channel = simplejson.loads(tp_channel) logger.debug('GOT XMPP: %s %s %s', bus_name, connection, - channel) # XXX + channel) conn = Connection( bus_name, connection, ready_handler=lambda conn: \ self._one_to_one_connection_ready_cb(bus_name, channel, conn)) @@ -142,6 +142,14 @@ class Chat(ViewSourceActivity): def _received_cb(self, buddy, text): """Show message that was received.""" + if buddy: + if type(buddy) is dict: + nick = buddy['nick'] + else: + nick = buddy.props.nick + else: + nick = '???' + logger.debug('Received message from %s: %s', nick, text) self.add_text(buddy, text) def _alert(self, title, text=None): @@ -665,6 +673,7 @@ CHAT_ICON=\ """ CHAT_NEWS=""" +* #7717: Log incoming messages (morgs) * #7692: Don't show pending messages when joining a chat (morgs) * Updated translations: nl, te, es -- cgit v0.9.1