summaryrefslogtreecommitdiffstats
path: root/src/core/ephraim_roster.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ephraim_roster.erl')
-rw-r--r--src/core/ephraim_roster.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/ephraim_roster.erl b/src/core/ephraim_roster.erl
index 678a8c3..2998782 100644
--- a/src/core/ephraim_roster.erl
+++ b/src/core/ephraim_roster.erl
@@ -9,13 +9,14 @@
-record(roster_entry, {
name :: binary() | undefined,
subscription :: atom() | undefined,
+ groups :: set(),
resources :: dict()
}).
-record(resource_entry, {
priority :: integer(),
show :: atom(),
- status :: string()
+ status :: binary()
}).
@@ -23,7 +24,7 @@
init() ->
loop(#roster{entries=dict:new()}).
--spec updateResource(#roster{}, binary(), integer(), atom(), atom(), string()) -> #roster{}.
+-spec updateResource(#roster{}, binary(), integer(), atom(), atom(), binary()) -> #roster{}.
updateResource(Roster, JID, Priority, Type, Show, Status) ->
{Node, Domain, Resource} = exmpp_jid:to_lower(exmpp_jid:parse(JID)),
BareJID = list_to_binary([Node, <<"@">>, Domain]),
@@ -58,7 +59,8 @@ updateRosterEntry(Roster, JID, Name, Subscription) ->
error ->
dict:new()
end,
- NewEntry = #roster_entry{subscription=Subscription,name=Name,resources=Resources},
+ Groups = sets:new(),
+ NewEntry = #roster_entry{subscription=Subscription,name=Name,resources=Resources,groups=Groups},
Entries = dict:store(JID, NewEntry, Roster#roster.entries),
ephraim ! {ui_update, {roster_update, JID, dict:to_list(Resources)}},
Roster#roster{entries=Entries}.
@@ -101,6 +103,7 @@ loop(Roster) ->
{roster_iq, Payload} ->
Roster2 = handleRosterIQs(Roster, Payload#xmlel.children),
+ io:format("ephraim_roster: IQ: ~p~n", [Payload]),
loop(Roster2);
Msg ->