anchor.diff:              undefined;
           Event ->
               Element = exmpp_xml:get_element_by_ns(Event, ?NS_PUBSUB_EVENT),
  -            ?DEBUG(Element),
               case exmpp_xml:get_name_as_atom(Element) of
                   items ->
                       exmpp_xml:foreach(fun(_, Item) -> process_pubsub_item(Item, State) end, Element);
                   delete ->
  -                    ?DEBUG("Delete notification")
  +                    ?DEBUG("Delete notification"),
  +                    ?DEBUG(Element)
  +                    %% TODO - we get the pubsub node here which has
  +                    %% been deleted; look it up in the rsc table
  +                    %% (reverse lookup - custom pivot?) and delete
  +                    %% corresponding rsc.
               end
       end.
   
  
positive.code:                     %% Create the rsc
                      {ok, Id} = m_rsc_import:create_empty(RscUrl, [{pubsub_xmpp_uri, Uri}], State#state.context),
                      %% Do the subscription
                      {ok, Id, subscribe_node(exmpp_jid:to_list(Jid), Node, State)}
              end;
  
          undefined ->
  
negative.code: 
      z_notifier:observe(subscribe_to_url, self(), Context),
  
      case m_config:get_value(?MODULE, jid, Context) of
          undefined ->
              z_session_manager:broadcast(#broadcast{type="error", message="Module has not been configured, not starting pubsub client. Please configure pubsub and then activate the module again.", title="Pubsub", stay=true}, Context),
              ignore;
          _ ->
              Domain = m_config:get_value(?MODULE, pubsub_domain, "pubsub." ++ z_dispatcher:hostname(Context), Context),
              {ok, connect(#state{context=z_acl:sudo(z_context:new(Context)), pubsub_domain=Domain})}
      end.
  
  
  %% Description: Handling call messages
  