Mercurial > prosody-hg
comparison util/stanza.lua @ 8382:e5d00bf4a4d5
util: Various minor changes to please [luacheck]
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 10 Nov 2017 05:42:32 +0100 |
| parents | 2b305ec8c146 |
| children | e959bc51de75 |
comparison
equal
deleted
inserted
replaced
| 8381:7f6184474149 | 8382:e5d00bf4a4d5 |
|---|---|
| 365 if attr and not attr.id then attr.id = new_id(); end | 365 if attr and not attr.id then attr.id = new_id(); end |
| 366 return new_stanza("iq", attr or { id = new_id() }); | 366 return new_stanza("iq", attr or { id = new_id() }); |
| 367 end | 367 end |
| 368 | 368 |
| 369 local function reply(orig) | 369 local function reply(orig) |
| 370 return new_stanza(orig.name, orig.attr and { to = orig.attr.from, from = orig.attr.to, id = orig.attr.id, type = ((orig.name == "iq" and "result") or orig.attr.type) }); | 370 return new_stanza(orig.name, |
| 371 orig.attr and { | |
| 372 to = orig.attr.from, | |
| 373 from = orig.attr.to, | |
| 374 id = orig.attr.id, | |
| 375 type = ((orig.name == "iq" and "result") or orig.attr.type) | |
| 376 }); | |
| 371 end | 377 end |
| 372 | 378 |
| 373 local xmpp_stanzas_attr = { xmlns = xmlns_stanzas }; | 379 local xmpp_stanzas_attr = { xmlns = xmlns_stanzas }; |
| 374 local function error_reply(orig, error_type, condition, error_message) | 380 local function error_reply(orig, error_type, condition, error_message) |
| 375 local t = reply(orig); | 381 local t = reply(orig); |
