summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--src/core/ephraim_conn.erl6
-rw-r--r--src/core/ephraim_conv.erl2
-rw-r--r--src/core/ephraim_util.erl18
4 files changed, 24 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b9d5b81..34e242d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
project("ephraim" C)
-cmake_minimum_required(VERSION 2.8.1)
-cmake_policy(VERSION 2.8.1)
+cmake_minimum_required(VERSION 2.8)
+cmake_policy(VERSION 2.8)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/erlang ${CMAKE_SOURCE_DIR}/cmake/vala)
include(ErlangTarget)
diff --git a/src/core/ephraim_conn.erl b/src/core/ephraim_conn.erl
index 65bbacc..ee57284 100644
--- a/src/core/ephraim_conn.erl
+++ b/src/core/ephraim_conn.erl
@@ -11,10 +11,10 @@
init() ->
application:start(exmpp),
Session = exmpp_session:start(),
- JID = exmpp_jid:make("ephraim-test", "jabber.ccc.de", "Bar"),
- exmpp_session:auth_basic_digest(Session, JID, "foobarbla"),
+ JID = exmpp_jid:make("ephraim", "localhost", "Bar"),
+ exmpp_session:auth_basic_digest(Session, JID, "test"),
io:format("Connecting...~n"),
- exmpp_session:connect_TCP(Session, "jabber.ccc.de", 5222),
+ exmpp_session:connect_TCP(Session, "localhost", 5222),
io:format("Connected.~n"),
session(#conn_state{session=Session}).
diff --git a/src/core/ephraim_conv.erl b/src/core/ephraim_conv.erl
index ac4c26d..dbf84c8 100644
--- a/src/core/ephraim_conv.erl
+++ b/src/core/ephraim_conv.erl
@@ -21,7 +21,7 @@ loop(State) ->
{receive_message, Packet} ->
Type = exmpp_message:get_type(Packet),
Body = exmpp_message:get_body(Packet),
- io:format("Received message from ~p:~n~p~n", [State#conv_state.jid, Packet]),
+ %io:format("Received message from ~p:~n~p~n", [State#conv_state.jid, Packet]),
ephraim ! {ui_update, {receive_message, State#conv_state.jid, Type, Body}},
loop(State);
diff --git a/src/core/ephraim_util.erl b/src/core/ephraim_util.erl
index 73cb7fc..cdf9cea 100644
--- a/src/core/ephraim_util.erl
+++ b/src/core/ephraim_util.erl
@@ -8,3 +8,21 @@ send_all(Dest, Message) ->
-spec send_all_values(dict(), term()) -> term().
send_all_values(Dest, Message) ->
dict:fold(fun(_,Value,Msg) -> Value ! Msg end, Message, Dest).
+
+-spec config_path() -> string().
+config_path() ->
+ Path = case os:getenv("XDG_CONFIG_HOME") of
+ false ->
+ os:getenv("HOME") ++ "/.config";
+ ConfigHome ->
+ ConfigHome
+ end ++ "/ephraim",
+ case file:read_file_info(Path) of
+ {ok, _} ->
+ ok;
+ {error, _} ->
+ file:make_dir(Path)
+ end,
+ Path.
+
+