Merge pull request #15482 from amantley/bugAwayAudioToggle

Fixed: turning on your microphone will now take you out of Away mode
This commit is contained in:
Anthony Thibault 2019-05-01 12:44:13 -07:00 committed by GitHub
commit 4821e745cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -223,8 +223,8 @@ function setAwayProperties() {
function setActiveProperties() {
isAway = false;
if (!wasMuted) {
Audio.muted = !Audio.muted;
if (Audio.muted && !wasMuted) {
Audio.muted = false;
}
MyAvatar.setEnableMeshVisible(true); // IWBNI we respected Developer->Avatar->Draw Mesh setting.
stopAwayAnimation();
@ -314,6 +314,13 @@ function setEnabled(value) {
isEnabled = value;
}
function checkAudioToggled() {
if (isAway && !Audio.muted) {
goActive();
}
}
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
var handleMessage = function(channel, message, sender) {
if (channel === CHANNEL_AWAY_ENABLE && sender === MyAvatar.sessionUUID) {
@ -327,6 +334,7 @@ Messages.messageReceived.connect(handleMessage);
var maybeIntervalTimer = Script.setInterval(function() {
maybeMoveOverlay();
maybeGoAway();
checkAudioToggled();
}, BASIC_TIMER_INTERVAL);