aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexey Shchepin <alexey@process-one.net>2007-04-26 14:45:16 +0000
committerAlexey Shchepin <alexey@process-one.net>2007-04-26 14:45:16 +0000
commit1e5a9d9f431a6090eaa316eae279b9c3ecf7e751 (patch)
treead6b3b51fbcfa07302b14f1c1576d5423b2fbfdd /src
parent* src/ejabberd_socket.erl: Added API for monitoring socket (diff)
* src/mod_roster_odbc.erl: Don't deliver roster items in "None +
Pending In" state * src/mod_roster.erl: Likewise SVN Revision: 752
Diffstat (limited to 'src')
-rw-r--r--src/mod_roster.erl16
-rw-r--r--src/mod_roster_odbc.erl13
2 files changed, 24 insertions, 5 deletions
diff --git a/src/mod_roster.erl b/src/mod_roster.erl
index 04d539cbf..793892bdc 100644
--- a/src/mod_roster.erl
+++ b/src/mod_roster.erl
@@ -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
diff --git a/src/mod_roster_odbc.erl b/src/mod_roster_odbc.erl
index 876b699f6..ed79edef7 100644
--- a/src/mod_roster_odbc.erl
+++ b/src/mod_roster_odbc.erl
@@ -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