Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
3aaa8df4
Commit
3aaa8df4
authored
Sep 03, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notification sound now also plays when nickname is mentioned in chat room.
updates #62
parent
01ba7361
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
14 deletions
+24
-14
converse.js
converse.js
+18
-14
css/converse.css
css/converse.css
+1
-0
docs/CHANGES.rst
docs/CHANGES.rst
+1
-0
docs/source/index.rst
docs/source/index.rst
+3
-0
less/converse.less
less/converse.less
+1
-0
No files found.
converse.js
View file @
3aaa8df4
...
...
@@ -32,6 +32,7 @@
console
=
{
log
:
function
()
{},
error
:
function
()
{}
};
}
// TODO: these non-backbone methods should all be moved to utils.
$
.
fn
.
addHyperlinks
=
function
()
{
if
(
this
.
length
>
0
)
{
this
.
each
(
function
(
i
,
obj
)
{
...
...
@@ -71,6 +72,19 @@
};
};
var
playNotification
=
function
()
{
var
audio
;
if
(
converse
.
play_sounds
&&
typeof
Audio
!==
"
undefined
"
){
audio
=
new
Audio
(
"
sounds/msg_received.ogg
"
);
if
(
audio
.
canPlayType
(
'
/audio/ogg
'
))
{
audio
.
play
();
}
else
{
audio
=
new
Audio
(
"
/sounds/msg_received.mp3
"
);
audio
.
play
();
}
}
};
$
.
fn
.
addEmoticons
=
function
()
{
if
(
converse
.
visible_toolbar_buttons
.
emoticons
)
{
if
(
this
.
length
>
0
)
{
...
...
@@ -2438,6 +2452,9 @@
}
if
(
!
body
)
{
return
true
;
}
var
display_sender
=
sender
===
this
.
model
.
get
(
'
nick
'
)
&&
'
me
'
||
'
room
'
;
if
(
!
delayed
&&
display_sender
===
'
room
'
&&
(
new
RegExp
(
"
\\
b
"
+
this
.
model
.
get
(
'
nick
'
)
+
"
\\
b
"
)).
test
(
body
))
{
playNotification
();
}
this
.
showMessage
({
'
message
'
:
body
,
'
sender
'
:
display_sender
,
...
...
@@ -2517,19 +2534,6 @@
});
},
playNotification
:
function
()
{
var
audio
;
if
(
converse
.
play_sounds
&&
typeof
Audio
!==
"
undefined
"
){
audio
=
new
Audio
(
"
sounds/msg_received.ogg
"
);
if
(
audio
.
canPlayType
(
'
/audio/ogg
'
))
{
audio
.
play
();
}
else
{
audio
=
new
Audio
(
"
/sounds/msg_received.mp3
"
);
audio
.
play
();
}
}
},
isOnlyChatStateNotification
:
function
(
$msg
)
{
// See XEP-0085 Chat State Notification
return
(
...
...
@@ -2627,7 +2631,7 @@
});
}
if
(
!
this
.
isOnlyChatStateNotification
(
$message
)
&&
from
!==
converse
.
bare_jid
)
{
this
.
playNotification
();
playNotification
();
}
chatbox
.
receiveMessage
(
$message
);
converse
.
roster
.
addResource
(
buddy_jid
,
resource
);
...
...
css/converse.css
View file @
3aaa8df4
...
...
@@ -1199,6 +1199,7 @@ select#select-xmpp-status {
border-top-left-radius
:
0
;
border-top-right-radius
:
0
;
width
:
200px
;
height
:
84px
;
}
#conversejs
.chatroom
form
.sendXMPPMessage
{
-webkit-border-bottom-right-radius
:
0
;
...
...
docs/CHANGES.rst
View file @
3aaa8df4
...
...
@@ -7,6 +7,7 @@ Changelog
* Converse.js now responds to XEP-0030: Service Discovery requests. [jcbrand]
* Bugfix. Roster groups all appear offline after page reload (with prebind).
See http://librelist.com/browser//conversejs/2014/8/26/problem-with-contact-list-everyone-is-offline/ [heban and jcbrand]
* #62 Sound notifications will now also play when you are mentioned in a chat room. [jcbrand]
* #212 Bugfix. Groups weren't being show again after the live filter was cleared. [jcbrand]
* #215 (and also #75) XEP-0249: Direct MUC Invitations. [jcbrand]
* #216 Contacts tab empty when using xhr_user_search. [hcderaad and jcbrand]
...
...
docs/source/index.rst
View file @
3aaa8df4
...
...
@@ -975,6 +975,9 @@ play_sounds
Default: ``false``
Plays a notification sound when you receive a personal message or when your
nickname is mentioned in a chat room.
Inside the ``./sounds`` directory of the Converse.js repo, you'll see MP3 and Ogg
formatted sound files. We need both, because neither format is supported by all browsers.
...
...
less/converse.less
View file @
3aaa8df4
...
...
@@ -1356,6 +1356,7 @@ select#select-xmpp-status {
border-top-left-radius: 0;
border-top-right-radius: 0;
width: 200px;
height: 84px;
}
#conversejs .chatroom form.sendXMPPMessage {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment