anchor.diff:  %% @end
   %%--------------------------------------------------------------------
   handle_cast(Msg, State) ->
  -    lager:debug("### <xmpp> cast: ~p~n", [Msg]),
  -    {noreply, State}.
  +	lager:debug("### <xmpp> cast: ~p~n", [Msg]),
  +	{noreply, State}.
   
   %%--------------------------------------------------------------------
   %% @private
  
positive.code: %% @end
  %%--------------------------------------------------------------------
  handle_call(Req, _From, State) ->
      lager:debug("### <xmpp> request: ~p~n", [Req]),
      Reply = ok,
      {reply, Reply, State}.
  
  %%--------------------------------------------------------------------
  %% @private
  
negative.code: %% @end
  %%--------------------------------------------------------------------
  code_change(_OldVsn, State, _Extra) ->
  	{ok, State}.
  
  %%%===================================================================
  %%% Internal functions
  %%%===================================================================
  validate_cfg(Props) ->
  	Str = case proplists:get_value(jid, Props) of
  			  undefined -> throw({undefined_opt, jid});
  			  V -> V
  		  end,
  	{User, Domain} = case string:tokens(Str, "@") of
  						 [U, D] -> {U, D};
  						 _ -> throw({error, {invalid_jid, Str}})
  					 end,
  	P2 = [{jid, exmpp_jid:make(User, Domain, <<"erocci">>)} | Props],
  	P3 = case proplists:is_defined(server, Props) of
  			 false -> [{server, Domain} | P2];
  			 true -> P2
  		 end,
  	case proplists:get_value(passwd, P3) of
  		undefined -> throw({undefined_opt, passwd});
  		_S -> P3
  	end.
  
  session(Props) ->
  	Session = exmpp_session:start(),
  	Jid = proplists:get_value(jid, Props),
  	Passwd = proplists:get_value(passwd, Props),
  	exmpp_session:auth_basic_digest(Session, Jid, Passwd),
  	S = #state{jid=Jid, handler=?HANDLER},
  	case exmpp_session:connect_TCP(Session, proplists:get_value(server, Props)) of
  		{ok, _SId} -> 
  			auth(S#state{session=Session});
  		{ok, _SId, _F} ->
  			auth(S#state{session=Session});
  		Other -> {stop, {session_error, Other}}
  	end.
  
  auth(#state{session=Session}=S) ->
  	try exmpp_session:login(Session)
  	catch throw:Err -> {stop, Err}
  	end,
  	Status = get_initial_presence("erocci ready"),
  	exmpp_session:send_packet(Session, Status),
  	%% TODO : Maybe call in another place
  	iq_roster(Session),
  	{ok, S}.
  
  presence_subscribed(Session, Recipient) ->
  	Presence_Subscribed = exmpp_presence:subscribed(),
  	Presence = exmpp_stanza:set_recipient(Presence_Subscribed, Recipient),
  	exmpp_session:send_packet(Session, Presence).
  
  presence_subscribe(Session, Recipient) ->
  	Presence_Subscribe = exmpp_presence:subscribe(),
  	Presence = exmpp_stanza:set_recipient(Presence_Subscribe, Recipient),
  	exmpp_session:send_packet(Session, Presence).
  
  handle_roster(From, Raw, _State) ->
  	case exmpp_xml:get_attribute(Raw, binary:list_to_bin("type"), "not_found") of
  