1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 11:12:42 +01:00

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
This commit is contained in:
epriestley 2017-04-18 09:26:21 -07:00
parent be00264ae7
commit 5d55804e3f
5 changed files with 31 additions and 14 deletions

View file

@ -10,7 +10,7 @@ return array(
'conpherence.pkg.css' => 'a34d59bd', 'conpherence.pkg.css' => 'a34d59bd',
'conpherence.pkg.js' => '5f86c17d', 'conpherence.pkg.js' => '5f86c17d',
'core.pkg.css' => '959330a2', 'core.pkg.css' => '959330a2',
'core.pkg.js' => 'e129dcd4', 'core.pkg.js' => '5363ae35',
'darkconsole.pkg.js' => '1f9a31bc', 'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '90b30783', 'differential.pkg.css' => '90b30783',
'differential.pkg.js' => 'ddfeb49b', 'differential.pkg.js' => 'ddfeb49b',
@ -19,6 +19,7 @@ return array(
'favicon.ico' => '30672e08', 'favicon.ico' => '30672e08',
'maniphest.pkg.css' => '4845691a', 'maniphest.pkg.css' => '4845691a',
'maniphest.pkg.js' => '5ab2753f', 'maniphest.pkg.js' => '5ab2753f',
'rsrc/audio/basic/tap.mp3' => 'fc2fd796',
'rsrc/css/aphront/aphront-bars.css' => '231ac33c', 'rsrc/css/aphront/aphront-bars.css' => '231ac33c',
'rsrc/css/aphront/dark-console.css' => '53798a6d', 'rsrc/css/aphront/dark-console.css' => '53798a6d',
'rsrc/css/aphront/dialog-view.css' => '685c7e2d', 'rsrc/css/aphront/dialog-view.css' => '685c7e2d',
@ -370,7 +371,7 @@ return array(
'rsrc/js/application/calendar/behavior-event-all-day.js' => 'b41537c9', 'rsrc/js/application/calendar/behavior-event-all-day.js' => 'b41537c9',
'rsrc/js/application/calendar/behavior-month-view.js' => 'fe33e256', 'rsrc/js/application/calendar/behavior-month-view.js' => 'fe33e256',
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408', 'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'dd84a70f', 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '311eae46',
'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762', 'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762',
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'aa3bd034', 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'aa3bd034',
'rsrc/js/application/conpherence/behavior-menu.js' => '80dda04a', 'rsrc/js/application/conpherence/behavior-menu.js' => '80dda04a',
@ -560,7 +561,7 @@ return array(
'conpherence-message-pane-css' => '14199428', 'conpherence-message-pane-css' => '14199428',
'conpherence-notification-css' => 'cef0a3fc', 'conpherence-notification-css' => 'cef0a3fc',
'conpherence-participant-pane-css' => '26a3ce56', 'conpherence-participant-pane-css' => '26a3ce56',
'conpherence-thread-manager' => 'dd84a70f', 'conpherence-thread-manager' => '311eae46',
'conpherence-transaction-css' => '85129c68', 'conpherence-transaction-css' => '85129c68',
'd3' => 'a11a5ff2', 'd3' => 'a11a5ff2',
'differential-changeset-view-css' => '41af6d25', 'differential-changeset-view-css' => '41af6d25',
@ -1132,6 +1133,17 @@ return array(
'2ee659ce' => array( '2ee659ce' => array(
'javelin-install', 'javelin-install',
), ),
'311eae46' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-aphlict',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
),
'31420f77' => array( '31420f77' => array(
'javelin-behavior', 'javelin-behavior',
), ),
@ -2095,17 +2107,6 @@ return array(
'javelin-util', 'javelin-util',
'phabricator-shaped-request', 'phabricator-shaped-request',
), ),
'dd84a70f' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-aphlict',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
),
'de2e896f' => array( 'de2e896f' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',
@ -2376,6 +2377,7 @@ return array(
'javelin-behavior-toggle-class', 'javelin-behavior-toggle-class',
'javelin-behavior-lightbox-attachments', 'javelin-behavior-lightbox-attachments',
'phabricator-busy', 'phabricator-busy',
'javelin-sound',
'javelin-aphlict', 'javelin-aphlict',
'phabricator-notification', 'phabricator-notification',
'javelin-behavior-aphlict-listen', 'javelin-behavior-aphlict-listen',

View file

@ -46,6 +46,7 @@ return array(
'javelin-behavior-toggle-class', 'javelin-behavior-toggle-class',
'javelin-behavior-lightbox-attachments', 'javelin-behavior-lightbox-attachments',
'phabricator-busy', 'phabricator-busy',
'javelin-sound',
'javelin-aphlict', 'javelin-aphlict',
'phabricator-notification', 'phabricator-notification',
'javelin-behavior-aphlict-listen', 'javelin-behavior-aphlict-listen',

View file

@ -546,6 +546,9 @@ final class ConpherenceUpdateController
$dropdown_query = id(new AphlictDropdownDataQuery()) $dropdown_query = id(new AphlictDropdownDataQuery())
->setViewer($user); ->setViewer($user);
$dropdown_query->execute(); $dropdown_query->execute();
$receive_sound = celerity_get_resource_uri('/rsrc/audio/basic/tap.mp3');
$content = array( $content = array(
'non_update' => $non_update, 'non_update' => $non_update,
'transactions' => hsprintf('%s', $rendered_transactions), 'transactions' => hsprintf('%s', $rendered_transactions),
@ -559,6 +562,9 @@ final class ConpherenceUpdateController
$dropdown_query->getNotificationData(), $dropdown_query->getNotificationData(),
$dropdown_query->getConpherenceData(), $dropdown_query->getConpherenceData(),
), ),
'sound' => array(
'receive' => $receive_sound,
),
); );
return $content; return $content;

Binary file not shown.

View file

@ -313,6 +313,14 @@ JX.install('ConpherenceThreadManager', {
this._updating.knownID = r.latest_transaction_id; this._updating.knownID = r.latest_transaction_id;
this._latestTransactionID = r.latest_transaction_id; this._latestTransactionID = r.latest_transaction_id;
JX.Leader.broadcast(
'conpherence.message.' + r.latest_transaction_id,
{
type: 'sound',
data: r.sound.receive
});
JX.Stratcom.invoke( JX.Stratcom.invoke(
'conpherence-redraw-aphlict', 'conpherence-redraw-aphlict',
null, null,