anchor.diff:  	 login_pass/2,
   	 login_nick/2,
   	 login_user/2,
  -	 login/2]).
  +	 connected/2]).
   
   %% gen_fsm callbacks
   -export([init/1, handle_event/3,
  
positive.code: init(Options) ->
      Server = proplists:get_value(server, Options),
      Mod = proplists:get_value(mod, Options, gen_irc_server),
      init(Mod, Server, proplists:get_value(socket, Options, false)).
  
  init(Mod, Server, true) ->
      {ok, connecting, #state{server=Server, server_mod=Mod}}.
  
  %%--------------------------------------------------------------------
  %% Function: 
  
negative.code:            State = #state{user=U}) ->
      UserName = proplists:get_value(user_name, Args),
      RealName = proplists:get_value(real_name, Args),
      User = U#user{name=UserName,
                    realname=RealName},
      ?INFO("~p logged in.", [User]),
      welcome(State#state{user=User});
  login_user(Cmd = {irc, _, _}, State) ->
      ?INFO("Got ~p in state login_user", [Cmd]),
      csend(State, notregistered),
      {next_state, login_user, State}.
  
  welcome(State) ->
      serversend(State, #irc_cmd{name=welcome}),
      serversend(State, #irc_cmd{name=yourhost}), % XXX probably need to ask parent server our version
      serversend(State, #irc_cmd{name=created}), % XXX probably need to ask parent server when we were created
      serversend(State, #irc_cmd{name=myinfo}), % XXX probably need to ask parent server what we support
      %serversend(State, #irc_cmd{name=isupport}), % XXX probably need to ask parent server what we support
      {next_state, connected, State}.
  
  connected(Event, State) ->
      ?INFO("Got ~p in state connected.", [Event]),
      {next_state, connected, State}.
  
  %%--------------------------------------------------------------------
  %% Function:
  