Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 8853:f84f566dea58
MUC: Reuse the same dataform for voice requests
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 20 Oct 2017 05:45:40 +0200 |
| parents | 5e98d62f3f9b |
| children | 538bb632a2b6 |
comparison
equal
deleted
inserted
replaced
| 8852:5e98d62f3f9b | 8853:f84f566dea58 |
|---|---|
| 778 return module:fire_event("muc-config-form", { room = self, actor = actor, form = form }) or form; | 778 return module:fire_event("muc-config-form", { room = self, actor = actor, form = form }) or form; |
| 779 end | 779 end |
| 780 | 780 |
| 781 function room_mt:get_voice_form_layout() -- luacheck: ignore 212/self | 781 function room_mt:get_voice_form_layout() -- luacheck: ignore 212/self |
| 782 local form = dataform.new({ | 782 local form = dataform.new({ |
| 783 title = "Voice Request"; | |
| 783 { | 784 { |
| 784 name = "FORM_TYPE"; | 785 name = "FORM_TYPE"; |
| 785 type = "hidden"; | 786 type = "hidden"; |
| 786 value = "http://jabber.org/protocol/muc#request"; | 787 value = "http://jabber.org/protocol/muc#request"; |
| 787 }, | 788 }, |
| 788 { | 789 { |
| 789 name = "muc#jid"; | 790 name = "muc#jid"; |
| 790 type = "jid-single"; | 791 type = "jid-single"; |
| 792 label = "User ID"; | |
| 791 }, | 793 }, |
| 792 { | 794 { |
| 793 name = "muc#roomnick"; | 795 name = "muc#roomnick"; |
| 794 type = "text-single"; | 796 type = "text-single"; |
| 797 label = "Room Nickname"; | |
| 795 }, | 798 }, |
| 796 { | 799 { |
| 797 name = "muc#role"; | 800 name = "muc#role"; |
| 798 type = "text-single"; | 801 type = "text-single"; |
| 802 label = "Requested Role"; | |
| 803 value = "participant"; | |
| 799 }, | 804 }, |
| 800 { | 805 { |
| 801 name = "muc#request_allow"; | 806 name = "muc#request_allow"; |
| 802 type = "boolean"; | 807 type = "boolean"; |
| 808 label = "Grant voice to this person?"; | |
| 809 value = false; | |
| 803 } | 810 } |
| 804 }); | 811 }); |
| 805 | 812 |
| 806 return form; | 813 return form; |
| 807 end | 814 end |
