anchor.diff:                      error;
                   _ ->
                       ?DEBUG("Subscribe OK"),
  -                    subscribed
  -            end
  -    end.
  -
  -
  -%% %% @doc Subscribe to a URL, 
  -unsubscribe_node(Service, Node, #state{jid=JID,session=Session}) ->
  -    IQ = exmpp_client_pubsub:unsubscribe(exmpp_jid:to_list(JID), Service, Node),
  +                    {SubId, <<"subscribed">>} = subscribe_results(Raw),
  +                    ?DEBUG(SubId),
  +                    {subscribed, SubId}
  +            end
  +    end.
  +
  +
  +%% %% @doc Unsubscribe from a URL.
  +unsubscribe_node(SubId, Service, Node, #state{jid=JID,session=Session}) ->
  +    IQ = exmpp_unsubscribe(SubId, exmpp_jid:to_list(JID), Service, Node),
       PacketId = binary_to_list(exmpp_session:send_packet(Session, exmpp_stanza:set_sender(IQ, JID))),
       receive
           #received_packet{id=PacketId, raw_packet=Raw} ->
  
positive.code:     end.
  
  
  
  %%
  %% XMPP received packet processing
  
negative.code:     end.
  
  
  
  exmpp_unsubscribe(SubId, From, Service, Node) ->
      %% Make the <subscribe/> element.
      Unsubscribe = exmpp_xml:set_attributes(
  		  #xmlel{ns = ?NS_PUBSUB, name = 'unsubscribe'},
  		  [{'node', Node},
  		   {'jid', From},
             {'subid', SubId}]),
      %% Prepare the final <iq/>.
      Pubsub = #xmlel{ns = ?NS_PUBSUB, name = 'pubsub', children = [Unsubscribe]},
      Iq = ?IQ_SET(Service, "pubsub-" ++ integer_to_list(random:uniform(65536 * 65536))),
      exmpp_xml:append_child(Iq, Pubsub).
  
  
  %%node_name(Id) ->
  %%    lists:flatten(io_lib:format("/home/testsandbox/zotonic/id-~p", [Id])).
  
  