From 7c76f2b764723f92b2ffb596f8b5d65311162f62 Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 4 Apr 2024 13:32:32 +0200 Subject: [PATCH] Handle the "approved" attribute. As feature isn't implemented, discard it (#4188) Reference: https://xmpp.org/rfcs/rfc6121.html#roster-syntax-items-approved Additionally, when roster contains unknown attribute, discard it and show a warning --- src/prosody2ejabberd.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/prosody2ejabberd.erl b/src/prosody2ejabberd.erl index 2ed6ea8e5..193314f50 100644 --- a/src/prosody2ejabberd.erl +++ b/src/prosody2ejabberd.erl @@ -322,8 +322,13 @@ convert_roster_item(LUser, LServer, JIDstring, LuaList) -> [R#roster{name = Name}]; ({<<"persist">>, false}, _) -> []; - (_, []) -> - [] + ({<<"approved">>, _}, [R]) -> + [R]; + (A, [R]) -> + io:format("Warning: roster of user ~ts@~ts includes unknown " + "attribute:~n ~p~nand that one is discarded.~n", + [LUser, LServer, A]), + [R] end, [InitR], LuaList) catch _:{bad_jid, _} -> []