aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-10-20 23:47:48 +0200
committerKim Alvefur <zash@zash.se>2019-10-20 23:47:48 +0200
commit9ba9680078871914ecf096ed74d996c71ae67494 (patch)
tree93ba9f2e862be50e69f8e550efd4f60f34043b10 /plugins/muc
parent047261f9af0594fba81f8f5e3f22e2b58de6da40 (diff)
downloadprosody-9ba9680078871914ecf096ed74d996c71ae67494.tar.gz
prosody-9ba9680078871914ecf096ed74d996c71ae67494.zip
MUC: Advertise history related fields as integers via XEP-0122
This takes advantage of data type validation and conversion done in util.dataforms.
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/history.lib.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/muc/history.lib.lua b/plugins/muc/history.lib.lua
index 0d69c97d..f9ddabbf 100644
--- a/plugins/muc/history.lib.lua
+++ b/plugins/muc/history.lib.lua
@@ -48,16 +48,18 @@ module:hook("muc-config-form", function(event)
table.insert(event.form, {
name = "muc#roomconfig_historylength";
type = "text-single";
+ datatype = "xs:integer";
label = "Maximum number of history messages returned by room";
desc = "Specify the maximum number of previous messages that should be sent to users when they join the room";
- value = tostring(get_historylength(event.room));
+ value = get_historylength(event.room);
});
table.insert(event.form, {
name = 'muc#roomconfig_defaulthistorymessages',
type = 'text-single',
+ datatype = "xs:integer";
label = 'Default number of history messages returned by room',
desc = "Specify the number of previous messages sent to new users when they join the room";
- value = tostring(get_defaulthistorymessages(event.room))
+ value = get_defaulthistorymessages(event.room);
});
end, 70-5);