Commit graph

110 commits

Author SHA1 Message Date
David Baker
a62f6d1094 Make the indexeddb worker script work again
Removed in 939f6d0798
2017-06-21 15:07:25 +01:00
David Baker
e193fa5be5 Make the indexeddb worker script work again
Removed in 939f6d0798
2017-06-21 14:04:43 +01:00
Richard van der Hoff
cd73139af5 Various logging cleanups
* don't just log errors without any context as to where they came from or what
   they mean
 * avoid the use of '%s' and multi-argument console.log because it looks awful
   under karma.
2017-06-20 17:38:02 +01:00
Richard van der Hoff
939f6d0798 Factor createMatrixClient out from MatrixClientPeg
... so that it can be used elsewhere.
2017-06-13 12:46:49 +01:00
Michael Telatynski
464863acd6 remove unused imports
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-02 21:35:55 +01:00
David Baker
b78f654476 Add support for using indexeddb in a webworker 2017-04-06 11:13:39 +01:00
David Baker
9c4614e7ff Update for new IndexedDBStore interface 2017-03-31 14:55:33 +01:00
Kegan Dougal
658c34abf3 Change the name of the database
Full name is now `matrix-js-sdk:riot-web-sync`.
2017-02-21 15:44:57 +00:00
Kegan Dougal
cca266c62c Review comments 2017-02-17 10:43:55 +00:00
Kegan Dougal
c46f282139 Comments 2017-02-10 16:19:39 +00:00
Kegan Dougal
407bcf1bb9 Delete database on logout. DI a SyncAccumulator. Log uncaught errors 2017-02-10 14:22:54 +00:00
Kegan Dougal
300cd962e5 Add glue code to make react-sdk use indexedDB 2017-02-02 14:27:27 +00:00
David Baker
4942f4f35c Typo 2016-09-28 10:17:47 +01:00
David Baker
c7ad9bfdad Add 'getHomeServerName' util to client peg 2016-09-27 19:38:10 +01:00
Matthew Hodgson
4aef352a5c update to use new API based on js-sdk PR input 2016-09-08 22:48:44 +01:00
Matthew Hodgson
27b3f5f6b1 create a global notif timeline set for each client 2016-09-08 03:02:26 +01:00
Richard van der Hoff
df22768f1b Use server-generated deviceId 2016-08-12 07:31:15 +01:00
Richard van der Hoff
e32c325863 Don't use MatrixClientPeg for temporary clients
Get rid of MatrixClientPeg.replaceUsingUrls, and instead create local,
temporary MatrixClients for the unauthed steps; we therefore only use
MatrixClientPeg for logged-in clients.
2016-08-11 16:23:03 +01:00
David Baker
92762eca74 Fix settings resetting on refresh
Don't clear localstorage when replacing the client: we clear it when logging out so this is just redundant, and since we now use replaceClient to unpickle a session from localstorage, this was blowing away all our setting on every refresh.

Also Move all of the localstorage code to Lifecycle (except device ID but this will probably be generated on the server soon anyway). We previously cleared localstorage on logout in Lifecycle so persist the session in Lifecycle.setLoggedIn() to be symmetrical.
2016-08-10 18:04:22 +01:00
Richard van der Hoff
3922f6a1b7 Move rehydration of MatrixClients from MatrixClientPeg to SessionLoader
This means that we don't create a spurious MatrixClient which is thrown away by
the SessionLoader (whilst still ensuring that the rehydrated matrixclient
follows the same code path as matrixclients created at other points in the
session load process).
2016-08-10 11:59:24 +01:00
David Baker
b32a19a0f1 Comments 2016-08-03 17:23:09 +01:00
David Baker
0919e41469 Fix MatrixClientPeg.start()
Move import & use `this`
2016-08-03 16:45:23 +01:00
David Baker
009c768b72 Comma fail 2016-08-03 16:41:22 +01:00
David Baker
9bf45fb556 Add start wrapper in MatrixClientPeg
to handle the opts dictionary
2016-08-03 16:39:47 +01:00
David Baker
d9a7d50a03 Add an interface for MatrixClientCreds
and make MatrixClientPeg functions use it consistently
2016-08-03 10:46:42 +01:00
David Baker
4825ab8fe7 No need to set options in WillStartClient
We can set them any time up to that point
2016-08-03 09:53:02 +01:00
David Baker
40834d188e Don't let pendingEventOrdering be changed 2016-08-02 18:58:18 +01:00
David Baker
db9750a7e3 Call the logout API when we log out
Also try to refactor some of the login/logout code out of MatrixChat and into a separate Lifecycle.js. This still isn't great, but it at least gets some code out of MatrixClient.
2016-08-02 14:04:20 +01:00
David Baker
cbf10bfff6 PR feedback
Reintroduce replaceClient so we're not calling replaceUsingAccessToken without access tokens which is a bit silly.
Fix bug from previous commit (pass isGuest through)
2016-07-25 16:28:28 +01:00
David Baker
587a86441f This may as wel go in createclient 2016-07-25 16:20:03 +01:00
David Baker
ddbac8c73a More refactoring of MatrixClientPeg
Including getting rid of GuestAccess as it was basically doing nothing apart from remembering if we were a guest which may as well be done in the same place we save/restore everything else
2016-07-22 15:47:47 +01:00
David Baker
b7e95b3883 Remove other guestAccess arg 2016-07-22 14:00:23 +01:00
David Baker
ea5e021d8d Refactor MatrixClientPeg
Should be functionally identical
2016-07-21 17:57:55 +01:00
David Baker
46a2c74d71 Merge pull request #358 from matrix-org/rav/device_id_for_register
Set the device_id on pre-login MatrixClient
2016-07-21 13:15:39 +01:00
Richard van der Hoff
e41df245c3 Set the device_id on pre-login MatrixClient
In order that device_id is set when we register a new user (or, for that
matter, when we register as a guest), we need to make sure that device_id is
set on the temporary MatrixClient which is created before the user is logged
in - ie, that created by replaceUsingUrls.

In order to achieve this, I've basically removed the distinction between
replaceUsingAccessToken and replaceUsingUrls. There is a side-effect in that
the temporary MatrixClient now gets an e2e sessionStore, but I don't think that
is a bad thing.
2016-07-20 20:20:10 +01:00
Aviral Dasgupta
769b3f0c2a Merge branch 'develop' into feature-autocomplete 2016-06-17 00:37:39 +05:30
Richard van der Hoff
3e44d7307f Fix eventListener warning
Bump up maxEventListeners on the MatrixClient to shut up the warning about
leaks.
2016-06-16 11:03:09 +01:00
Aviral Dasgupta
4bc8ec3e6d room, user, ddg autocomplete providers (wip) 2016-06-12 17:02:46 +05:30
Matthew Hodgson
893e338917 incorporate keganfeedback 2016-03-12 19:49:54 +00:00
Matthew Hodgson
0bb58dd60c brings back the functionality in login/register/screens that got lost in @kegsay's refactor. specifically:
1) custom HS/IS urls are now persisted in HTML5 local storage.  As a result, all the login components now distinguish between default HS/IS URLs and custom specified ones again. (
2) custom HS/IS urls are synchronised between the instances of ServerConfig found in the Login, Registration and Forgot Password screens.
3) username are persisted over changing homeserver (but not password, to stop accidentally leaking passwords to the wrong server)
4) correctly interpret a blank URL field as meaning the placeholder text
5) when toggling custom URLs on and off, remember what the custom values were, and use the default URLs if custom mode is not engaged

also, guest access now upholds custom HS/IS URLs found in local storage rather than being limited to the server config ()

also adds assorted comments and improved console debug and a few minor cosmetic changes to the login components.

this commit sponsored by VS27...
2016-03-06 14:33:36 -05:00
Kegan Dougal
ef9b4ab1e6 Log when sessions are saved/restored/not found 2016-02-05 13:32:01 +00:00
Richard van der Hoff
a4f4bb9e72 Convert RoomView to using a TimelineWindow
Instead of using the Room's active timeline directly, use a
TimelineWindow. This shouldn't (yet) have much effect, beyond maybe making
scrollback after a gappy sync slightly more efficient.

For now, I have disabled the 'restoreScrollState' functionality. This will be
reinstated once I land the link-to-event code.
2016-01-28 10:53:43 +00:00
Kegan Dougal
c64f36c81b Merge branch 'develop' into kegan/guest-access 2016-01-07 13:21:06 +00:00
Matthew Hodgson
0772f50fab update copyright for 2016 2016-01-07 04:06:52 +00:00
Kegan Dougal
29587ec347 No longer persist guest room IDs. Replace with transient peeked room ID. 2016-01-06 17:33:00 +00:00
Kegan Dougal
d0ec84fe59 Hook up auto-registration as a guest to MatrixChat. 2015-12-04 11:34:50 +00:00
Kegan Dougal
d52b3149d4 Wire GuestAccess to MatrixClientPeg 2015-12-04 10:37:53 +00:00
Kegan Dougal
91ee5f8a42 Add extra arg isGuest to MatrixClientPeg functions. Add GuestAccess class
GuestAccess serves to monitor which rooms are being tracked for guest
purposes
2015-12-02 14:59:37 +00:00
Matthew Hodgson
5fea3c2673 store the custom HS/IS URL in local storage, add some review commentary 2015-11-10 19:10:30 +00:00
David Baker
9fb5702c2f make MatrixClientPeg an actual global too otherwise things go very wierd 2015-09-28 17:46:49 +01:00
David Baker
6cca5f4c05 backport fixes from vector 2015-09-16 13:48:24 +01:00
Mark Haines
b66488a783 Fix syntax 2015-07-20 13:48:40 +01:00
Mark Haines
3f5c220993 Move all the calls to createClient inside the MatrixClientPeg 2015-07-20 13:19:47 +01:00
David Baker
03d048c06f Get as far as requesting a token 2015-07-14 19:39:18 +01:00
David Baker
0c26206b88 Copyright headers (and use strict, while we're at it). 2015-06-23 16:41:25 +01:00
David Baker
971a7c1133 Display the room list 2015-06-12 14:59:33 +01:00
David Baker
ffb0dc78b8 Fixes to login, and change to not use the dispatcher because it's just unnecessary here 2015-06-12 13:45:22 +01:00
David Baker
e28fde7ae1 Save creds to localstorage 2015-06-12 13:12:39 +01:00
David Baker
add78c6e92 Oops: the file modifications for making it log in. 2015-06-11 18:25:29 +01:00
David Baker
c42733ec95 Basic structure of a react SDK and start of an implementation. 2015-06-09 17:40:42 +01:00