# HG changeset patch # User souliane # Date 1421355293 -3600 # Node ID 2eaa98f7b84c019152d1ddea2ffdaa43393c6813 # Parent d9939b4765261e997f565ce4b9d2ec01e782c7de plugin XEP-0313: handle forwarded pubsub event diff -r d9939b476526 -r 2eaa98f7b84c src/plugins/plugin_xep_0313.py --- a/src/plugins/plugin_xep_0313.py Thu Jan 15 21:02:41 2015 +0100 +++ b/src/plugins/plugin_xep_0313.py Thu Jan 15 21:54:53 2015 +0100 @@ -34,6 +34,7 @@ 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 @@ 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