+/*
+ * Function to remove a buddy subscription and delete from the roster
+ * (used in several places)
+ */
+void xmpp_destroy_buddy(char *presence_jid) {
+ static int unsolicited_id = 1;
+
+ /* Transmit non-presence information */
+ cprintf("<presence type=\"unavailable\" from=\"%s\"></presence>", presence_jid);
+ cprintf("<presence type=\"unsubscribed\" from=\"%s\"></presence>", presence_jid);
+
+ /* Do an unsolicited roster update that deletes the contact. */
+ cprintf("<iq id=\"unbuddy_%x\" type=\"result\">", ++unsolicited_id);
+ cprintf("<query xmlns=\"jabber:iq:roster\">");
+ cprintf("<item jid=\"%s\" subscription=\"remove\">", presence_jid);
+ cprintf("<group>%s</group>", config.c_humannode);
+ cprintf("</item>");
+ cprintf("</query>"
+ "</iq>"
+ );
+}
+