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

Add missing needdb, use bare jid to get roster; now group and subs blocking works again (thanks to Andreas Köhler)

This commit is contained in:
Badlop 2010-09-17 21:06:30 +02:00
parent afac34de88
commit 9bde1dc9af
2 changed files with 10 additions and 7 deletions

View File

@ -418,11 +418,14 @@ process_active_set(LUser, LServer, Name) ->
[{'=', user_host, {LUser, LServer}}, [{'=', user_host, {LUser, LServer}},
{'=', name, Name}]) of {'=', name, Name}]) of
[#privacy_list{}] -> [#privacy_list{}] ->
List = gen_storage:select(LServer, privacy_list_data, Data = gen_storage:select(LServer, privacy_list_data,
[{'=', user_host, {LUser, LServer}}, [{'=', user_host, {LUser, LServer}},
{'=', name, Name}]), {'=', name, Name}]),
List = list_data_to_items(Data),
NeedDb = is_list_needdb(List),
{result, [], #userlist{name = Name, {result, [], #userlist{name = Name,
list = list_data_to_items(List)}}; needdb = NeedDb,
list = List}};
[] -> [] ->
{error, 'item-not-found'} {error, 'item-not-found'}
end end

View File

@ -1183,15 +1183,15 @@ get_jid_info(_, User, Server, JID)
LServer = exmpp_stringprep:nameprep(Server), LServer = exmpp_stringprep:nameprep(Server),
try try
F = fun() -> F = fun() ->
LJID = jlib:short_prepd_jid(JID), LJID = jlib:short_prepd_jid(JID),
case catch gen_storage:read(LServer, {rosteritem, {LUser, LServer, LJID}}) of LRJID = jlib:short_prepd_bare_jid(JID),
case catch gen_storage:read(LServer, {rosteritem, {LUser, LServer, LRJID}}) of
[#rosteritem{subscription = Subscription}] -> [#rosteritem{subscription = Subscription}] ->
Groups = Groups =
[Group || #rostergroup{grp = Group} <- [Group || #rostergroup{grp = Group} <-
gen_storage:read(LServer, {rostergroup, {LUser, LServer, LJID}})], gen_storage:read(LServer, {rostergroup, {LUser, LServer, LRJID}})],
{Subscription, Groups}; {Subscription, Groups};
_ -> _ ->
LRJID = jlib:short_prepd_bare_jid(JID),
if if
LRJID == LJID -> LRJID == LJID ->
{none, []}; {none, []};
@ -1202,7 +1202,7 @@ get_jid_info(_, User, Server, JID)
[#rosteritem{subscription = Subscription}] -> [#rosteritem{subscription = Subscription}] ->
Groups = Groups =
[Group || #rostergroup{grp = Group} <- [Group || #rostergroup{grp = Group} <-
gen_storage:read(LServer, {rostergroup, {LUser, LServer, LJID}})], gen_storage:read(LServer, {rostergroup, {LUser, LServer, LRJID}})],
{Subscription, Groups}; {Subscription, Groups};
_ -> _ ->
{none, []} {none, []}