# HG changeset patch # User Matthew Wild # Date 1530109535 -3600 # Node ID ecb5e13d97bb094212d69db7290bb0aa54ba51a1 # Parent f0beba9c28220c7a5325212781836129c3219d93 MUC: Remove 'affiliation notify' config option, as it's irrelevant to room owners, always notify instead diff -r f0beba9c2822 -r ecb5e13d97bb plugins/muc/affiliation_notify.lib.lua --- a/plugins/muc/affiliation_notify.lib.lua Tue Jun 26 20:33:10 2018 +0200 +++ b/plugins/muc/affiliation_notify.lib.lua Wed Jun 27 15:25:35 2018 +0100 @@ -16,35 +16,9 @@ local st = require "util.stanza"; -local function get_affiliation_notify(room) - return room._data.affiliation_notify; -end - -local function set_affiliation_notify(room, affiliation_notify) - affiliation_notify = affiliation_notify and true or nil; - if room._data.affiliation_notify == affiliation_notify then return false; end - room._data.affiliation_notify = affiliation_notify; - return true; -end - -module:hook("muc-config-form", function(event) - table.insert(event.form, { - name = "muc#roomconfig_affiliationnotify"; - type = "boolean"; - label = "Notify absent users when their affiliation changes?"; - value = get_affiliation_notify(event.room); - }); -end, 100-11); - -module:hook("muc-config-submitted/muc#roomconfig_affiliationnotify", function(event) - if set_affiliation_notify(event.room, event.value) then - event.status_codes["104"] = true; - end -end); - module:hook("muc-set-affiliation", function(event) local room = event.room; - if not event.in_room and get_affiliation_notify(room) then + if not event.in_room then local body = string.format("Your affiliation in room %s is now %s.", room.jid, event.affiliation); local stanza = st.message({ type = "headline"; @@ -57,8 +31,3 @@ room:route_stanza(stanza); end end); - -return { - get = get_affiliation_notify; - set = set_affiliation_notify; -};