24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-18 22:15:20 +02:00

* src/mod_roster_odbc.erl: Don't deliver roster items in "None +

Pending In" state
* src/mod_roster.erl: Likewise

SVN Revision: 752
This commit is contained in:
Alexey Shchepin 2007-04-26 14:45:16 +00:00
parent fa6b6b8f5a
commit 1e5a9d9f43
3 changed files with 30 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2007-04-26 Alexey Shchepin <alexey@sevcom.net>
* src/mod_roster_odbc.erl: Don't deliver roster items in "None +
Pending In" state
* src/mod_roster.erl: Likewise
2007-04-12 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_socket.erl: Added API for monitoring socket

View File

@ -129,7 +129,11 @@ process_iq_get(From, To, #iq{sub_el = SubEl} = IQ) ->
get_user_roster(Acc, US) ->
case catch mnesia:dirty_index_read(roster, US, #roster.us) of
Items when is_list(Items) ->
Items ++ Acc;
lists:filter(fun(#roster{subscription = none, ask = in}) ->
false;
(_) ->
true
end, Items) ++ Acc;
_ ->
Acc
end.
@ -450,8 +454,14 @@ process_subscription(Direction, User, Server, JID1, Type, Reason) ->
end,
case Push of
{push, Item} ->
push_item(User, Server,
jlib:make_jid("", Server, ""), Item),
if
Item#roster.subscription == none,
Item#roster.ask == in ->
ok;
true ->
push_item(User, Server,
jlib:make_jid("", Server, ""), Item)
end,
true;
none ->
false

View File

@ -138,6 +138,9 @@ get_user_roster(Acc, {LUser, LServer}) ->
case raw_to_record(LServer, I) of
error ->
[];
#roster{subscription = none,
ask = in} ->
[];
R ->
SJID = jlib:jid_to_string(R#roster.jid),
Groups = lists:flatmap(
@ -488,8 +491,14 @@ process_subscription(Direction, User, Server, JID1, Type, Reason) ->
end,
case Push of
{push, Item} ->
push_item(User, Server,
jlib:make_jid("", Server, ""), Item),
if
Item#roster.subscription == none,
Item#roster.ask == in ->
ok;
true ->
push_item(User, Server,
jlib:make_jid("", Server, ""), Item)
end,
true;
none ->
false