Prevent redundant name change messages.
This commit is contained in:
parent
3db78a5c16
commit
1bd4d6b02b
@ -135,21 +135,24 @@ tox_weechat_name_change_callback(Tox *tox,
|
|||||||
char *old_name = tox_weechat_get_name_nt(identity->tox, friend_number);
|
char *old_name = tox_weechat_get_name_nt(identity->tox, friend_number);
|
||||||
char *new_name = tox_weechat_null_terminate(name, length);
|
char *new_name = tox_weechat_null_terminate(name, length);
|
||||||
|
|
||||||
if (chat && strcmp(old_name, new_name) != 0)
|
if (strcmp(old_name, new_name) != 0)
|
||||||
{
|
{
|
||||||
tox_weechat_chat_queue_refresh(chat);
|
if (chat)
|
||||||
|
{
|
||||||
|
tox_weechat_chat_queue_refresh(chat);
|
||||||
|
|
||||||
weechat_printf(chat->buffer,
|
weechat_printf(chat->buffer,
|
||||||
|
"%s%s is now known as %s",
|
||||||
|
weechat_prefix("network"),
|
||||||
|
old_name, new_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
weechat_printf(identity->buffer,
|
||||||
"%s%s is now known as %s",
|
"%s%s is now known as %s",
|
||||||
weechat_prefix("network"),
|
weechat_prefix("network"),
|
||||||
old_name, new_name);
|
old_name, new_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
weechat_printf(identity->buffer,
|
|
||||||
"%s%s is now known as %s",
|
|
||||||
weechat_prefix("network"),
|
|
||||||
old_name, new_name);
|
|
||||||
|
|
||||||
free(old_name);
|
free(old_name);
|
||||||
free(new_name);
|
free(new_name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user