From 2c3209ac64fd956cfe9a1b1eb8e54727e7c364ff Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 20 Jan 2013 19:56:18 +0100 Subject: [PATCH] add OOB url in message. Fixes #4325 --- src/common/connection_handlers_events.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py index fda5c7286..6d1144eef 100644 --- a/src/common/connection_handlers_events.py +++ b/src/common/connection_handlers_events.py @@ -1276,6 +1276,21 @@ class DecryptedMessageReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): self.user_nick = self.stanza.getTagData('nick') or '' self.get_chatstate() + + oob_node = self.stanza.getTag('x', namespace=nbxmpp.NS_X_OOB) + self.oob_url = None + self.oob_desc = None + if oob_node: + self.oob_url = oob_node.getTagData('url') + self.oob_desc = oob_node.getTagData('desc') + if self.oob_url: + self.msgtxt += '\n' + if self.oob_desc: + self.msgtxt += self.oob_desc + else: + self.msgtxt += _('URL:') + self.msgtxt += ' ' + self.oob_url + return True class ChatstateReceivedEvent(nec.NetworkIncomingEvent):