aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-06-27 15:25:35 +0100
committerMatthew Wild <mwild1@gmail.com>2018-06-27 15:25:35 +0100
commitda880932738f33f6d105163829afc7460a97550f (patch)
tree2577e4333aac72836280b2147d24d2b0296d463c /plugins
parent2629409a3b3e6bcbc7c219c74ec9e9d098720d06 (diff)
downloadprosody-da880932738f33f6d105163829afc7460a97550f.tar.gz
prosody-da880932738f33f6d105163829afc7460a97550f.zip
MUC: Remove 'affiliation notify' config option, as it's irrelevant to room owners, always notify instead
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/affiliation_notify.lib.lua33
1 files changed, 1 insertions, 32 deletions
diff --git a/plugins/muc/affiliation_notify.lib.lua b/plugins/muc/affiliation_notify.lib.lua
index 4343f3db..c361a974 100644
--- a/plugins/muc/affiliation_notify.lib.lua
+++ b/plugins/muc/affiliation_notify.lib.lua
@@ -16,35 +16,9 @@ and MUST contain a status code of 101.
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 @@ module:hook("muc-set-affiliation", function(event)
room:route_stanza(stanza);
end
end);
-
-return {
- get = get_affiliation_notify;
- set = set_affiliation_notify;
-};