anchor.diff:      irc_connection:send_cmd(Pid, #irc_cmd{name=pong,
                                             args=[{token, T}]}),
       {next_state, connected, State};
  +connected(E = {irc, _Pid, #irc_cmd{name=join}}, State) ->
  +    handle_join(E, State);
   connected({irc, _Pid, C}, State) ->
       ?INFO("(~p) ~s~n~p", [C#irc_cmd.name, C#irc_cmd.raw, C]),
       {next_state, connected, State}.
  -    
  +
  +handle_join({irc, _Pid, C = #irc_cmd{name=join, source=#user{nick=Me},
  +                                     args=[{channels, [Chan]}]}},
  +            State = #state{nick=Me,channels=Chans}) ->
  +    ?INFO("Joining ~s~nRaw: ~p", [Chan, C#irc_cmd.raw]),
  +    {next_state, joining_channel,
  +     State#state{channels=dict:store(Chan, #chan{name=Chan}, Chans)}};
  +
  +handle_join({irc, _Pid, C = #irc_cmd{name=join, source=#user{nick=Nick},
  +                                     args=[{channels, [Chan]}]}},
  +            State = #state{channels=Chans}) ->
  +    ?INFO("~s joined ~s.~nRaw: ~p", [Nick, Chan, C#irc_cmd.raw]),
  +    ChanR = dict:fetch(Chan, Chans),
  +    NewChanR = ChanR#chan{members=[{user, Nick}|ChanR#chan.members]},
  +    {next_state, connected,
  +     State#state{channels=dict:store(Chan, NewChanR, Chans)}}.
  +
  +joining_channel({irc, _Pid, C = #irc_cmd{args=A}},
  +                State = #state{channels=Chans}) ->
  +    ?INFO("Joining: ~p~nChans: ~p", [C, dict:to_list(Chans)]),
  +    {next_state, joining_channel, State}.
   
   %%--------------------------------------------------------------------
   %% Function:
  
positive.code: %% gen_fsm:send_all_state_event/2, this function is called to handle
  %% the event.
  %%--------------------------------------------------------------------
  handle_event({to_irc, Cmd}, StateName, State = #state{con=Pid}) when is_pid(Pid) ->
      irc_connection:send_cmd(Pid, Cmd),
      {next_state, StateName, State};
  
negative.code: %% initialize. 
  %%--------------------------------------------------------------------
  init([Conf = #conf{}, Nick]) ->
      {ok, connecting,
       #state{conf=Conf, nick=Nick,
              channels=dict:new()},
       0}.
  
  %%--------------------------------------------------------------------
  %% Function: 
  