Use a macro instead of duplicating code

This commit is contained in:
Håvard Pettersson 2017-05-15 14:44:45 -07:00
parent cd89b6ca9e
commit 9fdf32a497

View File

@ -1041,18 +1041,9 @@ twc_cmd_topic(const void *pointer, void *data, struct t_gui_buffer *buffer,
TOX_ERR_CONFERENCE_TITLE err = TOX_ERR_CONFERENCE_TITLE_OK;
struct t_twc_chat *chat = twc_chat_search_buffer(buffer);
TWC_CHECK_CHAT(chat);
TWC_CHECK_GROUP_CHAT(chat);
TWC_CHECK_PROFILE_LOADED(chat->profile);
if (chat->group_number < 0)
{
weechat_printf(NULL,
"%s%s: command \"%s\" must be executed in a group chat "
"buffer",
weechat_prefix("error"), weechat_plugin->name, argv[0]);
return WEECHAT_RC_OK;
}
char *topic = argv_eol[1];
tox_conference_set_title(chat->profile->tox, chat->group_number,