Skip to content

Commit

Permalink
make application
Browse files Browse the repository at this point in the history
  • Loading branch information
astro committed Nov 17, 2008
1 parent 539ebc6 commit 928ecdf
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
3 changes: 2 additions & 1 deletion START
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
code:add_path("../../exmpp-dist/exmpp-0.9.0/ebin/").
application:start(sasl).
application:start(exmpp).
client:start_link("collector@jabber.ccc.de/foo","traversal").
application:start(sub2text).

12 changes: 12 additions & 0 deletions sub2text.app
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{application, sub2text,
[{description, "XMPP PubSub to text message bridge"},
{id, "sub2text"},
{vsn, "v0.1"},
{modules, [chat, client, item_to_msg, pubsub,
roster, sub2text, subscriptions]},
{applications, [sasl]},
{env, [{jid, "collector@jabber.ccc.de"},
{password, "traversal"}]},
{mod, {sub2text_app, []}}
]}.

22 changes: 22 additions & 0 deletions sub2text_app.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-module(sub2text_app).


-behaviour(application).

-export([start/2]).


start(normal, _Args) ->
mnesia:create_schema([node()]),
mnesia:start(),
subscriptions:init(),
{ok, JID} = application:get_env(jid),
{ok, Password} = application:get_env(password),
{ok, Pid} = client:start_link(JID, Password),
pubsub:start(),
chat:start(),
roster:start(),
{ok, Pid};

start(_, _) ->
{error, badarg}.
2 changes: 0 additions & 2 deletions subscriptions.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
-record(pending_subscribed, {jid_node, requesters}).

init() ->
mnesia:create_schema([node()]),
mnesia:start(),
mnesia:create_table(subscription,
[{disc_copies, [node()]},
{type, bag},
Expand Down

0 comments on commit 928ecdf

Please sign in to comment.