1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 05:56:46 +02:00

Make sure conference audio calls are properly flagged

This fixes a bug causing the conference audio noise animations
and indicators from properly displaying
This commit is contained in:
jfreegman
2021-11-20 10:16:47 -05:00
parent b7002ef3f0
commit 0a708e4a2e
3 changed files with 19 additions and 7 deletions

View File

@ -1334,7 +1334,7 @@ bool toggle_conference_push_to_talk(uint32_t conferencenum, bool enabled)
return true;
}
bool enable_conference_audio(Tox *tox, uint32_t conferencenum)
bool enable_conference_audio(ToxWindow *self, Tox *tox, uint32_t conferencenum)
{
if (!toxav_groupchat_av_enabled(tox, conferencenum)) {
if (toxav_groupchat_enable_av(tox, conferencenum, audio_conference_callback, NULL) != 0) {
@ -1342,10 +1342,16 @@ bool enable_conference_audio(Tox *tox, uint32_t conferencenum)
}
}
return init_conference_audio_input(tox, conferencenum);
bool success = init_conference_audio_input(tox, conferencenum);
if (success) {
self->is_call = true;
}
return success;
}
bool disable_conference_audio(Tox *tox, uint32_t conferencenum)
bool disable_conference_audio(ToxWindow *self, Tox *tox, uint32_t conferencenum)
{
ConferenceChat *chat = &conferences[conferencenum];
@ -1358,7 +1364,13 @@ bool disable_conference_audio(Tox *tox, uint32_t conferencenum)
chat->audio_enabled = false;
}
return toxav_groupchat_disable_av(tox, conferencenum) == 0;
bool success = toxav_groupchat_disable_av(tox, conferencenum) == 0;
if (success) {
self->is_call = false;
}
return success;
}
bool conference_mute_self(uint32_t conferencenum)