Mercurial > prosody-hg
comparison plugins/mod_pep.lua @ 2041:8cf9b978ab36
PEP: Fixed namespace for the <item> element in PEP broadcasts.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Thu, 22 Oct 2009 02:12:24 +0500 |
| parents | 2afc87ccc379 |
| children | 34e6e06dd089 |
comparison
equal
deleted
inserted
replaced
| 2040:ca85461afa6c | 2041:8cf9b978ab36 |
|---|---|
| 27 | 27 |
| 28 module:add_identity("pubsub", "pep", "Prosody"); | 28 module:add_identity("pubsub", "pep", "Prosody"); |
| 29 module:add_feature("http://jabber.org/protocol/pubsub#publish"); | 29 module:add_feature("http://jabber.org/protocol/pubsub#publish"); |
| 30 | 30 |
| 31 local function publish(session, node, item) | 31 local function publish(session, node, item) |
| 32 item.attr.xmlns = nil; | |
| 32 local disable = #item.tags ~= 1 or #item.tags[1].tags == 0; | 33 local disable = #item.tags ~= 1 or #item.tags[1].tags == 0; |
| 33 if #item.tags == 0 then item.name = "retract"; end | 34 if #item.tags == 0 then item.name = "retract"; end |
| 34 local bare = session.username..'@'..session.host; | 35 local bare = session.username..'@'..session.host; |
| 35 local stanza = st.message({from=bare, type='headline'}) | 36 local stanza = st.message({from=bare, type='headline'}) |
| 36 :tag('event', {xmlns='http://jabber.org/protocol/pubsub#event'}) | 37 :tag('event', {xmlns='http://jabber.org/protocol/pubsub#event'}) |
