25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

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
This commit is contained in:
Badlop 2024-04-04 13:32:32 +02:00
parent 735516ed37
commit 7c76f2b764

View File

@ -322,8 +322,13 @@ convert_roster_item(LUser, LServer, JIDstring, LuaList) ->
[R#roster{name = Name}]; [R#roster{name = Name}];
({<<"persist">>, false}, _) -> ({<<"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) end, [InitR], LuaList)
catch _:{bad_jid, _} -> catch _:{bad_jid, _} ->
[] []