Skip to content

[NEW] Allow sounds when conversation is focused#9312

Merged
rodrigok merged 7 commits intoRocketChat:developfrom
t-mullen:develop
Feb 15, 2018
Merged

[NEW] Allow sounds when conversation is focused#9312
rodrigok merged 7 commits intoRocketChat:developfrom
t-mullen:develop

Conversation

@t-mullen
Copy link
Copy Markdown
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
Copy Markdown

CLAassistant commented Jan 2, 2018

CLA assistant check
All committers have signed the CLA.

@t-mullen
Copy link
Copy Markdown
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.

if (audio) {
const $audio = $(`audio#${ audio }`);
return $audio && $audio[0] && $audio.play();
return $audio && $audio[0] && $audio[0].play();
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

Any chance to get this merged?

Copy link
Copy Markdown
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