Commit graph

61 commits

Author SHA1 Message Date
Scott Nonnenberg
6ffbc0ac06 Archive Conversation 2019-03-12 17:44:14 -07:00
Scott Nonnenberg
b3ac1373fa Move left pane entirely to React 2019-03-12 17:44:14 -07:00
Scott Nonnenberg
5933a34a18 Use window.log in browser context, turn on console eslint rule 2018-07-21 14:52:43 -07:00
Scott Nonnenberg
61d8a694b7 Remove temporary test logging 2018-07-12 14:20:49 -07:00
Scott Nonnenberg
ad4387803b New media permission, show dialog when not enabled for voice msg
UI now in separate renderer:
  - the permissions popup
  - settings dialog
  - debug log dialog
  - about window

Couple bug fixes:
  - About Window: Fix 'escape' to close window
  - Remove outdated dist/copy tasks from Gruntfile

Eslintified settings_view.js
2018-07-03 16:04:21 -07:00
Scott Nonnenberg
b1a54c416f Notifications: All calls are debounced except for shutdown clear 2018-05-10 17:27:22 -07:00
Scott Nonnenberg
18a76ffb49 Debounce notifications so we don't orphan them
Creating/destroying notifications too quickly in testing on macOS would
result in them sticking around forever, requiring manual user dismissal.
We want to dismiss them for the user when we close or our window is
activated. So now we debounce() calls to our notifications code.
2018-05-10 17:07:42 -07:00
Daniel Gasienica
d434262540 Remove last notification before creating new one 2018-05-10 17:06:11 -04:00
Daniel Gasienica
3bf8a8966a Notification improvements
- Remove on read, on focus, and on exit.
- Show multi-message notifications like '5 new messages'.
2018-05-10 14:45:56 -04:00
Daniel Gasienica
0121dc7a5a Log notification grouping support 2018-05-04 15:37:46 -04:00
Daniel Gasienica
c2407c8906 Disable notification grouping on Windows 7 2018-05-04 15:37:46 -04:00
Daniel Gasienica
c591c3ca55 Use native notifications on all platforms 2018-05-02 19:58:33 -04:00
Daniel Gasienica
4e6a03a91c Log whether OS supports native notifications 2018-05-02 19:18:34 -04:00
Daniel Gasienica
1f2a2e1d52 Use Notifications.getStatus 2018-05-02 19:18:34 -04:00
Daniel Gasienica
5fe5320760 Rename SETTINGS to SettingNames 2018-05-02 19:18:33 -04:00
Daniel Gasienica
0701768fd7 Declare globals for drawAttention and isFocused 2018-05-02 19:18:33 -04:00
Daniel Gasienica
06e3f09732 ESLint: Add js/notifications 2018-05-02 19:18:33 -04:00
Daniel Gasienica
95321e5d3e Remove Vim mode lines 2018-04-30 16:53:34 -04:00
Daniel Gasienica
1dd87ad197 Format all source code using Prettier 2018-04-30 16:53:34 -04:00
Daniel Gasienica
a76a6098c4 Simplify log statement 2018-03-19 19:27:59 -04:00
Daniel Gasienica
a61f2939fd Make isEnabled an instance variable 2018-03-05 10:29:11 -05:00
Daniel Gasienica
d6ff5af843 🎨 shouldUpdate --> needUpdate 2018-03-05 10:29:11 -05:00
Daniel Gasienica
541e0bfb72 Reduce log noise / size 2018-03-05 10:29:11 -05:00
Daniel Gasienica
a5a4ed7de7 Extract isAudioNotificationEnabled constant 2018-03-05 10:29:11 -05:00
Daniel Gasienica
dc38d40f20 Revert to disabled notification sound on <= Windows 7
We haven’t had the chance to test this using `node-notifier` on Windows 7.
2018-03-05 10:29:11 -05:00
Daniel Gasienica
5a4773fee7 Only play audio notification on supported platforms 2018-03-05 10:29:11 -05:00
Daniel Gasienica
dbc242c37f Improve debug log for notifications 2018-03-05 10:29:11 -05:00
Daniel Gasienica
b5e7882267 Use system notification sounds
Alternatively, there is per-platform support for specific sounds, but that would
require a larger investment:
- macOS: 9420a38fc3 (all-notification-options-with-their-defaults)
- Windows: https://docs.microsoft.com/en-us/previous-versions/windows/apps/hh761492(v=win.10)
2018-03-05 10:29:11 -05:00
Daniel Gasienica
59e59fb754 Remove new message audio notification
Bye, bye, dear Ka-Klunk!
2018-03-05 10:29:11 -05:00
Daniel Gasienica
8a8972f7ac NOTE: Improve i18n pluralization 2018-03-05 10:29:11 -05:00
Daniel Gasienica
a76b1389e6 Extract hasNotifications 2018-03-05 10:29:11 -05:00
Daniel Gasienica
9516d667da Rename enabled --> isEnabled 2018-03-05 10:29:11 -05:00
Daniel Gasienica
a4c52b8d64
Upgrade to Electron 1.8.2 / Node.js 8.2.1 (#2066)
* Upgrade to Electron 1.8.2 / Node.js 8.2.1

* Update CI Node.js versions

* Make `engines` top-level property

This was accidentally included under `build` which is disallowed
by `electron-builder`.

* Refactor notification updates

Allows easier debugging through variable inspection.

* Use `appId` for Application User Model ID

Recommended in:
https://github.com/electron/electron/issues/10864#issuecomment-346229090

* Update `spectron` to 3.8.0

* Bump `electron-builder` based dependencies

* Use `config.extraMetadata` instead of `em`

Prevents `Unknown argument: em` error.

See: https://github.com/electron-userland/electron-builder/issues/2615

* Revert AUMID to be based on `packageJson.name`

In our build artifact `packageJson.build.appId` causes an NPE.
2018-03-02 14:43:03 -05:00
Scott Nonnenberg
cdfdd6b381
Fix notifications: windows -> window, serialize false setting 2017-11-22 14:32:39 -08:00
Scott Nonnenberg
16ad94148a
Introduce library for notifications on downlevel windows (#1812) 2017-11-22 13:50:52 -08:00
Caner Elci
a3fbb9a6aa Fixed drawAttention() position to comply with user's settings (#1612)
This fix is related about issue #1587
window.drawAttention() repositioned to allow complete control over notifications by settings. It now does not draw attention when the notifications are off.
2017-10-30 13:55:36 -07:00
Lilia
0b7543b0f6 Fix audio notifications on linux (#1526)
This partially reverts commit 1b444a5e23.
Because support for system-level notification sound settings is inconsistent
across Win/Linux/OSX, do the simplest thing that will produce consistent
behavior on all platforms: suppress the system sound by always passing the
`silent: true` option, and play our own sound clip (copied from ios).

// FREEBIE
2017-10-03 11:08:14 -07:00
Scott Nonnenberg
10a38297b8 Only show notifications when done with sync (#1507)
This prevents the parade of notifications if a machine wakes up from
sleep. Basically covers situations that the loading screen doesn't
already.

When disabled, notifications will be cached until they are subsequently
re-enabled, at which time all the pending notifications will be summarized.

From the background page, notifications are disabled during connection attempts
until an empty event. This means we can always safely call conversation.notify
to queue a notification for the next batch, dropping some options from message
and conversation model methods.

We've also moved the calls to check window focus and draw attention to the
window, which were previously included in the conversation model, but are now
performed by the Notification system, because the time that the notification is
displayed might be some time after the message is added by the conversation, so
decisions about focus and attention should be made in that moment and not
before.

// FREEBIE
2017-09-29 09:15:28 -07:00
Lilia
1b444a5e23
Make os notifications respect our sound setting (#1445)
This removes our custom notification sound in favor of the system sound, and
ensures that the system sound is disabled if the user unchecks the audio
notification option.

// FREEBIE
2017-09-14 17:03:18 -07:00
lilia
4c5835e0af
Remove remaining call to extension.notification.update 2017-09-14 16:53:45 -07:00
lilia
d85ccbad4f
Remove extension.notification 2017-09-14 16:53:45 -07:00
lilia
bd7f4febaa
Remove dead code
These are all unused, obsolete, or no-op functions at this point.

// FREEBIE
2017-09-14 16:53:45 -07:00
lilia
e65007e297
Tweak default notification content
Change the placeholder content for when notifications are configured for
count-only or sender-only. Remove some options that are no longer
supported.

// FREEBIE
2017-09-14 16:53:43 -07:00
lilia
79872be9f5
Unfurl notifications
Since we no longer have support for list-style notifications, stop
coalescing notifications into batches and just show contents of the last
message received. Also open the window when clicking on a notification
if it has previously been closed.

// FREEBIE
2017-09-14 16:53:43 -07:00
Scott Nonnenberg
601081c1b8
More refactoring to reduce global event dependencies
All Whisper.events listeners are now defined and bound in background.js,
and we no longer need global methods for opening the inbox and
conversation views, as those are handled by AppView or internally by
InboxView.

// FREEBIE
2017-09-14 16:53:41 -07:00
lilia
859d49b3f4
Use relative paths
// FREEBIE
2017-09-14 16:53:34 -07:00
Scott Nonnenberg
d8ce198f55 Fetch conversations once, clean up ConversationController API (#1420)
* Fetch conversations once, clean up ConversationController API

Race conditions around re-fetching have caused some problems recently,
so this removes the need to re-fetch conversations. They are fetched
once or saved once, and that is it. All interaction goes through the
ConversationController, which is the central source of truth.

We have two rules for Conversations:

1. If a conversation is in the ConversationController it doesn't need
   to be fetched, but its initial fetch/save might be in progress. You
   can wait for that fetch/save with conversation.initialPromise.
2. If a conversation is not already in the ConversationController, it's
   not yet in the database. It needs to be added to the
   ConversationController and saved to the database.

FREEBIE

* Remove Conversation.fetch() call in Message.handleDataMessage()

FREEBIE

* ConversationController.API cleanup: Fix two missing spots

FREEBIE
2017-09-01 09:10:41 -07:00
Asa Ayers
bda0430805 Add an option to play audio notifications 2017-02-02 09:00:14 -06:00
lilia
8939c61c7c Log on notification removal
// FREEBIE
2016-08-01 20:19:16 -07:00
lilia
7efdfc95ee Log when updating notifications
// FREEBIE
2016-07-28 18:39:14 -07:00