Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Oct 21, 2018
1 parent 1901922 commit 7607443
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{deps_dir,"deps"}.
{lib_dirs,["deps"]}.
{deps, [{kvs,".*", {git, "git://github.com/synrc/kvs", []}},
{n2o,".*", {git, "git://github.com/synrc/mqtt", []}},
{active, ".*",{git, "git://github.com/synrc/active", "1.9"}},
{cowboy,".*", {git, "git://github.com/extend/cowboy", "1.0.1"}},
{nitro,".*", {git, "git://github.com/synrc/nitro", []}},
{mad,".*", {git, "git://github.com/synrc/mad", []}}
{erl_opts, [nowarn_export_all]}.
{deps, [{kvs, ".*", {git, "git://github.com/synrc/kvs", []}},
{n2o, ".*", {git, "git://github.com/synrc/mqtt", []}},
{active, ".*", {git, "git://github.com/synrc/active", []}},
{cowboy, ".*", {git, "git://github.com/voxoz/cowboy", []}},
{nitro, ".*", {git, "git://github.com/synrc/nitro", []}},
{mad, ".*", {git, "git://github.com/synrc/mad", []}}
]}.
2 changes: 1 addition & 1 deletion src/index.erl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ event(#client{id=Room,data=list}) ->
[ nitro:insert_top(history, nitro:jse(message_view(E#entry.from,E#entry.media)))
|| E <- lists:reverse(kvs:entries(kvs:get(feed,{room,Room}),entry,30)) ];

event(#ftp{sid=Sid,filename=Filename,status={event,stop}}=Data) ->
event(#ftp{sid=_Sid,filename=Filename,status={event,stop}}=Data) ->
io:format("FTP Delivered ~p~n",[Data]),
Name = hd(lists:reverse(string:tokens(nitro:to_list(Filename),"/"))),
IP = application:get_env(review,host,"127.0.0.1"),
Expand Down
6 changes: 3 additions & 3 deletions src/review_auth.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

info({init, <<>>}, Req, State = #cx{session = Session}) ->
{'Token', Token} = n2o_auth:gen_token([], Session),
#cx{params = ClientId} = get(context),
#cx{params = _ClientId} = get(context),
kvs:put({config, Token, State}),
io:format("Token Saved: ~p~n",[Token]),
n2o_nitro:info({init, Token}, Req, State);

% test protocol

info({load, <<>>}, Req, State = #cx{session = Session}) ->
info({load, <<>>}, Req, State = #cx{session = _Session}) ->
#cx{params = ClientId} = get(context),
M = "list of previous messages",
n2o:send_reply(ClientId, 2, iolist_to_binary([<<"actions/1/index/">>,ClientId]), M),
{reply, {binary, term_to_binary(<<>>)}, Req, State};

info({message, Text} = M, Req, State = #cx{session = Session}) ->
info({message, _Text} = M, Req, State = #cx{session = _Session}) ->
#cx{params = ClientId} = get(context),
n2o:send_reply(ClientId, 2, <<"room/global">>, M),
{reply, {binary, term_to_binary(<<>>)}, Req, State};
Expand Down

0 comments on commit 7607443

Please sign in to comment.