autodeaf: modify logic to cause less state chg

i.e. turning deaf on auto-mutes and turning mute automatically
turns off deafen
This commit is contained in:
Scott Hardin 2017-05-21 16:03:19 +02:00
parent f112cca475
commit e0a3a67410
2 changed files with 8 additions and 3 deletions

View File

@ -79,14 +79,18 @@ void mumble::MumbleCommunicator::sendTextMessage(std::string message) {
void mumble::MumbleCommunicator::joinChannel(int channel_id) { void mumble::MumbleCommunicator::joinChannel(int channel_id) {
mum->joinChannel(channel_id); mum->joinChannel(channel_id);
if ( mumbleConf.autodeaf ) { if ( mumbleConf.autodeaf ) {
mum->self_mute(1); //mum->self_mute(1);
mum->self_deaf(1); mum->self_deaf(1);
} }
} }
void mumble::MumbleCommunicator::mutedeaf(int status) { void mumble::MumbleCommunicator::mutedeaf(int status) {
if ( mumbleConf.autodeaf ) { if ( mumbleConf.autodeaf ) {
mum->self_mute(status); if ( status ) {
mum->self_deaf(status); mum->self_deaf(status);
} else {
mum->self_mute(status);
} }
} }
}

View File

@ -145,6 +145,7 @@ namespace sip {
communicator.logger.notice(msgText); communicator.logger.notice(msgText);
communicator.onStateChange(msgText); communicator.onStateChange(msgText);
communicator.onMuteDeafChange(0); communicator.onMuteDeafChange(0);
} else if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { } else if (ci.state == PJSIP_INV_STATE_DISCONNECTED) {
auto &acc = dynamic_cast<_Account &>(account); auto &acc = dynamic_cast<_Account &>(account);