Author: bct
Date: 2008-07-15 01:46:22 +0200 (Tue, 15 Jul 2008)
New Revision: 9931
Modified:
trunk/src/common/events.py
trunk/src/groupchat_control.py
trunk/src/session.py
Log:
fix encrypted/unencrypted notifications in PM
Modified: trunk/src/common/events.py
===================================================================
--- trunk/src/common/events.py 2008-07-14 23:21:08 UTC (rev 9930)
+++ trunk/src/common/events.py 2008-07-14 23:46:22 UTC (rev 9931)
@@ -36,7 +36,7 @@
file-request-error, file-send-error, file-stopped, gc_msg, pm,
printed_chat, printed_gc_msg, printed_marked_gc_msg, printed_pm
parameters is (per type_):
- chat, normal: [message, subject, kind, time, encrypted, resource,
+ chat, normal, pm: [message, subject, kind, time, encrypted, resource,
msg_id]
where kind in error, incoming
file-*: file_props
Modified: trunk/src/groupchat_control.py
===================================================================
--- trunk/src/groupchat_control.py 2008-07-14 23:21:08 UTC (rev 9930)
+++ trunk/src/groupchat_control.py 2008-07-14 23:46:22 UTC (rev 9931)
@@ -645,18 +645,14 @@
else:
self.print_conversation(msg, nick, tim, xhtml)
- def on_private_message(self, nick, msg, tim, xhtml, session, msg_id = None):
+ def on_private_message(self, nick, msg, tim, xhtml, session,
+ msg_id = None, encrypted = False):
# Do we have a queue?
fjid = self.room_jid + '/' + nick
no_queue = len(gajim.events.get_events(self.account, fjid)) == 0
- # We print if window is opened
- if session.control:
- session.control.print_conversation(msg, tim = tim, xhtml = xhtml)
- return
-
event = gajim.events.create_event('pm', (msg, '', 'incoming', tim,
- False, '', msg_id, xhtml, session))
+ encrypted, '', msg_id, xhtml, session))
gajim.events.add_event(self.account, fjid, event)
autopopup = gajim.config.get('autopopup')
Modified: trunk/src/session.py
===================================================================
--- trunk/src/session.py 2008-07-14 23:21:08 UTC (rev 9930)
+++ trunk/src/session.py 2008-07-14 23:46:22 UTC (rev 9931)
@@ -188,8 +188,14 @@
if pm:
nickname = resource
- groupchat_control.on_private_message(nickname, msgtxt, tim,
- xhtml, self, msg_id)
+ if self.control:
+ # print if a control is open
+ self.control.print_conversation(msgtxt,
+ tim = tim, xhtml = xhtml, encrypted = encrypted)
+ else:
+ # otherwise pass it off to the control to be queued
+ groupchat_control.on_private_message(nickname, msgtxt, tim,
+ xhtml, self, msg_id=msg_id, encrypted=encrypted)
else:
self.roster_message(jid, msgtxt, tim, encrypted, msg_type,
subject, resource, msg_id, user_nick, advanced_notif_num,