Prevent redundant name change messages.

This commit is contained in:
Håvard Pettersson 2014-09-18 19:54:05 +02:00
parent 3db78a5c16
commit 1bd4d6b02b

View File

@ -135,7 +135,9 @@ 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)
{
if (chat)
{ {
tox_weechat_chat_queue_refresh(chat); tox_weechat_chat_queue_refresh(chat);
@ -149,6 +151,7 @@ tox_weechat_name_change_callback(Tox *tox,
"%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);
}
free(old_name); free(old_name);
free(new_name); free(new_name);