Richard van der Hoff
732a764ec6
Refactor crypto initialsync handling
...
Pass a store into the Crypto object so that it doesn't need to make assumptions
about the EventEmitter, and use the new metadata on sync events to distinguish
between initialsyncs and normal syncs
2017-02-03 00:33:54 +00:00
Richard van der Hoff
9975786bac
Store the token corresponding to the last device update in localstorage
...
... so that we can, in future, use it when restarting the client.
2017-02-03 00:32:24 +00:00
Richard van der Hoff
89ef4aa6e7
Handle device change notifications from /sync
...
When we get a notification from /sync that a user has updated their device
list, mark the list outdated, and then fire off a device query.
2017-02-03 00:32:16 +00:00
Richard van der Hoff
7e82ac3620
Merge branch 'develop' into rav/rewrite_device_query_logic
2017-02-03 00:12:46 +00:00
Richard van der Hoff
c3440c506c
Address review comments
...
Update some comments, and s/flushNewDeviceRequests/refreshOutdatedDeviceLists/.
2017-02-03 00:10:13 +00:00
Richard van der Hoff
f16ef93cc3
package.json: Add .babelrc to files
...
... in the hope that this will mean it gets included when `npm install`ing
matrix-js-sdk into riot-web, and hence stopping babel picking up riot-web's
.babelrc.
2017-02-02 22:14:24 +00:00
Matthew Hodgson
b6f3fc5466
Merge branch 'develop' into matthew/blacklist-unverified
2017-02-02 22:02:22 +00:00
Richard van der Hoff
6690f59410
Merge pull request #346 from matrix-org/rav/factor_out_devicelist
...
Factor out device list management
2017-02-02 19:40:27 +00:00
Richard van der Hoff
65e08b9633
Fix copyright
2017-02-02 19:39:40 +00:00
Matthew Hodgson
2e916e63f5
Merge pull request #335 from matrix-org/matthew/warn-unknown-devices
...
Support for warning users when unknown devices show up
2017-02-02 18:08:39 +00:00
Kegan Dougal
f531b9fb21
Linting
2017-02-02 17:47:35 +00:00
Kegan Dougal
9581e48bcb
Load/Store account data events
2017-02-02 17:41:49 +00:00
Kegan Dougal
ad9d58ebc2
Persist User objects. Back out everything else.
...
We can reasonable persist User and account data objects. Other
objects get into horrible circular loops. We'll rethink how this
is being done.
2017-02-02 17:25:20 +00:00
Kegan Dougal
896fc5a3f0
Periodically update the database
...
Triggered by /sync responses, rather than timers, but with a minimum
delay time (1m).
2017-02-02 14:54:07 +00:00
Richard van der Hoff
94addb6315
Rewrite the device key query logic
...
Only permit one query per user at a time.
2017-02-02 13:49:43 +00:00
Kegan Dougal
2c6d4c5a5c
Implement deserialize() on all parts of the object graph
2017-02-02 12:38:03 +00:00
Richard van der Hoff
f81d6b6157
Factor out device list management
...
crypto/index.js was getting huge, so move the device list update management out
to a separate file.
This shouldn't have any effect on functionality.
2017-02-02 10:18:30 +00:00
Kegan Dougal
ef17214ae2
Add remaining load functions
2017-02-02 10:18:09 +00:00
Matthew Hodgson
5d544c773d
Merge branch 'develop' into matthew/warn-unknown-devices
2017-02-01 22:35:25 +00:00
Kegan Dougal
721b9df35d
Add deserialize() static functions for User and MatrixEvent
...
The intent here is to make it possible to repopulate User objects from an
IndexedDB object store, which stores things according to the structured-clone
algorithm. We can't just `Object.assign` everything because it would assign
JSON objects to fields which should be classes (eg `MatrixEvent`).
2017-02-01 10:35:55 +00:00
David Baker
526fbfa8f1
Merge pull request #345 from matrix-org/rav/browserify_sourcemaps
...
Enable sourcemaps in browserified distro
2017-02-01 10:14:58 +00:00
Kegan Dougal
0317830b12
Check for a deserialize() function
2017-02-01 09:49:55 +00:00
Kegan Dougal
dfd8c56838
Factor out upsert. Check for serialize() function on inserted objects
2017-02-01 09:42:20 +00:00
Richard van der Hoff
b7e33b237b
Update browserify
...
... to a more recent release, for compatibility with sourceify.
2017-02-01 00:50:22 +00:00
Kegan Dougal
025cb8bd91
Repopulate as User objects, not JSON objects
2017-01-31 17:33:12 +00:00
Kegan Dougal
fa89f2be77
Start loading content from IndexedDB. Add idealised usage example.
2017-01-31 16:53:26 +00:00
Kegan Dougal
bf008a1bee
Fix build and add stub store connect()
2017-01-31 16:33:43 +00:00
Kegan Dougal
8656ad584b
Introduce the concept of IndexedDBStoreBackend
...
So IndexedDBStore can meet the Store interface and we don't need to mess
with the guts of MatrixInMemoryStore.
2017-01-31 16:08:05 +00:00
Kegan Dougal
e316a9a5b3
Merge branch 'develop' into kegan/indexeddb
2017-01-31 15:04:43 +00:00
Richard van der Hoff
7e3a146240
Enable sourcemaps in browserified distro
...
* use sourceify to read the sourcemaps written by babel
* use {browserify, watchify} -d to write sourcemap
* use exorcist to write the sourcemap to a separate file
* add some uglifyjs incantations to read and write sourcefiles
* simples
2017-01-30 19:00:51 +00:00
Richard van der Hoff
2395d2856b
Merge pull request #344 from matrix-org/rav/allow_e2e_options
...
Record all e2e room settings in localstorage
2017-01-30 16:26:23 +00:00
David Baker
34ae473e6f
Merge pull request #340 from matrix-org/rav/allow_olm_with_browserify
...
Make Olm work with browserified js-sdk
2017-01-30 15:05:22 +00:00
Richard van der Hoff
656c54ead9
Record all e2e room settings in localstorage
...
I can't quite remember what the logic behind only recording the algorithm in
localstorage was, but the upshot is that if you try to set any e2e config
options (such as the megolm rotation periods) via the room state, then the
state gets rejected and you can't send any events.
2017-01-30 11:40:09 +00:00
Richard van der Hoff
c6e21c9c5c
Make Olm work with browserified js-sdk
...
We want to avoid distributing olm as part of the js-sdk, so we exclude it from
the browserified build. Previously this meant that you couldn't use olm this
way.
We can do better though: if the web page includes olm.js via a separate script
tag, that will set global.Olm, which we can get browserify to shim in.
2017-01-28 15:35:55 +00:00
Richard van der Hoff
e71e32122c
Merge pull request #339 from matrix-org/rav/no_require_browserify
...
Make browserify a dev dependency
2017-01-26 17:20:47 +00:00
Kegan Dougal
522105a858
First cut
2017-01-26 16:57:59 +00:00
Richard van der Hoff
e3b008e19a
Make browserify a dev dependency
2017-01-26 16:40:19 +00:00
Kegan Dougal
776cfed2b3
Merge branch 'develop' into kegan/indexeddb
2017-01-26 14:29:30 +00:00
Richard van der Hoff
85cf2a3692
Fix lint
2017-01-26 13:29:56 +00:00
Richard van der Hoff
c9b700ef6a
Merge branch 'matthew/warn-unknown-devices' into matthew/blacklist-unverified
2017-01-26 13:25:10 +00:00
Richard van der Hoff
34fde7d16d
Store device 'known' status in session store
2017-01-26 13:15:50 +00:00
Matthew Hodgson
5911c4d2db
don't automatically mark devices as known; require the app to do it
2017-01-25 23:53:51 +01:00
Matthew Hodgson
dfae72e9af
Merge branch 'matthew/warn-unknown-devices' of git+ssh://github.com/matrix-org/matrix-js-sdk into matthew/warn-unknown-devices
2017-01-25 23:35:23 +01:00
Richard van der Hoff
085493d580
Fix tests
2017-01-25 14:59:14 +00:00
Richard van der Hoff
5245c7f2ab
Merge remote-tracking branch 'origin/develop' into matthew/warn-unknown-devices
2017-01-25 11:03:23 +00:00
Richard van der Hoff
4ccd649358
Address my own review comments
2017-01-25 11:02:49 +00:00
Richard van der Hoff
32f42d59b1
Merge pull request #338 from matrix-org/dbkr/brace_style_allow_single_line
...
Allow single line brace-style
2017-01-23 14:54:18 +00:00
David Baker
ca618f2bf2
Allow single line brace-style
...
As we sometimes use (x) => {foo = x;}, especially for react
components, but probably no reason not to allow it generally.
2017-01-23 14:18:09 +00:00
Richard van der Hoff
a0ae0b3922
Merge pull request #333 from matrix-org/dbkr/comma_dangle_function
...
Turn on comma-dangle for function calls
2017-01-23 10:44:56 +00:00
David Baker
a09329949a
Make comma dangle an error
...
& put max warnings back down
2017-01-23 10:18:22 +00:00