Software /
code /
prosody
Comparison
plugins/mod_pep.lua @ 5683:624b874059bf
Merge 0.9->trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 13 Jun 2013 13:56:58 +0100 |
parent | 5627:0439d1349dc1 |
parent | 5682:e7b9ba2d0638 |
child | 5776:bd0ff8ae98a8 |
comparison
equal
deleted
inserted
replaced
5681:43cc1f95395e | 5683:624b874059bf |
---|---|
60 user_data[node] = nil; | 60 user_data[node] = nil; |
61 if not next(user_data) then data[bare] = nil; end | 61 if not next(user_data) then data[bare] = nil; end |
62 end | 62 end |
63 else | 63 else |
64 if not user_data then user_data = {}; data[bare] = user_data; end | 64 if not user_data then user_data = {}; data[bare] = user_data; end |
65 user_data[node] = {id or "1", item}; | 65 user_data[node] = {id, item}; |
66 end | 66 end |
67 | 67 |
68 -- broadcast | 68 -- broadcast |
69 for recipient, notify in pairs(recipients[bare] or NULL) do | 69 for recipient, notify in pairs(recipients[bare] or NULL) do |
70 if notify[node] then | 70 if notify[node] then |
167 payload = payload.tags[1]; | 167 payload = payload.tags[1]; |
168 if payload and (payload.name == 'publish' or payload.name == 'retract') and payload.attr.node then -- <publish node='http://jabber.org/protocol/tune'> | 168 if payload and (payload.name == 'publish' or payload.name == 'retract') and payload.attr.node then -- <publish node='http://jabber.org/protocol/tune'> |
169 local node = payload.attr.node; | 169 local node = payload.attr.node; |
170 payload = payload.tags[1]; | 170 payload = payload.tags[1]; |
171 if payload and payload.name == "item" then -- <item> | 171 if payload and payload.name == "item" then -- <item> |
172 local id = payload.attr.id; | 172 local id = payload.attr.id or "1"; |
173 payload.attr.id = id; | |
173 session.send(st.reply(stanza)); | 174 session.send(st.reply(stanza)); |
174 publish(session, node, id, st.clone(payload)); | 175 publish(session, node, id, st.clone(payload)); |
175 return true; | 176 return true; |
176 end | 177 end |
177 end | 178 end |