Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Leboulanger <asterix@lagaule.org>2010-07-19 21:53:29 +0400
committerYann Leboulanger <asterix@lagaule.org>2010-07-19 21:53:29 +0400
commit796213c9cb1e4b1ac9a138f2b9ec8cfb71c0a63d (patch)
treec862a47f0f88435054171641d3f4adde003b3c40 /src/session.py
parent9b5ee1e13b3a3e9f31aeec48e62fa69271c35e1e (diff)
parent337b09d389950edd253457432ab4c3bde2fdf5a4 (diff)
merge with trunk
Diffstat (limited to 'src/session.py')
-rw-r--r--src/session.py31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/session.py b/src/session.py
index 4b3c530bb..9d0834ce6 100644
--- a/src/session.py
+++ b/src/session.py
@@ -1,8 +1,8 @@
# -*- coding:utf-8 -*-
## src/session.py
##
-## Copyright (C) 2008 Yann Leboulanger <asterix AT lagaule.org>
-## Brendan Taylor <whateley AT gmail.com>
+## Copyright (C) 2008-2010 Yann Leboulanger <asterix AT lagaule.org>
+## Copyright (C) 2008 Brendan Taylor <whateley AT gmail.com>
## Jonathan Schleifer <js-gajim AT webkeks.org>
## Stephan Erb <steve-e AT h3c.de>
##
@@ -95,6 +95,8 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
self.resource = resource
if self.control and self.control.resource:
self.control.change_resource(self.resource)
+ seclabel = None
+ displaymarking = None
if not msg_type or msg_type not in ('chat', 'groupchat', 'error'):
msg_type = 'normal'
@@ -113,7 +115,9 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
break
composing_xep, chatstate = self.get_chatstate(msg, msgtxt)
-
+ seclabel = msg.getTag('securitylabel')
+ if seclabel and seclabel.getNamespace() == common.xmpp.NS_SECLABEL:
+ displaymarking = seclabel.getTag('displaymarking')
xhtml = msg.getXHTML()
if msg_type == 'chat':
@@ -236,15 +240,15 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
if self.control:
# print if a control is open
self.control.print_conversation(msgtxt, tim=tim, xhtml=xhtml,
- encrypted=encrypted)
+ encrypted=encrypted, displaymarking=displaymarking)
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)
+ xhtml, self, msg_id=msg_id, encrypted=encrypted, displaymarking=displaymarking)
else:
self.roster_message(jid, msgtxt, tim, encrypted, msg_type,
subject, resource, msg_id, user_nick, advanced_notif_num,
- xhtml=xhtml, form_node=form_node)
+ xhtml=xhtml, form_node=form_node, displaymarking=displaymarking)
nickname = gajim.get_name_from_jid(self.conn.name, jid)
@@ -268,15 +272,14 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
[full_jid_with_resource, msgtxt, tim, encrypted, msg_type, subject,
chatstate, msg_id, composing_xep, user_nick, xhtml, form_node]))
- gajim.ged.raise_event('NewMessage',
- (self.conn.name, [full_jid_with_resource, msgtxt, tim,
- encrypted, msg_type, subject, chatstate, msg_id,
- composing_xep, user_nick, xhtml, form_node]))
-
+ gajim.ged.raise_event('NewMessage',
+ (self.conn.name, [full_jid_with_resource, msgtxt, tim,
+ encrypted, msg_type, subject, chatstate, msg_id,
+ composing_xep, user_nick, xhtml, form_node]))
def roster_message(self, jid, msg, tim, encrypted=False, msg_type='',
subject=None, resource='', msg_id=None, user_nick='',
- advanced_notif_num=None, xhtml=None, form_node=None):
+ advanced_notif_num=None, xhtml=None, form_node=None, displaymarking=None):
"""
Display the message or show notification in the roster
"""
@@ -351,7 +354,7 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
typ = 'error'
self.control.print_conversation(msg, typ, tim=tim, encrypted=encrypted,
- subject=subject, xhtml=xhtml)
+ subject=subject, xhtml=xhtml, displaymarking=displaymarking)
if msg_id:
gajim.logger.set_read_messages([msg_id])
@@ -372,7 +375,7 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
contact)
event = gajim.events.create_event(type_, (msg, subject, msg_type, tim,
- encrypted, resource, msg_id, xhtml, self, form_node),
+ encrypted, resource, msg_id, xhtml, self, form_node, displaymarking),
show_in_roster=show_in_roster, show_in_systray=show_in_systray)
gajim.events.add_event(self.conn.name, fjid, event)