anchor.diff:  
   %@doc Handles presence stanzas sent by users
   handle_presence(UserState, {User, Server, Resource} = JID) ->
  -  {IPAddress, _} = ejabberd:get_user_ip(User, Server, Resource),
  +  {IPAddress, _} = ejabberd_sm:get_user_ip(User, Server, Resource),
     ?DEBUG("User ~p (~p) is ~p", [JID, IPAddress, UserState]),
   
     % Passes over the processing into a new process
  +  % Strings are converted to utf8 because of MongoDB driver
     gen_server:cast(?MODULE, {UserState, JID, IPAddress}),
  -  report_event(Server, UserState),
  +  report_event(Server, atom_to_list(UserState)),
     ok.
   
   %%% gen_server %%%
  
positive.code: 
  %@doc Parses JID (username part) of an agent (ex.: agent_s-10829_1_7_18225d4f-e3f7-4c18-9a18-d6c06992d272_-g)
  parse_component_jid(User) ->
    lists:zip([component, version, cores, jobs, uuid, ukn], strings:tokens(User, "_")).
  
  %@doc Creates a MonoDB document describing the connection
  doc_create_connection({User, Host, Resource}, IPAddress) ->
  
negative.code:   mongo_do(State, copilot, fun () -> mongo:save(connections, Doc) end);
  handle_cast({disconnect, {User, Host, Resource} = JID, IPAddress}, State) ->
    mongo_do(State, copilot, fun () ->
      Cursor = mongo:find(connections, {user, utf8(User),
                                        host, utf8(Host),
                                        resource, utf8(Resource),
                                        connected, true}),
      NewDoc = doc_close_connection(mongo:next(Cursor), JID, IPAddress),
      mongo:close_cursor(Cursor),
  