summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2010-06-22 03:21:28 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2010-06-22 03:21:28 +0200
commit3bb13593695d1db50885588cd96e1be85f5a8e45 (patch)
tree478e5e07d391cd6a68fd1eaa4444d484a88d3ab0 /src
parent405b5ba0aa85b5155fb45df5407b69b1441ada75 (diff)
downloadephraim-3bb13593695d1db50885588cd96e1be85f5a8e45.tar
ephraim-3bb13593695d1db50885588cd96e1be85f5a8e45.zip
Added header and option support to Erlang CMake build
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/ephraim.erl3
-rw-r--r--src/core/ephraim_roster.erl9
3 files changed, 10 insertions, 4 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index b0ab82c..792f279 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -4,4 +4,6 @@ erl_target(ephraim-core
ephraim_conv.erl
ephraim_roster.erl
ephraim_util.erl
+OPTIONS
+ +debug_info
)
diff --git a/src/core/ephraim.erl b/src/core/ephraim.erl
index dc8382d..523749c 100644
--- a/src/core/ephraim.erl
+++ b/src/core/ephraim.erl
@@ -10,7 +10,8 @@
-spec start() -> ok.
start() ->
- spawn(?MODULE, init, []).
+ spawn(?MODULE, init, []),
+ ok.
-spec stop() -> ok.
stop() ->
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 ->