anchor.diff:                           token   => list_to_binary(State#state.slackToken),
                            text    => unicode:characters_to_binary(Text),
                            as_user => true}),
  -    ContentType   = "application/json; charset=utf-8",
  -    ContentLength = byte_size(JSON),
  -    Headers = [{<<"content-type">>,   ContentType},
  -               {<<"content-length">>, ContentLength},
  -               {<<"authorization">>,  "Bearer " ++ State#state.slackToken}],
  -    gun:post(State#state.slackConn, "/api/chat.postMessage", Headers, JSON).+    Token   = State#state.slackToken,
  +    Headers = createHeaders(Token, JSON, "application/json; charset=utf-8"),
  +    gun:post(State#state.slackConn, "/api/chat.postMessage", Headers, JSON).
  +
  +createHeaders(Token, Body, ContentType) ->
  +    [{<<"content-type">>,   ContentType},
  +     {<<"content-length">>, byte_size(Body)},
  +     {<<"authorization">>,  "Bearer " ++ Token}].
  +
  +getUserInfo(Connection, Token) ->
  +    BinToken = list_to_binary(Token),
  +    Body     = <<"token=", BinToken/binary, "&presence=false">>,
  +    Headers  = createHeaders(Token, Body, "application/x-www-form-urlencoded"),
  +    Ref      = gun:post(Connection, "/api/users.list", Headers, Body),
  +    {"users.list", Ref, <<>>}.
  +
  +getChannelInfo(Connection, Token) ->
  +    BinToken = list_to_binary(Token),
  +    Body     = <<"token=", BinToken/binary, "&exclude_archived=true">>,
  +    Headers  = createHeaders(Token, Body, "application/x-www-form-urlencoded"),
  +    Ref      = gun:post(Connection, "/api/channels.list", Headers, Body),
  +    {"channels.list", Ref, <<>>}.
  +
  +getUserProfile(Connection, Token) ->
  +    BinToken = list_to_binary(Token),
  +    Body     = <<"token=", BinToken/binary>>,
  +    Headers  = createHeaders(Token, Body, "application/x-www-form-urlencoded"),
  +    Ref      = gun:post(Connection, "/api/users.profile.get", Headers, Body),
  +    {"users.profile.get", Ref, <<>>}.
  +
  +handleMsg(State, <<>>, User, Text, Channel) ->
  +    %% Print message
  +    State;
  +handleMsg(State, _BotId, User, _Text, Channel) ->
  +    case myUser(User, State) of
  +        true ->
  +            State;
  +        false ->
  +            %% Print message
  +            State
  +    end.
  +
  +setWriting(State) ->
  +    State.
  +
  +setPresence(State, User, Presence) ->
  +    case myUser(User, State) of
  +        true ->
  +            State#state{status = mapStatus(Presence)};
  +        false ->
  +            State
  +    end.
  +
  +setStatusText(State, User, StatusTxt) ->
  +    case myUser(User, State) of
  +        true ->
  +            State#state{statusText = StatusTxt};
  +        false ->
  +            State
  +    end.
  +
  +myUser(User, #state{slackUsers = SlackUsers, userProfile = Profile}) ->
  +    myUser(User, SlackUsers, Profile).
  +
  +myUser(_User, [], _Profile) ->
  +    false;
  +myUser(User, [SlackUser|Rest], Profile) ->
  +    case User == maps:get(<<"id">>, SlackUser, <<>>) of
  +        true ->
  +            maps:get(<<"profile">>, SlackUser, <<>>) == Profile;
  +        false ->
  +            myUser(User, Rest, Profile)
  +    end.
  +
  +mapStatus(<<"away">>) -> "Away";
  +mapStatus(_Other)     -> "Available".
positive.code: %% @end
  %%--------------------------------------------------------------------
  eGetStatusUpdate(_Dir, _User, Status, StatusMsg, State) ->
      {ok, Status, StatusMsg, State}.
  
  %%--------------------------------------------------------------------
  %% @doc
  
negative.code: -include_lib("eTodo/include/eTodo.hrl").
  -include_lib("wx/include/wx.hrl").
  
  -record(state, {frame, slackUrl, status, statusText,
                  slackToken, slackBotToken,
                  slackUsers, slackChannels, userProfile,
                  slackConn, slackRef,
                  wsCon, wsReconnectUrl}).
  
  %%--------------------------------------------------------------------
  %% @doc
  