Make Tox AV features optional.

This commit is contained in:
Håvard Pettersson 2015-09-02 22:35:13 +02:00
parent 7b9f8a48fd
commit 8056298e38

View File

@ -21,7 +21,10 @@
#include <weechat/weechat-plugin.h> #include <weechat/weechat-plugin.h>
#include <tox/tox.h> #include <tox/tox.h>
#include <tox/toxav.h>
#ifdef TOXAV_FOUND
#include <tox/toxav.h>
#endif // TOXAV_FOUND
#include "twc.h" #include "twc.h"
#include "twc-list.h" #include "twc-list.h"
@ -70,20 +73,22 @@ twc_group_chat_invite_join(struct t_twc_group_chat_invite *invite)
int rc; int rc;
switch (invite->group_chat_type) switch (invite->group_chat_type)
{ {
case TOX_GROUPCHAT_TYPE_TEXT: case TOX_GROUPCHAT_TYPE_TEXT:
rc = tox_join_groupchat(invite->profile->tox, rc = tox_join_groupchat(invite->profile->tox,
invite->friend_number, invite->friend_number,
invite->data, invite->data_size); invite->data, invite->data_size);
break; break;
case TOX_GROUPCHAT_TYPE_AV: #ifdef TOXAV_ENABLED
rc = toxav_join_av_groupchat(invite->profile->tox, case TOX_GROUPCHAT_TYPE_AV:
invite->friend_number, rc = toxav_join_av_groupchat(invite->profile->tox,
invite->data, invite->data_size, invite->friend_number,
NULL, NULL); invite->data, invite->data_size,
break; NULL, NULL);
default: break;
rc = -1; #endif
break; default:
rc = -1;
break;
} }
twc_group_chat_invite_remove(invite); twc_group_chat_invite_remove(invite);