Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Implement notifications for all messages
Browse files Browse the repository at this point in the history
Implement option to get notifications also for message not just for mentions

Resolves: #446
  • Loading branch information
nicolashohm committed Nov 14, 2015
1 parent 62f56fe commit 1c6945d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
==========

* Implement option to get notifications also for messages not just for mentions

0.51.2 / 2015-09-18
==================

Expand Down
7 changes: 7 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ <h2>Notifications</h2>
<button id="play">Play sound</button>
</div>
</div>

<div class="col-sm-12">
<label class="opt">
<input type="checkbox" name="notifyMessage">
Enable notification for all messages
</label>
</div>
<div class="col-sm-12">
<h2>About Shout</h2>
</div>
Expand Down
7 changes: 5 additions & 2 deletions client/js/shout.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ $(function() {
part: true,
thumbnails: true,
quit: true,
notifyMessage: false,
}, $.cookie("settings"));

for (var i in options) {
Expand All @@ -372,6 +373,7 @@ $(function() {
"nick",
"part",
"quit",
"notifyMessage",
].indexOf(name) !== -1) {
chat.toggleClass("hide-" + name, !self.prop("checked"));
}
Expand Down Expand Up @@ -573,9 +575,10 @@ $(function() {
var isQuery = button.hasClass("query");
var type = msg.type;
var highlight = type.contains("highlight");
if (highlight || isQuery) {
var message = type.contains("message");
var settings = $.cookie("settings") || {};
if (highlight || isQuery || (settings.notifyMessage && message)) {
if (!document.hasFocus() || !$(target).hasClass("active")) {
var settings = $.cookie("settings") || {};
if (settings.notification) {
pop.play();
}
Expand Down

0 comments on commit 1c6945d

Please sign in to comment.