37 module:add_identity("pubsub", "pep", "Prosody"); |
37 module:add_identity("pubsub", "pep", "Prosody"); |
38 module:add_feature("http://jabber.org/protocol/pubsub#publish"); |
38 module:add_feature("http://jabber.org/protocol/pubsub#publish"); |
39 |
39 |
40 local function publish(session, node, item) |
40 local function publish(session, node, item) |
41 item.attr.xmlns = nil; |
41 item.attr.xmlns = nil; |
42 local disable = #item.tags ~= 1 or #item.tags[1].tags == 0; |
42 local disable = #item.tags ~= 1 or #item.tags[1] == 0; |
43 if #item.tags == 0 then item.name = "retract"; end |
43 if #item.tags == 0 then item.name = "retract"; end |
44 local bare = session.username..'@'..session.host; |
44 local bare = session.username..'@'..session.host; |
45 local stanza = st.message({from=bare, type='headline'}) |
45 local stanza = st.message({from=bare, type='headline'}) |
46 :tag('event', {xmlns='http://jabber.org/protocol/pubsub#event'}) |
46 :tag('event', {xmlns='http://jabber.org/protocol/pubsub#event'}) |
47 :tag('items', {node=node}) |
47 :tag('items', {node=node}) |