Added TWC_CHECK_GROUP_CHAT macro.

This commit is contained in:
Håvard Pettersson 2014-11-19 06:15:33 +01:00
parent 92859ce6fc
commit e97b1da067

View File

@ -73,6 +73,22 @@ enum TWC_FRIEND_MATCH
return WEECHAT_RC_OK; \ return WEECHAT_RC_OK; \
} }
/**
* Make sure a command is executed in a group chat buffer. If not, warn user
* and abort.
*/
#define TWC_CHECK_GROUP_CHAT(chat) \
if (!chat || 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; \
}
/** /**
* Make sure a profile with the given name exists. If not, warn user and * Make sure a profile with the given name exists. If not, warn user and
* abort. * abort.