From 3c97775573d672f185a3d5839ec82e5fb3debbc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Tue, 21 Mar 2023 15:30:36 +0100 Subject: [PATCH] Pubsub xdata fields max_item/item_expira/children_max use 'max' not 'infinity' Codec in xmpp crashes when we use infinity (see issue #4011), so lets convert those values before passing them to xmpp:encode(0 --- src/mod_pubsub.erl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index f9a909d44..b8f4c4905 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -3456,6 +3456,10 @@ get_configure_xfields(_Type, Options, Lang, Groups) -> {true, {roster_groups_allowed, Value, Groups}}; ({sql, _}) -> false; ({rsm, _}) -> false; + ({Item, infinity}) when Item == max_items; + Item == item_expire; + Item == children_max -> + {true, {Item, max}}; (_) -> true end, Options), Lang).