Software /
code /
prosody
Comparison
plugins/mod_pep.lua @ 8966:9106e9286203
mod_pep: Rename variables to avoid name clash [luacheck]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 06 Jul 2018 00:04:26 +0200 |
parent | 8965:1cc5ea1df5ba |
child | 8967:c809f334363c |
comparison
equal
deleted
inserted
replaced
8965:1cc5ea1df5ba | 8966:9106e9286203 |
---|---|
205 end | 205 end |
206 end | 206 end |
207 if node and user_data and user_data[node] then -- Send the last item | 207 if node and user_data and user_data[node] then -- Send the last item |
208 local id, item = unpack(user_data[node]); | 208 local id, item = unpack(user_data[node]); |
209 if not requested_id or id == requested_id then | 209 if not requested_id or id == requested_id then |
210 local stanza = st.reply(stanza) | 210 local reply_stanza = st.reply(stanza) |
211 :tag('pubsub', {xmlns='http://jabber.org/protocol/pubsub'}) | 211 :tag('pubsub', {xmlns='http://jabber.org/protocol/pubsub'}) |
212 :tag('items', {node=node}) | 212 :tag('items', {node=node}) |
213 :add_child(item) | 213 :add_child(item) |
214 :up() | 214 :up() |
215 :up(); | 215 :up(); |
216 session.send(stanza); | 216 session.send(reply_stanza); |
217 return true; | 217 return true; |
218 else -- requested item doesn't exist | 218 else -- requested item doesn't exist |
219 local stanza = st.reply(stanza) | 219 local reply_stanza = st.reply(stanza) |
220 :tag('pubsub', {xmlns='http://jabber.org/protocol/pubsub'}) | 220 :tag('pubsub', {xmlns='http://jabber.org/protocol/pubsub'}) |
221 :tag('items', {node=node}) | 221 :tag('items', {node=node}) |
222 :up(); | 222 :up(); |
223 session.send(stanza); | 223 session.send(reply_stanza); |
224 return true; | 224 return true; |
225 end | 225 end |
226 elseif node then -- node doesn't exist | 226 elseif node then -- node doesn't exist |
227 session.send(st.error_reply(stanza, 'cancel', 'item-not-found')); | 227 session.send(st.error_reply(stanza, 'cancel', 'item-not-found')); |
228 module:log("debug", "Item '%s' not found", node) | 228 module:log("debug", "Item '%s' not found", node) |