Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Allow sounds when conversation is focused #9312

Merged
merged 7 commits into from
Feb 15, 2018

Conversation

t-mullen
Copy link
Contributor

@t-mullen t-mullen commented Jan 2, 2018

@RocketChat/core

Closes #9302

screen shot 2018-01-03 at 1 37 36 pm

Default is "True", so it's opt-in.

Also fixed a bug in accountPreferences.js where changing notification sound was throwing an error instead of playing the preview.

@CLAassistant
Copy link

CLAassistant commented Jan 2, 2018

CLA assistant check
All committers have signed the CLA.

@t-mullen
Copy link
Contributor Author

t-mullen commented Jan 2, 2018

I wasn't sure how you do internationalization, so only English is implemented. Let me know if you need any work on my part to add other languages.

@@ -239,7 +243,7 @@ Template.accountPreferences.events({
}
if (audio) {
const $audio = $(`audio#${ audio }`);
return $audio && $audio[0] && $audio.play();
return $audio && $audio[0] && $audio[0].play();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here was the audio preview bug. It was calling "play" on an array instead of the first HTML5 audio object.

@t-mullen t-mullen changed the title [NEW] Sound on window focus [NEW] Allow sounds when conversation is focused Jan 3, 2018
@@ -42,10 +43,14 @@ Meteor.startup(function() {
KonchatNotification.newMessage(notification.payload.rid);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not clear on why embeds only fire notifications when the room is focused, instead of unfocused. I'm 99% sure this is an existing bug, but I've left it as is for now. (L40-41 above)

@RocketChat RocketChat deleted a comment Jan 3, 2018
@RocketChat RocketChat deleted a comment Jan 3, 2018
@megamaced
Copy link

Any chance to get this merged?

Copy link
Contributor

@graywolf336 graywolf336 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for this!

@graywolf336 graywolf336 added this to the 0.62.0 milestone Feb 2, 2018
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9312 February 15, 2018 14:49 Inactive
@rodrigok rodrigok merged commit 6a292a7 into RocketChat:develop Feb 15, 2018
@rodrigok rodrigok mentioned this pull request Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sound notification when window is focused
6 participants