Software / code / prosody
Comparison
plugins/mod_smacks.lua @ 12689:1bc2220cd6ec
mod_smacks: Use new :add_error() in last remaining error result construction
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 29 Aug 2022 15:48:07 +0100 |
| parent | 12688:36ba170c4fd0 |
| child | 12691:90d90b540b6b |
comparison
equal
deleted
inserted
replaced
| 12688:36ba170c4fd0 | 12689:1bc2220cd6ec |
|---|---|
| 55 local watchdog = require "util.watchdog"; | 55 local watchdog = require "util.watchdog"; |
| 56 local it = require"util.iterators"; | 56 local it = require"util.iterators"; |
| 57 | 57 |
| 58 local sessionmanager = require "core.sessionmanager"; | 58 local sessionmanager = require "core.sessionmanager"; |
| 59 | 59 |
| 60 local xmlns_errors = "urn:ietf:params:xml:ns:xmpp-stanzas"; | |
| 61 local xmlns_delay = "urn:xmpp:delay"; | 60 local xmlns_delay = "urn:xmpp:delay"; |
| 62 local xmlns_mam2 = "urn:xmpp:mam:2"; | 61 local xmlns_mam2 = "urn:xmpp:mam:2"; |
| 63 local xmlns_sm2 = "urn:xmpp:sm:2"; | 62 local xmlns_sm2 = "urn:xmpp:sm:2"; |
| 64 local xmlns_sm3 = "urn:xmpp:sm:3"; | 63 local xmlns_sm3 = "urn:xmpp:sm:3"; |
| 65 | 64 |
| 645 | 644 |
| 646 function handle_resume(session, stanza, xmlns_sm) | 645 function handle_resume(session, stanza, xmlns_sm) |
| 647 local resumed, err = do_resume(session, stanza); | 646 local resumed, err = do_resume(session, stanza); |
| 648 if not resumed then | 647 if not resumed then |
| 649 session.send(st.stanza("failed", { xmlns = xmlns_sm, h = format_h(err.context.h) }) | 648 session.send(st.stanza("failed", { xmlns = xmlns_sm, h = format_h(err.context.h) }) |
| 650 :tag(err.condition, { xmlns = xmlns_errors })); | 649 :add_error(err)); |
| 651 return true; | 650 return true; |
| 652 end | 651 end |
| 653 | 652 |
| 654 session = resumed.session; | 653 session = resumed.session; |
| 655 | 654 |