aboutsummaryrefslogtreecommitdiff
path: root/src/mod_shared_roster.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2016-08-12 13:17:42 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2016-08-12 13:17:42 +0300
commit31faa4eb9ad881c7884cd24f5d374d8b20e4b6c5 (patch)
tree8e23cec0f14663cf1f8e5bdcedff0625914f6cca /src/mod_shared_roster.erl
parentImprove some type specs (diff)
Add more type specs
Diffstat (limited to 'src/mod_shared_roster.erl')
-rw-r--r--src/mod_shared_roster.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl
index ac3717bd3..8b620514b 100644
--- a/src/mod_shared_roster.erl
+++ b/src/mod_shared_roster.erl
@@ -135,6 +135,7 @@ stop(Host) ->
depends(_Host, _Opts) ->
[].
+-spec get_user_roster([#roster{}], {binary(), binary()}) -> [#roster{}].
get_user_roster(Items, US) ->
{U, S} = US,
DisplayedGroups = get_user_displayed_groups(US),
@@ -202,6 +203,7 @@ get_rosteritem_name_vcard(_) ->
%% This function rewrites the roster entries when moving or renaming
%% them in the user contact list.
+-spec process_item(#roster{}, binary()) -> #roster{}.
process_item(RosterItem, Host) ->
USFrom = {UserFrom, ServerFrom} = RosterItem#roster.us,
{UserTo, ServerTo, ResourceTo} = RosterItem#roster.jid,
@@ -292,6 +294,8 @@ set_item(User, Server, Resource, Item) ->
jid:make(Server),
ResIQ).
+-spec get_subscription_lists({[ljid()], [ljid()]}, binary(), binary())
+ -> {[ljid()], [ljid()]}.
get_subscription_lists({F, T}, User, Server) ->
LUser = jid:nodeprep(User),
LServer = jid:nameprep(Server),
@@ -304,6 +308,8 @@ get_subscription_lists({F, T}, User, Server) ->
SRJIDs = [{U1, S1, <<"">>} || {U1, S1} <- SRUsers],
{lists:usort(SRJIDs ++ F), lists:usort(SRJIDs ++ T)}.
+-spec get_jid_info({subscription(), [binary()]}, binary(), binary(), jid())
+ -> {subscription(), [binary()]}.
get_jid_info({Subscription, Groups}, User, Server,
JID) ->
LUser = jid:nodeprep(User),
@@ -332,6 +338,9 @@ get_jid_info({Subscription, Groups}, User, Server,
error -> {Subscription, Groups}
end.
+-spec in_subscription(boolean(), binary(), binary(), jid(),
+ subscribe | subscribed | unsubscribe | unsubscribed,
+ binary()) -> boolean().
in_subscription(Acc, User, Server, JID, Type,
_Reason) ->
process_subscription(in, User, Server, JID, Type, Acc).