--- a/mcabber/src/jabglue.c Thu Dec 15 18:51:06 2005 +0100
+++ b/mcabber/src/jabglue.c Thu Dec 15 19:56:19 2005 +0100
@@ -1256,6 +1256,7 @@
} else if (!strcmp(type, "unsubscribed")) {
scr_LogPrint(LPRINT_LOGNORM, "<%s> has unsubscribed from your presence "
"updates", from);
+ roster_unsubscribed(from);
} else {
scr_LogPrint(LPRINT_LOGNORM, "Received (un)subscription packet from <%s>"
" (type=%s)", from, (type ? type : ""));
--- a/mcabber/src/roster.c Thu Dec 15 18:51:06 2005 +0100
+++ b/mcabber/src/roster.c Thu Dec 15 19:56:19 2005 +0100
@@ -595,6 +595,22 @@
return roster_usr->type;
}
+// roster_unsubscribed()
+// We have lost buddy's presence updates; this function clears the status
+// message, sets the buddy offline and frees the resources
+void roster_unsubscribed(const char *jid)
+{
+ GSList *sl_user;
+ roster *roster_usr;
+
+ sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT);
+ if (sl_user == NULL)
+ return;
+
+ roster_usr = (roster*)sl_user->data;
+ free_all_resources(&roster_usr->resource);
+}
+
/* ### BuddyList functions ### */
--- a/mcabber/src/roster.h Thu Dec 15 18:51:06 2005 +0100
+++ b/mcabber/src/roster.h Thu Dec 15 19:56:19 2005 +0100
@@ -96,6 +96,7 @@
enum imstatus roster_getstatus(const char *jid, const char *resname);
const char *roster_getstatusmsg(const char *jid, const char *resname);
guint roster_gettype(const char *jid);
+void roster_unsubscribed(const char *jid);
void buddylist_build(void);
void buddy_hide_group(gpointer rosterdata, int hide);