mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Merge branch 'master' into osx-functional
This commit is contained in:
commit
629d949692
@ -2665,10 +2665,15 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
|
||||
}
|
||||
|
||||
const char *barejid = p_contact_barejid(contact);
|
||||
|
||||
// TODO wait for result stanza before updating
|
||||
const char *oldnick = p_contact_name(contact);
|
||||
wins_change_nick(barejid, oldnick, name);
|
||||
roster_change_name(contact, name);
|
||||
GSList *groups = p_contact_groups(contact);
|
||||
roster_send_name_change(barejid, name, groups);
|
||||
|
||||
|
||||
cons_show("Nickname for %s set to: %s.", jid, name);
|
||||
|
||||
return TRUE;
|
||||
@ -2693,6 +2698,10 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
|
||||
}
|
||||
|
||||
const char *barejid = p_contact_barejid(contact);
|
||||
|
||||
// TODO wait for result stanza before updating
|
||||
const char *oldnick = p_contact_name(contact);
|
||||
wins_remove_nick(barejid, oldnick);
|
||||
roster_change_name(contact, NULL);
|
||||
GSList *groups = p_contact_groups(contact);
|
||||
roster_send_name_change(barejid, NULL, groups);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -48,6 +48,8 @@ ProfWin* wins_new_private(const char *const fulljid);
|
||||
gboolean wins_chat_exists(const char *const barejid);
|
||||
GList* wins_get_private_chats(const char *const roomjid);
|
||||
void wins_private_nick_change(const char *const roomjid, const char *const oldnick, const char *const newnick);
|
||||
void wins_change_nick(const char *const barejid, const char *const oldnick, const char *const newnick);
|
||||
void wins_remove_nick(const char *const barejid, const char *const oldnick);
|
||||
|
||||
ProfWin* wins_get_console(void);
|
||||
ProfChatWin* wins_get_chat(const char *const barejid);
|
||||
|
Loading…
Reference in New Issue
Block a user