Added some debug messages.
This commit is contained in:
parent
bdc0000cce
commit
e11d82b25c
@ -42,6 +42,7 @@ add_library(tox MODULE
|
||||
src/twc-utils.c
|
||||
)
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-DTWC_DEBUG")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra -Wno-unused-parameter")
|
||||
|
||||
target_link_libraries(tox toxcore)
|
||||
|
@ -339,6 +339,14 @@ twc_group_namelist_change_callback(Tox *tox,
|
||||
weechat_nicklist_remove_nick(chat->buffer, nick);
|
||||
weechat_hashtable_remove(chat->nicks, &peer_number);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef TWC_DEBUG
|
||||
weechat_printf(chat->buffer, "warning: could not find nick %s (%d) for %s",
|
||||
name, peer_number,
|
||||
change_type == TOX_CHAT_CHANGE_PEER_DEL ? "deleting" : "updating");
|
||||
#endif // TWC_DEBUG
|
||||
}
|
||||
}
|
||||
|
||||
if (change_type == TOX_CHAT_CHANGE_PEER_ADD
|
||||
@ -354,18 +362,33 @@ twc_group_namelist_change_callback(Tox *tox,
|
||||
{
|
||||
case TOX_CHAT_CHANGE_PEER_NAME:
|
||||
if (prev_name && name)
|
||||
#ifdef TWC_DEBUG
|
||||
weechat_printf(chat->buffer, "%s%s [%d] is now known as %s",
|
||||
weechat_prefix("network"), prev_name, peer_number, name);
|
||||
#else
|
||||
weechat_printf(chat->buffer, "%s%s is now known as %s",
|
||||
weechat_prefix("network"), prev_name, name);
|
||||
#endif // TWC_DEBUG
|
||||
break;
|
||||
case TOX_CHAT_CHANGE_PEER_ADD:
|
||||
if (name)
|
||||
#ifdef TWC_DEBUG
|
||||
weechat_printf(chat->buffer, "%s%s [%d] just joined the group chat",
|
||||
weechat_prefix("join"), name, peer_number);
|
||||
#else
|
||||
weechat_printf(chat->buffer, "%s%s just joined the group chat",
|
||||
weechat_prefix("join"), name);
|
||||
#endif // TWC_DEBUG
|
||||
break;
|
||||
case TOX_CHAT_CHANGE_PEER_DEL:
|
||||
if (prev_name)
|
||||
#ifdef TWC_DEBUG
|
||||
weechat_printf(chat->buffer, "%s%s [%d] just left the group chat",
|
||||
weechat_prefix("quit"), prev_name, peer_number);
|
||||
#else
|
||||
weechat_printf(chat->buffer, "%s%s just left the group chat",
|
||||
weechat_prefix("quit"), prev_name);
|
||||
#endif // TWC_DEBUG
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user