From b080904b38416c579574b228c12d7ee7adca6531 Mon Sep 17 00:00:00 2001 From: souliane Date: Thu, 15 Jan 2015 21:54:53 +0100 Subject: [PATCH] plugin XEP-0313: handle forwarded pubsub event --- src/plugins/plugin_xep_0313.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/plugin_xep_0313.py b/src/plugins/plugin_xep_0313.py index bbc79e9c..86ac6801 100644 --- a/src/plugins/plugin_xep_0313.py +++ b/src/plugins/plugin_xep_0313.py @@ -34,6 +34,7 @@ from zope.interface import implements from wokkel import disco, data_form from wokkel.generic import parseXml +from wokkel.pubsub import NS_PUBSUB_EVENT, ItemsEvent # TODO: change this when RSM and MAM are in wokkel from sat.tmp.wokkel.rsm import RSMRequest @@ -215,6 +216,16 @@ class XEP_0313(object): log.error(_(" element misses a mandatory child!")) return False log.debug(_("MAM found a forwarded message")) + + if msg.event and msg.event.uri == NS_PUBSUB_EVENT: + event = ItemsEvent(jid.JID(message['from']), + jid.JID(message['to']), + msg.event.items['node'], + msg.event.items.elements(), + {}) + self.host.plugins["XEP-0060"].clients[profile].itemsReceived(event) + return False + client = self.host.getClient(profile) client.messageProt.onMessage(msg) return False