Mercurial > prosody-hg
comparison plugins/mod_pubsub/pubsub.lib.lua @ 8939:849c4683eaa0
mod_pubsub: Handle :set_affiliation errors (not completely in line with the XEP)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 26 Jun 2018 20:27:41 +0200 |
| parents | 384ef9732b81 |
| children | 365b16109d95 |
comparison
equal
deleted
inserted
replaced
| 8938:384ef9732b81 | 8939:849c4683eaa0 |
|---|---|
| 505 local affiliation = affiliation_tag.attr.affiliation; | 505 local affiliation = affiliation_tag.attr.affiliation; |
| 506 | 506 |
| 507 if affiliation == "none" then affiliation = nil; end | 507 if affiliation == "none" then affiliation = nil; end |
| 508 | 508 |
| 509 local ok, err = service:set_affiliation(node, stanza.attr.from, jid, affiliation); | 509 local ok, err = service:set_affiliation(node, stanza.attr.from, jid, affiliation); |
| 510 if not ok then | |
| 511 -- FIXME Incomplete error handling, | |
| 512 -- see XEP 60 8.9.2.4 Multiple Simultaneous Modifications | |
| 513 origin.send(pubsub_error_reply(stanza, err)); | |
| 514 return true; | |
| 515 end | |
| 510 end | 516 end |
| 511 | 517 |
| 512 local reply = st.reply(stanza); | 518 local reply = st.reply(stanza); |
| 513 origin.send(reply); | 519 origin.send(reply); |
| 514 return true; | 520 return true; |
