anchor.diff:  %@doc Handles presence stanzas sent by users
   handle_presence(UserState, {User, Server, Resource} = JID) ->
     {IPAddress, _} = ejabberd:get_user_ip(User, Server, Resource),
  -  ?DEBUG("User ~p (~p) is ~p", [JID, IPAddress, State]),
  +  ?DEBUG("User ~p (~p) is ~p", [JID, IPAddress, UserState]),
   
     % Passes over the processing into a new process
     gen_server:cast(?MODULE, {UserState, JID, IPAddress}),
  
positive.code:   Opts = proplists:get_value(opts, State),
    Host = case proplists:get_value(mongodb, Opts) of
      undefined -> {localhost, 27017};
      Value -> Value;
    end,
    {ok, NewConn} = mongo:connect(Host),
    proplists:delete(conn, State) ++ [{conn, NewConn}].
  
negative.code: mongo_do(State, Table, Op) ->
    Conn = proplists:get_value(mongo, State),
    case mongo:do(safe, master, Conn, Table, Op) of
      {ok, _} -> {noreply, State};
      {failure, Failure} ->
        ?DEBUG("MongoDB operation failed with: ~p", [Failure]),
        {noreply, mongo_reconnect(State)}
  