anchor.diff:      {noreply, State};
               
   handle_info(Msg, State) ->
  -    io:format("RCV: ~p~n",[Msg]),
  +    io:format("UNHANDLED RCV: ~p~n",[Msg]),
       {noreply, State}.
   
   terminate(_Reason, _State) ->
  
positive.code: -include("playdar.hrl").
  
  %% API
  -export([start_link/0]).
  
  %% gen_server callbacks
  -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
       terminate/2, code_change/3]).
  
  -record(state, {session, jid}).
  
  %% API
  start_link() ->
      gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
  
  %% gen_server callbacks
  init([]) ->
      application:start(exmpp),
      Session = exmpp_session:start(),
      JID = exmpp_jid:make(?CONFVAL({jabber,username}),
                           ?CONFVAL({jabber,domain}),
                           "playdar-"++integer_to_list(random:uniform(100000000))),
      exmpp_session:auth_basic(Session, JID, ?CONFVAL({jabber, password})),
      _StreamId = exmpp_session:connect_TCP(Session, "jabber.org", 5222),
      gen_server:cast(?MODULE, do_login),
      {ok, #state{session=Session, jid=JID}}.
  
  handle_call(_Request, _From, State) ->
      Reply = ok,
  
negative.code:     TmpPacket2 = exmpp_xml:set_attribute(TmpPacket, to, From),
      NewPacket = exmpp_xml:remove_attribute(TmpPacket2, id),
      exmpp_session:send_packet(MySession, NewPacket).
  
  
  playdar_capable({_User, _Domain, Resource} = _Jid) ->
  	R = binary_to_list(Resource),
  	string:str(R, "playdar") /= 0.