Skip to content

Commit 5d55804

Browse files
author
epriestley
committed
Play a sound when receiving a new chat message
Summary: Ref T7567. Nothing fancy yet, just getting this working. Sound is lightly edited version of "Pop 6": https://www.freesound.org/people/greenvwbeetle/sounds/244656/ Test Plan: Sent chat, heard sounds. Reviewers: chad Reviewed By: chad Maniphest Tasks: T7567 Differential Revision: https://secure.phabricator.com/D17721
1 parent be00264 commit 5d55804

File tree

5 files changed

+31
-14
lines changed

5 files changed

+31
-14
lines changed

resources/celerity/map.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'conpherence.pkg.css' => 'a34d59bd',
1111
'conpherence.pkg.js' => '5f86c17d',
1212
'core.pkg.css' => '959330a2',
13-
'core.pkg.js' => 'e129dcd4',
13+
'core.pkg.js' => '5363ae35',
1414
'darkconsole.pkg.js' => '1f9a31bc',
1515
'differential.pkg.css' => '90b30783',
1616
'differential.pkg.js' => 'ddfeb49b',
@@ -19,6 +19,7 @@
1919
'favicon.ico' => '30672e08',
2020
'maniphest.pkg.css' => '4845691a',
2121
'maniphest.pkg.js' => '5ab2753f',
22+
'rsrc/audio/basic/tap.mp3' => 'fc2fd796',
2223
'rsrc/css/aphront/aphront-bars.css' => '231ac33c',
2324
'rsrc/css/aphront/dark-console.css' => '53798a6d',
2425
'rsrc/css/aphront/dialog-view.css' => '685c7e2d',
@@ -370,7 +371,7 @@
370371
'rsrc/js/application/calendar/behavior-event-all-day.js' => 'b41537c9',
371372
'rsrc/js/application/calendar/behavior-month-view.js' => 'fe33e256',
372373
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
373-
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'dd84a70f',
374+
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '311eae46',
374375
'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762',
375376
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'aa3bd034',
376377
'rsrc/js/application/conpherence/behavior-menu.js' => '80dda04a',
@@ -560,7 +561,7 @@
560561
'conpherence-message-pane-css' => '14199428',
561562
'conpherence-notification-css' => 'cef0a3fc',
562563
'conpherence-participant-pane-css' => '26a3ce56',
563-
'conpherence-thread-manager' => 'dd84a70f',
564+
'conpherence-thread-manager' => '311eae46',
564565
'conpherence-transaction-css' => '85129c68',
565566
'd3' => 'a11a5ff2',
566567
'differential-changeset-view-css' => '41af6d25',
@@ -1132,6 +1133,17 @@
11321133
'2ee659ce' => array(
11331134
'javelin-install',
11341135
),
1136+
'311eae46' => array(
1137+
'javelin-dom',
1138+
'javelin-util',
1139+
'javelin-stratcom',
1140+
'javelin-install',
1141+
'javelin-aphlict',
1142+
'javelin-workflow',
1143+
'javelin-router',
1144+
'javelin-behavior-device',
1145+
'javelin-vector',
1146+
),
11351147
'31420f77' => array(
11361148
'javelin-behavior',
11371149
),
@@ -2095,17 +2107,6 @@
20952107
'javelin-util',
20962108
'phabricator-shaped-request',
20972109
),
2098-
'dd84a70f' => array(
2099-
'javelin-dom',
2100-
'javelin-util',
2101-
'javelin-stratcom',
2102-
'javelin-install',
2103-
'javelin-aphlict',
2104-
'javelin-workflow',
2105-
'javelin-router',
2106-
'javelin-behavior-device',
2107-
'javelin-vector',
2108-
),
21092110
'de2e896f' => array(
21102111
'javelin-behavior',
21112112
'javelin-dom',
@@ -2376,6 +2377,7 @@
23762377
'javelin-behavior-toggle-class',
23772378
'javelin-behavior-lightbox-attachments',
23782379
'phabricator-busy',
2380+
'javelin-sound',
23792381
'javelin-aphlict',
23802382
'phabricator-notification',
23812383
'javelin-behavior-aphlict-listen',

resources/celerity/packages.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
'javelin-behavior-toggle-class',
4747
'javelin-behavior-lightbox-attachments',
4848
'phabricator-busy',
49+
'javelin-sound',
4950
'javelin-aphlict',
5051
'phabricator-notification',
5152
'javelin-behavior-aphlict-listen',

src/applications/conpherence/controller/ConpherenceUpdateController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ private function loadAndRenderUpdates(
546546
$dropdown_query = id(new AphlictDropdownDataQuery())
547547
->setViewer($user);
548548
$dropdown_query->execute();
549+
550+
$receive_sound = celerity_get_resource_uri('/rsrc/audio/basic/tap.mp3');
551+
549552
$content = array(
550553
'non_update' => $non_update,
551554
'transactions' => hsprintf('%s', $rendered_transactions),
@@ -559,6 +562,9 @@ private function loadAndRenderUpdates(
559562
$dropdown_query->getNotificationData(),
560563
$dropdown_query->getConpherenceData(),
561564
),
565+
'sound' => array(
566+
'receive' => $receive_sound,
567+
),
562568
);
563569

564570
return $content;

webroot/rsrc/audio/basic/tap.mp3

1.53 KB
Binary file not shown.

webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,14 @@ JX.install('ConpherenceThreadManager', {
313313

314314
this._updating.knownID = r.latest_transaction_id;
315315
this._latestTransactionID = r.latest_transaction_id;
316+
317+
JX.Leader.broadcast(
318+
'conpherence.message.' + r.latest_transaction_id,
319+
{
320+
type: 'sound',
321+
data: r.sound.receive
322+
});
323+
316324
JX.Stratcom.invoke(
317325
'conpherence-redraw-aphlict',
318326
null,

0 commit comments

Comments
 (0)