diff options
author | Marco Ziener <mziener@lavabit.com> | 2010-10-14 11:44:48 +0200 |
---|---|---|
committer | Marco Ziener <mziener@lavabit.com> | 2010-10-14 11:44:48 +0200 |
commit | 7f7862efc17932637234f54e4faa503ed356b4ce (patch) | |
tree | 2e13e53a6fdfcb2c42de26a35e37e3dc67f08819 /server | |
parent | 45c0805771f78696727741b190787d48f4f0f462 (diff) | |
parent | 8bd7f77de295d1d89edb95d6f9f869f1fedfdffc (diff) | |
download | erlang-7f7862efc17932637234f54e4faa503ed356b4ce.tar.gz erlang-7f7862efc17932637234f54e4faa503ed356b4ce.tar.xz erlang-7f7862efc17932637234f54e4faa503ed356b4ce.zip |
Merge branch 'master' of ssh://git.animux.de/erlang
Diffstat (limited to 'server')
-rw-r--r-- | server/client.erl | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/server/client.erl b/server/client.erl index bf8bc22..ce7c99b 100644 --- a/server/client.erl +++ b/server/client.erl @@ -20,6 +20,18 @@ loop(Client) -> Client ! {ok, {foo}}, loop(Client); + get_votes -> + Client ! {ok, media:getVotes(Client)}, + loop(Client); + + {vote, Artist, Title} -> + Client ! media:vote(Artist, Title), + loop(Client); + + {devote, Artist, Title} -> + Client ! media:devote(Artist, Title), + loop(Client); + Cmd -> Client ! {error, {unknown_command, Cmd}}, loop(Client) @@ -30,16 +42,3 @@ register(Client, {Name, Password}) -> login(Client, {Node, Name, Password}) -> dis ! {Client, {login, {Node, Name, Password}}}. - -getVotes() -> - media:getVotes(self()), - receive - Msg -> - Client ! Msg - end. - -vote(Artist,Title) -> - media:vote(Artist, Title). - -devote(Artist,Title) -> - media:devote(Artist, Title). |