summaryrefslogtreecommitdiffstats
path: root/src/core/ephraim.erl
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2010-07-17 23:49:06 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2010-07-17 23:49:06 +0200
commit69aaef2680ff5c96b34ad983b665a80c06c20224 (patch)
tree08ae44133e45f3f49d8f2324f23feb9c6f028246 /src/core/ephraim.erl
parent0aac619ba4dccd81018bddaa4690213b14cfe2b6 (diff)
downloadephraim-69aaef2680ff5c96b34ad983b665a80c06c20224.tar
ephraim-69aaef2680ff5c96b34ad983b665a80c06c20224.zip
Use nickname from VCard if no nickname is set
Diffstat (limited to 'src/core/ephraim.erl')
-rw-r--r--src/core/ephraim.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/ephraim.erl b/src/core/ephraim.erl
index d558eda..c8783f0 100644
--- a/src/core/ephraim.erl
+++ b/src/core/ephraim.erl
@@ -59,6 +59,14 @@ get_conv(State, JID) ->
end
end.
+-spec get_alias(binary()) -> binary().
+get_alias(JID) ->
+ ephraim ! {self(),get_alias,JID},
+ receive
+ {alias,JID,Alias} ->
+ Alias
+ end.
+
-spec loop(#state{}) -> ok.
loop(State) ->
receive
@@ -139,6 +147,10 @@ loop(State) ->
end,
loop(State);
+ {Pid, get_alias, JID} ->
+ State#state.roster ! {Pid,get_alias,JID},
+ loop(State);
+
Msg ->
io:format("ephraim: ~p~n", [Msg]),
loop(State)