about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/profanity.c7
-rw-r--r--src/profanity.h1
-rw-r--r--src/ui/core.c6
-rw-r--r--src/ui/ui.h1
-rw-r--r--src/xmpp/roster.c2
5 files changed, 17 insertions, 0 deletions
diff --git a/src/profanity.c b/src/profanity.c
index 84af8ab1..732cbf5c 100644
--- a/src/profanity.c
+++ b/src/profanity.c
@@ -207,6 +207,13 @@ prof_handle_roster_add(const char * const barejid, const char * const name)
 }
 
 void
+prof_handle_roster_remove(const char * const barejid)
+{
+    ui_roster_remove(barejid);
+    ui_current_page_off();
+}
+
+void
 prof_handle_login_account_success(char *account_name)
 {
     ProfAccount *account = accounts_get_account(account_name);
diff --git a/src/profanity.h b/src/profanity.h
index 7f96b04e..ebf7d044 100644
--- a/src/profanity.h
+++ b/src/profanity.h
@@ -81,5 +81,6 @@ void prof_handle_disco_info(const char *from, GSList *identities,
 void prof_handle_duck_help(const char * const result);
 void prof_handle_duck_result(const char * const result);
 void prof_handle_roster_add(const char * const barejid, const char * const name);
+void prof_handle_roster_remove(const char * const barejid);
 
 #endif
diff --git a/src/ui/core.c b/src/ui/core.c
index 8cb8831b..3b08e593 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -450,6 +450,12 @@ ui_roster_add(const char * const barejid, const char * const name)
 }
 
 void
+ui_roster_remove(const char * const barejid)
+{
+    cons_show("Roster item removed: %s", barejid);
+}
+
+void
 ui_contact_online(const char * const barejid, const char * const resource,
     const char * const show, const char * const status, GDateTime *last_activity)
 {
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 8f5610fc..6eb0d814 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -113,6 +113,7 @@ void ui_room_nick_change(const char * const room, const char * const nick);
 void ui_room_member_presence(const char * const room,
     const char * const nick, const char * const show, const char * const status);
 void ui_roster_add(const char * const barejid, const char * const name);
+void ui_roster_remove(const char * const barejid);
 
 // contact status functions
 void ui_status_room(const char * const contact);
diff --git a/src/xmpp/roster.c b/src/xmpp/roster.c
index b5e94f42..234bfad2 100644
--- a/src/xmpp/roster.c
+++ b/src/xmpp/roster.c
@@ -403,6 +403,8 @@ _roster_handle_push(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
         // remove the contact
         g_hash_table_remove(contacts, barejid);
 
+        prof_handle_roster_remove(barejid);
+
     // otherwise update local roster
     } else {