Software /
code /
prosody
Annotate
plugins/muc/request.lib.lua @ 9032:029e1e18d65c
mod_pubsub: Add support for owner subscription retrieval
https://xmpp.org/extensions/xep-0060.html#owner-subscriptions-retrieve
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 13 Jul 2018 04:42:19 +0200 |
parent | 8871:b67a861e883e |
child | 9034:1c709e3d2e5e |
rev | line source |
---|---|
6226
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
1 -- Prosody IM |
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
2 -- Copyright (C) 2008-2010 Matthew Wild |
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
3 -- Copyright (C) 2008-2010 Waqas Hussain |
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
4 -- Copyright (C) 2014 Daurnimator |
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
5 -- |
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
6 -- This project is MIT/X11 licensed. Please see the |
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
7 -- COPYING file in the source package for more information. |
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
8 -- |
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
9 |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
10 local st = require "util.stanza"; |
8854
5cd7813d4e94
MUC: Split out the nickname from the full room JID in voice request from
Kim Alvefur <zash@zash.se>
parents:
8853
diff
changeset
|
11 local jid_resource = require "util.jid".resource; |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
12 |
8871
b67a861e883e
MUC: Advertise support for voice requests
Kim Alvefur <zash@zash.se>
parents:
8865
diff
changeset
|
13 module:hook("muc-disco#info", function(event) |
b67a861e883e
MUC: Advertise support for voice requests
Kim Alvefur <zash@zash.se>
parents:
8865
diff
changeset
|
14 event.reply:tag("feature", {var = "http://jabber.org/protocol/muc#request"}):up(); |
b67a861e883e
MUC: Advertise support for voice requests
Kim Alvefur <zash@zash.se>
parents:
8865
diff
changeset
|
15 end); |
b67a861e883e
MUC: Advertise support for voice requests
Kim Alvefur <zash@zash.se>
parents:
8865
diff
changeset
|
16 |
8865
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
17 local voice_request_form = require "util.dataforms".new({ |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
18 title = "Voice Request"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
19 { |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
20 name = "FORM_TYPE"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
21 type = "hidden"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
22 value = "http://jabber.org/protocol/muc#request"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
23 }, |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
24 { |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
25 name = "muc#jid"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
26 type = "jid-single"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
27 label = "User ID"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
28 }, |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
29 { |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
30 name = "muc#roomnick"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
31 type = "text-single"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
32 label = "Room Nickname"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
33 }, |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
34 { |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
35 name = "muc#role"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
36 type = "list-single"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
37 label = "Requested Role"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
38 value = "participant"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
39 options = { |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
40 "none", |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
41 "visitor", |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
42 "participant", |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
43 "moderator", |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
44 }; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
45 }, |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
46 { |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
47 name = "muc#request_allow"; |
6226
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
48 type = "boolean"; |
8865
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
49 label = "Grant voice to this person?"; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
50 value = false; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
51 } |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
52 }); |
6226
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
53 |
8865
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
54 local function handle_request(room, origin, stanza, form) |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
55 local occupant = room:get_occupant_by_real_jid(stanza.attr.from); |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
56 local fields = voice_request_form:data(form); |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
57 local event = { |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
58 room = room; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
59 origin = origin; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
60 stanza = stanza; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
61 fields = fields; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
62 occupant = occupant; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
63 }; |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
64 if occupant.role == "moderator" then |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
65 module:log("debug", "%s responded to a voice request in %s", jid_resource(occupant.nick), room.jid); |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
66 module:fire_event("muc-voice-response", event); |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
67 else |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
68 module:log("debug", "%s requested voice in %s", jid_resource(occupant.nick), room.jid); |
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
69 module:fire_event("muc-voice-request", event); |
6226
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
70 end |
8865
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
71 end |
6226
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
72 |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
73 module:hook("muc-voice-request", function(event) |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
74 if event.occupant.role == "visitor" then |
8854
5cd7813d4e94
MUC: Split out the nickname from the full room JID in voice request from
Kim Alvefur <zash@zash.se>
parents:
8853
diff
changeset
|
75 local nick = jid_resource(event.occupant.nick); |
8853
f84f566dea58
MUC: Reuse the same dataform for voice requests
Kim Alvefur <zash@zash.se>
parents:
8852
diff
changeset
|
76 local formdata = { |
f84f566dea58
MUC: Reuse the same dataform for voice requests
Kim Alvefur <zash@zash.se>
parents:
8852
diff
changeset
|
77 ["muc#jid"] = event.stanza.attr.from; |
8854
5cd7813d4e94
MUC: Split out the nickname from the full room JID in voice request from
Kim Alvefur <zash@zash.se>
parents:
8853
diff
changeset
|
78 ["muc#roomnick"] = nick; |
8853
f84f566dea58
MUC: Reuse the same dataform for voice requests
Kim Alvefur <zash@zash.se>
parents:
8852
diff
changeset
|
79 }; |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
80 |
8865
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
81 local message = st.message({ type = "normal"; from = event.room.jid }):add_child(voice_request_form:form(formdata)):up(); |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
82 |
8852
5e98d62f3f9b
MUC: Ignore unused argumens [luacheck]
Kim Alvefur <zash@zash.se>
parents:
8851
diff
changeset
|
83 event.room:broadcast(message, function (_, occupant) |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
84 return occupant.role == "moderator"; |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
85 end); |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
86 end |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
87 end); |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
88 |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
89 module:hook("muc-voice-response", function(event) |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
90 local actor = event.stanza.attr.from; |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
91 local affected_occupant = event.room:get_occupant_by_real_jid(event.fields["muc#jid"]); |
8857
f4cc818db995
MUC: Get acting occupant into a local variable for easier access
Kim Alvefur <zash@zash.se>
parents:
8854
diff
changeset
|
92 local occupant = event.occupant; |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
93 |
8857
f4cc818db995
MUC: Get acting occupant into a local variable for easier access
Kim Alvefur <zash@zash.se>
parents:
8854
diff
changeset
|
94 if occupant.role ~= "moderator" then |
8859
11176f47a03a
MUC: Add some debug logging for voice requests
Kim Alvefur <zash@zash.se>
parents:
8858
diff
changeset
|
95 module:log("debug", "%s tried to grant voice but wasn't a moderator", jid_resource(occupant.nick)); |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
96 return; |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
97 end |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
98 |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
99 if not event.fields["muc#request_allow"] then |
8859
11176f47a03a
MUC: Add some debug logging for voice requests
Kim Alvefur <zash@zash.se>
parents:
8858
diff
changeset
|
100 module:log("debug", "%s did not grant voice", jid_resource(occupant.nick)); |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
101 return; |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
102 end |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
103 |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
104 if not affected_occupant then |
8859
11176f47a03a
MUC: Add some debug logging for voice requests
Kim Alvefur <zash@zash.se>
parents:
8858
diff
changeset
|
105 module:log("debug", "%s tried to grant voice to unknown occupant %s", jid_resource(occupant.nick), event.fields["muc#jid"]); |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
106 return; |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
107 end |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
108 |
8858
2096742859c1
MUC: Invert final conditional to be consistent with the other if statements
Kim Alvefur <zash@zash.se>
parents:
8857
diff
changeset
|
109 if affected_occupant.role ~= "visitor" then |
8859
11176f47a03a
MUC: Add some debug logging for voice requests
Kim Alvefur <zash@zash.se>
parents:
8858
diff
changeset
|
110 module:log("debug", "%s tried to grant voice to %s but they already have it", jid_resource(occupant.nick), jid_resource(occupant.jid)); |
8858
2096742859c1
MUC: Invert final conditional to be consistent with the other if statements
Kim Alvefur <zash@zash.se>
parents:
8857
diff
changeset
|
111 return; |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
112 end |
8858
2096742859c1
MUC: Invert final conditional to be consistent with the other if statements
Kim Alvefur <zash@zash.se>
parents:
8857
diff
changeset
|
113 |
8860
0bb46a1bb398
MUC: Handle and return error in role change when granting voice
Kim Alvefur <zash@zash.se>
parents:
8859
diff
changeset
|
114 module:log("debug", "%s granted voice to %s", jid_resource(event.occupant.nick), jid_resource(occupant.jid)); |
0bb46a1bb398
MUC: Handle and return error in role change when granting voice
Kim Alvefur <zash@zash.se>
parents:
8859
diff
changeset
|
115 local ok, errtype, err = event.room:set_role(actor, affected_occupant.nick, "participant", "Voice granted"); |
0bb46a1bb398
MUC: Handle and return error in role change when granting voice
Kim Alvefur <zash@zash.se>
parents:
8859
diff
changeset
|
116 |
0bb46a1bb398
MUC: Handle and return error in role change when granting voice
Kim Alvefur <zash@zash.se>
parents:
8859
diff
changeset
|
117 if not ok then |
0bb46a1bb398
MUC: Handle and return error in role change when granting voice
Kim Alvefur <zash@zash.se>
parents:
8859
diff
changeset
|
118 module:log("debug", "Error granting voice: %s", err or errtype); |
0bb46a1bb398
MUC: Handle and return error in role change when granting voice
Kim Alvefur <zash@zash.se>
parents:
8859
diff
changeset
|
119 event.origin.send(st.error_reply(event.stanza, errtype, err)); |
0bb46a1bb398
MUC: Handle and return error in role change when granting voice
Kim Alvefur <zash@zash.se>
parents:
8859
diff
changeset
|
120 end |
8851
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
121 end); |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
122 |
ab5f678f1376
MUC: Support MUC voice requests and approvals in moderated rooms (closes #655) (thanks to Lance Stout)
Kim Alvefur <zash@zash.se>
parents:
7401
diff
changeset
|
123 |
6226
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
124 return { |
8865
2a8bbfcb6868
MUC: Move voice request into its own lib
Kim Alvefur <zash@zash.se>
parents:
8860
diff
changeset
|
125 handle_request = handle_request; |
6226
7582deb85812
plugins/muc: Move 'moderated' code to seperate file; changes default "muc-get-default-role" behaviour
daurnimator <quae@daurnimator.com>
parents:
diff
changeset
|
126 }; |