anchor.diff:     {"event", Event},
      {Type, Value}].
   
  +% Sends a reportEvent command to the Monitor
   report_event(Server, Event) ->
     To = gen_mod:get_module_opt(Server, ?MODULE, monitor_jid, "mon@localhost"),
     XmlBody = {xmlelement, "message", [{"from", ?JID},
  
positive.code: -module(mod_copilot).
  -behavior(gen_mod).
  -define(PROCNAME, mod_copilot).
  -define(JID, "mod_copilot@localhost").
  
  -include("ejabberd.hrl").
  -include("jlib.hrl").
  -export([start/2, stop/1, on_presence/4, lookup_ip/1, ucfirst/1, report_event/2, report_event/4]).
  
  start(Host, _Opt) ->
    ?INFO_MSG("** init copilot plugin", []),
  
    application:start(mongodb),
    application:start(egeoip),
  
    ejabberd_hooks:add(set_presence_hook, Host, ?MODULE, on_presence, 50),
    ok.
  
negative.code: 
  % Sends an message as mod_copilot@localhost and
  % performs base64-encoding of the attributes
  route_to_copilot_component(To, Xml) -> route_to_copilot_component(?JID, To, Xml).
  route_to_copilot_component(From, To, Xml) -> ejabberd_router:route(jlib:string_to_jid(From), jlib:string_to_jid(To), hash_xml_body(Xml)).
  
  hash_xml_body({xmlelement, Tag, Attributes, ChildNodes}) ->
    {xmlelement,
  