Mercurial > prosody-hg
comparison plugins/muc/members_only.lib.lua @ 6991:84e01dbb739e
MUC: Update all config form handlers to take advantage of the new per-option events
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 11 Dec 2015 15:33:58 +0000 |
| parents | 29f979f554d3 |
| children | 6cc7c9da29ed |
comparison
equal
deleted
inserted
replaced
| 6990:f476e2497568 | 6991:84e01dbb739e |
|---|---|
| 59 label = "Make Room Members-Only?"; | 59 label = "Make Room Members-Only?"; |
| 60 value = get_members_only(event.room); | 60 value = get_members_only(event.room); |
| 61 }); | 61 }); |
| 62 end); | 62 end); |
| 63 | 63 |
| 64 module:hook("muc-config-submitted", function(event) | 64 module:hook("muc-config-submitted/muc#roomconfig_membersonly", function(event) |
| 65 local new = event.fields["muc#roomconfig_membersonly"]; | 65 if set_members_only(event.room, event.value) then |
| 66 if new ~= nil and set_members_only(event.room, new) then | |
| 67 event.status_codes["104"] = true; | 66 event.status_codes["104"] = true; |
| 68 end | 67 end |
| 69 end); | 68 end); |
| 70 | 69 |
| 71 -- No affiliation => role of "none" | 70 -- No affiliation => role of "none" |
