1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-05 10:39:29 +02:00

Change mucsub API for database backends

This commit is contained in:
Evgeny Khramtsov 2019-04-03 14:20:37 +03:00
parent 4e591a73c5
commit e66f594901
5 changed files with 50 additions and 34 deletions

View file

@ -194,11 +194,14 @@ select_with_mucsub(LServer, JidRequestor, #jid{luser = LUser} = JidArchive,
_ ->
SubRooms = case mod_muc_admin:find_hosts(LServer) of
[First|_] ->
mod_muc:get_subscribed_rooms(First, JidRequestor);
case mod_muc:get_subscribed_rooms(First, JidRequestor) of
{ok, L} -> L;
{error, _} -> []
end;
_ ->
[]
end,
[jid:encode(Jid) || #muc_subscription{jid = Jid} <- SubRooms]
[jid:encode(Jid) || {Jid, _} <- SubRooms]
end,
{Query, CountQuery} = make_sql_query(LUser, LServer, MAMQuery, RSM, Extra),
do_select_query(LServer, JidRequestor, JidArchive, RSM, chat, Query, CountQuery).