about summary refs log tree commit diff stats
path: root/src/window_list.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-02-03 22:19:29 +0000
committerJames Booth <boothj5@gmail.com>2016-02-03 22:19:29 +0000
commit30116dd922d57e6676118b47a7c59bdaa838406d (patch)
treebaf7de23db7e978bd97e4714708504d5df9d41f4 /src/window_list.c
parent46b27bcbd8ca0dd89194c4192446d5386eb6013d (diff)
downloadprofani-tty-30116dd922d57e6676118b47a7c59bdaa838406d.tar.gz
Update autocompleters on roster nick change/clear
fixes #720
Diffstat (limited to 'src/window_list.c')
-rw-r--r--src/window_list.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/window_list.c b/src/window_list.c
index e4ef8a64..62576b84 100644
--- a/src/window_list.c
+++ b/src/window_list.c
@@ -221,6 +221,32 @@ wins_private_nick_change(const char *const roomjid, const char *const oldnick, c
     jid_destroy(oldjid);
 }
 
+void
+wins_change_nick(const char *const barejid, const char *const oldnick, const char *const newnick)
+{
+    ProfChatWin *chatwin = wins_get_chat(barejid);
+    if (chatwin) {
+        if (oldnick) {
+            autocomplete_remove(wins_ac, oldnick);
+            autocomplete_remove(wins_close_ac, oldnick);
+        }
+        autocomplete_add(wins_ac, newnick);
+        autocomplete_add(wins_close_ac, newnick);
+    }
+}
+
+void
+wins_remove_nick(const char *const barejid, const char *const oldnick)
+{
+    ProfChatWin *chatwin = wins_get_chat(barejid);
+    if (chatwin) {
+        if (oldnick) {
+            autocomplete_remove(wins_ac, oldnick);
+            autocomplete_remove(wins_close_ac, oldnick);
+        }
+    }
+}
+
 ProfWin*
 wins_get_current(void)
 {