Commit Graph

256 Commits (f5b8bccb653c7e30537f3f436ce7ac84eb7b428e)

Author SHA1 Message Date
Travis Ralston 17e332bb48 Import from src/ for the react-sdk and js-sdk
We compile directly for accuracy of sourcemaps.
2019-12-23 20:02:11 -07:00
David Baker 89d622b8b2 Remove the code that calls the origin migrator
This will have done its job now, everyone's had long enough to
install a newer version of Riot and migrate to the new origin.

Laves the code on the backend that handles it for the time being,
as per comment.
2019-12-09 11:57:43 +00:00
Damir Jelić 222fea969d Merge branch 'poljar/seshat-pr' into develop 2019-11-26 18:47:58 +01:00
Michael Telatynski eac6c46d28 Merge branches 'develop' and 't3chguy/remove_bluebird' of https://github.com/vector-im/riot-web into t3chguy/remove_bluebird 2019-11-22 14:00:02 +00:00
Damir Jelić 137bedb3f9 ElectronPlatform: Update the path for the BaseEventIndexManager class. 2019-11-19 13:34:00 +01:00
Damir Jelić 73b302f432 ElectronPlatform: Fix some type annotations. 2019-11-19 13:34:00 +01:00
Damir Jelić 4a25252626 ElectronPlatform: Rename the SeshatIndexerManager. 2019-11-19 13:34:00 +01:00
Damir Jelić dd2c210cfb electron-main: Rework the event index initialization and deletion. 2019-11-14 16:14:48 +01:00
Damir Jelić 7147af8f80 ElectronPlatform: Don't scope the event index per user. 2019-11-14 14:14:59 +01:00
Damir Jelić c3c5756c7a ElectronPlatform: Implement the EventIndexManager for Seshat. 2019-11-13 15:55:07 +01:00
Travis Ralston 71fb2e04a9
fix catch block indentation 2019-11-12 15:14:11 -07:00
Travis Ralston e84861f770 Apparently our eslint rules are different in different layers 2019-11-12 15:04:56 -07:00
Travis Ralston ec9a38c2fe Perform favicon updates twice in Chrome
See diff for why this arcane magic is needed.

Fixes https://github.com/vector-im/riot-web/issues/11347
2019-11-12 15:02:52 -07:00
David Baker 7af68bddea Remove the 'auto hide menu bar' option on Mac
The menu bar is at the top of the screen on Mac so this setting
does absolutely nothing.
2019-11-05 20:31:08 +00:00
Michael Telatynski 10e1d9093e transform-async-to-promises: get rid of bluebird 2019-11-04 12:46:28 +00:00
Michael Telatynski 9820e59559 Merge hide-to-tray-icon with show-tray-icon 2019-10-30 14:32:28 +00:00
Michael Telatynski 1498872214 Add ability to hide tray icon on non-Mac (which has no tray icon) 2019-10-29 11:37:42 +00:00
Damir Jelić 71023ae9df ElectronPlatform: Fix lint errors. 2019-10-11 17:17:24 +02:00
Damir Jelić 1dbdd0a366 ElectronPlatform: Add support for a event index using Seshat. 2019-10-11 16:05:14 +02:00
David Baker 57672ad384 Request persistent storage on Electron
It's still not 100% clear whether storage is always persistent on
Electron, but we seem to be getting reports of it being deleted in
the wild on Electron, so let's try calling the API to request
persistent storage. It won't pop up a dialog on Electron. In the
worst case it will give us some logging so we know what the API calls
return.

We could do this on non-desktop too but it's a bit of a mess because
Firefox prompts the user but Chrome makes a decision itself based on
how much the user visits the site.
2019-10-04 12:17:01 +01:00
Michael Telatynski 509839e79e Allow setting electron autoHideMenuBar and persist it
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-08-05 11:58:16 +01:00
Michael Telatynski 974797648f Move config-getting to VectorBasePlatform
in Electron get config via IPC from main process
which has access to the "local" config.json override file
and can make people happy :D

Remove bunch of duplicated code,
and move comments around to put them in the right place

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-06-26 21:08:04 +01:00
Travis Ralston c5461b4509 Don't try and render null avatars in desktop notifications
as much fun as http://localhost:8080/null is to see
2019-05-30 20:04:16 -06:00
J. Ryan Stinnett d4de7f5df3 Delay creating the `Favico` instance
This avoids a canvas permission prompt from appearing on page load for users in
Firefox's resist fingerprinting mode. The prompt will still happen once you log
in and receive a notification, but at least this prevents it from happening
during the initial app experience.

Fixes https://github.com/vector-im/riot-web/issues/9605
2019-05-02 13:29:25 +01:00
Michael Telatynski 5a3b9ae454 more matching
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-02-24 01:38:21 +00:00
Michael Telatynski 717495c4e0 specify return types to match superclass
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-02-24 01:21:18 +00:00
Michael Telatynski 714570443d Allow configuration of whether closing window closes or minimizes to tray
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-02-24 01:08:01 +00:00
David Baker 0022834af4
Merge pull request #8241 from vector-im/dbkr/fix_platform_name
Fix device names on desktop
2019-01-23 17:15:56 +00:00
David Baker 9aad7042a2 Fix device names on desktop
Apparently I really had a bad day with includes / indexOf
2019-01-23 16:53:50 +00:00
David Baker a5ed5be3cf Fix literal &lt/&gt in notifications
Apparently I couldn't decide whether I was writing indexOf(...) > -1
or .includes()

Fixes https://github.com/vector-im/riot-web/issues/8230
2019-01-23 14:47:31 +00:00
David Baker 751a1dc543 Add tool to migrate logins between origins
App checks at startup for an existing session, if there isn't one,
it will start the tool to check for a login in the file:// origin.
If there is one, it will copy the login over to the vector://vector
origin.

In principle this could also be used to migrate logins between
other origins on the web if this were ever required.

This includes a minified copy of the browserified js-sdk with
a getAllEndToEndSessions() function added to the crypto store
(https://github.com/matrix-org/matrix-js-sdk/pull/812). This is
not great, but for a short-lived tool this seems better than
introducing more entry points into webpack only used for the
electron app.
2018-12-21 19:14:25 +00:00
David Baker 0c428efea0 lint 2018-12-18 18:03:47 +00:00
David Baker 19f1489c92 Run the Desktop app in a sandbox
* Turn off node integration in the electron renderer process
 * Enable the chromium sandbox to put the renderer into its own process
 * Expose just the ipc module with a preload script
 * Introduce a little IPC call wrapper so we can call into the
   renderer process and await on the result.
 * Use this in a bunch of places we previously used direct calls
   to electron modules.
 * Convert other uses of node, eg. use of process to derive the
   platform (just look at the user agent)
 * Strip out the desktopCapturer integration which doesn't appear
   to have ever worked (probably best to just wait until
   getDisplayMedia() is available in chrome at this point:
   https://github.com/vector-im/riot-web/issues/4880).
2018-12-18 17:42:55 +00:00
David Baker 1dfaf70562
Revert "Revert "Run lint on travis builds and use modern node versions"" 2018-11-22 18:25:55 +00:00
David Baker f701e2601a
Revert "Run lint on travis builds and use modern node versions" 2018-11-22 18:17:09 +00:00
Aaron Raimist fe11ae73db
Run lintwithexclusions on travis builds
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-19 20:59:07 -05:00
Aaron Raimist 6abd1de8b8
eslint --fix on src/
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-19 20:59:06 -05:00
David Baker 2854c0969b Don't set tags on notifications
They are to suppress notifications that don't want to be shown in
addition to each other. This makes no sense for our notifications:
they're each for independent messages. Also settings tags on
notifications makes electron crash on windows when you close the
notif, as per https://github.com/vector-im/riot-web/issues/7512
2018-10-18 19:07:59 +01:00
David Baker bb907d49c9 Typo 2018-10-18 18:35:01 +01:00
David Baker 231ca253f2 Stop electron crashing
Workaround temporarily by not closing notifs on win32 as per
comment.

Fixes https://github.com/vector-im/riot-web/issues/7512
2018-10-18 18:31:06 +01:00
Aaron Raimist d035efb14e
Fix lint warnings and turn warnings back on (#7409)
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-05 10:41:45 -05:00
Aaron Raimist 401c85ad5b
Fix Promise.defer warnings in WebPlatform.js (#7409)
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-05 10:23:06 -05:00
Matthew Hodgson d6931252c1 move rageshake to sdk 2018-04-13 01:35:55 +01:00
Matthew Hodgson 3d20a64502 export enum via method for convenience from matrix-react-sdk 2018-04-13 01:25:00 +01:00
Matthew Hodgson aa54032500 force refresh when updating the app 2018-03-09 01:45:44 +00:00
Robert Swain f79b8e0c71 ElectronPlatform: Import desktopCapturer explicitly 2017-09-25 17:19:04 +02:00
Robert Swain e8424d71db ElectronPlatform.js: Add Jitsi screensharing support 2017-09-04 09:33:08 +02:00
Richard van der Hoff d5b550f89a replace q method calls with bluebird ones
```
find src test -name '*.js' |
    xargs perl -i -pe 's/q\.(all|defer|reject|delay|try|isFulfilled)\(/Promise.$1(/'
```
2017-07-13 00:50:01 +01:00
Richard van der Hoff b29b4a959b q(...) -> Promise.resolve
```
find src test -name '*.js' | xargs perl -i -pe 's/\b[qQ]\(/Promise.resolve(/'
```
2017-07-13 00:50:01 +01:00
Richard van der Hoff 10decf95f6 replace imports of `q` with bluebird
update `package.json`

```
find src test -name '*.js' |
    xargs perl -i -pe 'if (/require\(.[qQ].\)/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'

find src test -name '*.js' |
    xargs perl -i -pe 'if (/import [qQ] /) { $_ = "import Promise from '\''bluebird'\'';\n"; }'
```
2017-07-13 00:48:31 +01:00
Richard van der Hoff cc56ef3abd Attempt to flush the rageshake logs on close
... so that we get to see what happened in the last 30s.
2017-06-22 18:25:19 +01:00
Michael Telatynski 89533706a8 pollForUpdate is now internal/private to a Platform.
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-11 23:39:21 +01:00
Michael Telatynski deb7ed660c Merge branch 'develop' of github.com:vector-im/riot-web into t3chguy/updating_stuff 2017-06-11 23:13:49 +01:00
Michael Telatynski a520f0bfed move all logic, make bar more generic
pass through actual errors
and tidy
needs testing

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-11 19:19:17 +01:00
Kegsay 4cec4f066d Fix #4191: add defaults to avoid throwing (#4195) 2017-06-06 12:38:06 +01:00
Michael Telatynski 93f148fca3 fix type electron vs remote
don't break when running a non Squirrel Windows build that has an update url

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-03 16:34:15 +01:00
Michael Telatynski 3ebd90565c add clearer concept of timeout vs error
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

(cherry picked from commit 104c804)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-03 15:59:27 +01:00
Michael Telatynski b95ad701af match ENUM style to others in project
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

(cherry picked from commit a871815)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-03 15:59:18 +01:00
Michael Telatynski efc68c078e basic manual update stuff + update check bar
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-03 15:59:12 +01:00
Michael Telatynski 0e6012ad45 absorb updater.js into the Platforms, gets rid of pointless setInterval in Electron
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

(cherry picked from commit 24e8a30)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-03 15:58:54 +01:00
Matthew Hodgson bac5ae89ce Merge pull request #4119 from vector-im/kegan/translation-chimp
Translate src/vector
2017-06-01 00:34:45 +01:00
Michael Telatynski 33ee42f821 use loudNotification for flashFrame, resetting on count=0 or focus
win32 check is optional just there so we're not attaching pointless handlers

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-01 00:00:00 +01:00
Kegan Dougal 7dc55a9a47 Import correctly 2017-05-31 17:53:32 +01:00
Kegan Dougal 52ddcd8a60 Translate src/vector/platform 2017-05-31 14:51:08 +01:00
Matthew Hodgson 448c10736a Merge pull request #4012 from vector-im/t3chguy/electron_settings
auto-launch support [Electron]
2017-05-30 23:59:15 +01:00
Michael Telatynski 1d2bd68200 Merge branch 'develop' of github.com:vector-im/riot-web into t3chguy/electron_settings 2017-05-29 22:12:06 +01:00
Michael Telatynski b9ec25b32f add flow annotation
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-29 20:03:21 +01:00
Michael Telatynski e991461e8d add new BasePlatform method, Analytics fun on the Webpack train
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-29 19:51:28 +01:00
Michael Telatynski a98792b05e auto-launch support, ux =checkbox in UserSettings[Electron]
settings are sorta generic, probably reusable for proxy settings

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-24 15:52:08 +01:00
Michael Telatynski c63e429c76 Merge branch 'develop' of github.com:vector-im/riot-web into t3chguy/electron_call_sleep 2017-05-24 10:56:36 +01:00
Michael Telatynski f57d8e4cb9 make ESLint a touch happier
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-22 18:31:30 +01:00
Michael Telatynski 755c66b9f1 pass dispatcher through to electron, on a whitelist basis
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-22 18:30:45 +01:00
David Baker dc990f47be Fix app breakage with a 'version' file
Re-add accidenally removed variable initialiser
2017-05-19 17:02:48 +01:00
Michael Telatynski 9352e5d78e Lets make it abundantly clear that we want attention. FLASH FLASH FLASH
also improve favicon updating to not change if we're same as previous
not sure how intensive the nativeImage stuff is but cheap efficiency

For FLASH FLASH I moved the setBadgeCount stuff RPC -> IPC
should be more reliable now, its in electron-main
Win only:
if mainWindow is set and is not in focus make it FLASH
clear flash if notification gets cleared elsewhere
debounce focus handler so we don't set a million of them
if the app is backgrounded a while

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-17 10:39:43 +01:00
Michael Telatynski bbda658b7f make Electron tray icon mimic the Favico.js one
DRY: moved Favicon stuff into the base platform

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-13 12:37:13 +01:00
Michael Telatynski 6367344181 tidy and fix flow notation
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-02 21:32:34 +01:00
Michael Telatynski b3c9229aee DRY code and change double quotes to single
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-04-23 09:59:00 +01:00
Michael Telatynski 2139fb74bb change show logic to same as that of the tray icon
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-04-23 09:56:43 +01:00
Matthew Hodgson 4864716abb Merge pull request #3564 from t3chguy/t3chguy/malformed-notifications-gnome-kde
Escape HTML Tags from Linux Notifications (electron)
2017-04-22 16:45:04 +01:00
Michael Telatynski 0da6ca8aea add more comment to explain this weirdness
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-04-22 16:05:08 +01:00
David Baker 7f6d9a625d Make the clear cache button work on desktop
Implement reload in Platforms to support
https://github.com/matrix-org/matrix-react-sdk/pull/798

Fixes https://github.com/vector-im/riot-web/issues/3597
2017-04-10 17:40:09 +01:00
Michael Telatynski 99923b7b8f Escape HTML tags in Notifications (Linux)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-04-03 20:30:05 +01:00
David Baker 7850f7e505 Fix badge spam: attempt 2 (#3073) 2017-01-26 12:58:29 +00:00
Richard van der Hoff f29e0bfe6d Revert "Merge pull request #3067 from vector-im/matthew/fix-badge-spam"
This reverts commit f9db7f017d, reversing
changes made to 71b149de76.

This caused `number is not defined`
2017-01-26 12:16:44 +00:00
Matthew Hodgson 9797c2fb4b fix electron too 2017-01-26 00:31:52 +01:00
Matthew Hodgson 972a391296 only recalculate favicon if it changes 2017-01-26 00:28:22 +01:00
David Baker bee4ca2b28 Fixes to electron desktop notifs
Merge the notification part of https://github.com/vector-im/riot-web/pull/2960

 * Show and focus the window when the notification is clicked,
   rather than just restoring it.
 * Implement requestNotificationPermission and return a resolved
   promise (although in practice it should never be called)
2017-01-19 13:25:56 +00:00
David Baker c5459a2f19 Enable screen sharing easter-egg in desktop app 2017-01-10 18:39:21 +00:00
Hubert Chathi ad79f67ab6 Add missing brackets to call to toUpperCase 2016-12-06 22:36:42 -05:00
David Baker 5fa0f62ccc Fix clicking on notifications
* Dismiss the notification when it's clicked
 * Accept the room object: we need it to view_room
 * Desktop app: Un-minimise when notification clicked
 * Desktop App: Set App User Model ID so notifications work on
   Windows 8!
2016-12-06 13:28:59 +00:00
David Baker c786980454 Move getDefaultDeviceName into the Platforms
So we can have a sensible device name on Electron
2016-11-24 16:46:15 +00:00
Richard van der Hoff 646608bf8b Add a cachebuster to /version 2016-11-17 17:31:31 +00:00
David Baker 8d46077ac2 Support for get_app_version 2016-11-08 10:47:01 +00:00
David Baker 9a00ec128c many semicolons 2016-11-04 10:46:51 +00:00
David Baker ed9c29d365 Use require so we can import conditionally 2016-11-03 15:45:12 +00:00
David Baker fb3ca441ba Merge remote-tracking branch 'origin/develop' into dbkr/electron_3 2016-11-03 13:32:01 +00:00
David Baker f1b72dfa09 Fix copyright 2016-11-03 11:51:41 +00:00
David Baker 4d0b492ba0 Merge remote-tracking branch 'origin/develop' into dbkr/platform_version 2016-11-03 11:51:23 +00:00
David Baker 3bcb447e03 Fix copyright 2016-11-03 11:48:49 +00:00
David Baker 275a55266b Merge remote-tracking branch 'origin/develop' into dbkr/electron_3 2016-11-02 19:46:02 +00:00
David Baker 6aba9f8eda Don't always claim we have notif support
Only if the browser has the Notification API
2016-11-02 19:26:07 +00:00
David Baker caa3cb7d89 Electron support
From https://github.com/vector-im/vector-web/pull/2511 but with
just the actual electron changes
2016-11-02 18:49:28 +00:00
David Baker 17bb47676e Make VectorBasePlatform
For template methods that are only used from within vector (ie. new version
support)
2016-11-02 17:45:35 +00:00
David Baker 757604fd60 Add Notification support to the Web Platform
Except display notification which was already accidentally included in a
previous PR
2016-11-02 17:36:48 +00:00
David Baker 64fdb290eb Move 'new version' support into Platform 2016-11-02 16:02:55 +00:00
David Baker a714edbf2b Implement Platforms
Provide WebPlatform for functionality specific to the web version of vector.
2016-11-02 15:12:51 +00:00