Kegan Dougal
5cf29ae1b1
Make RoomMember set its own properties, not RoomState.
...
Also make it clear which methods may fire events off using @fires. This
shifts a lot of RoomState logic to RoomMember.
2015-06-10 17:06:28 +01:00
Kegan Dougal
b2620507fa
Remove startClient(callback); Emit 'syncError' and 'event'.
...
'syncError' event is intended to be used to update the UI to say "connection
lost". Add UTs for 'event' emissions.
2015-06-10 16:19:38 +01:00
Kegan Dougal
583e71180b
Add JSDoc for all the events which the SDK will emit.
2015-06-10 14:42:40 +01:00
Kegan Dougal
d2fcdd4556
Add jsdoc for EventEmitter.
2015-06-10 13:02:32 +01:00
Kegan Dougal
35f269ea52
Make internal MatrixClient methods actually internal.
2015-06-10 11:14:34 +01:00
Kegan Dougal
d64382cd4f
Make MatrixClient inherit from EventEmitter. Add jsdoc to all functions.
2015-06-10 11:01:29 +01:00
Kegan Dougal
f9f8816b7d
Return '?' instead of 'Unknown' for rooms which names cannot be calculated.
...
This makes it easier to localise in the future (if name == '?'), whilst
still indicating an unknown name. Ideally we would be returning null, but
this would require null checks every time the room name was accessed, which
isn't ideal. This also makes the UT for this less brittle (rather than
comparing literal english strings which are prone to breakage when we
inevitably change 'Unknown' to 'unknown' or something else.
2015-06-10 09:44:53 +01:00
Kegan Dougal
44e3b55975
Appease linters.
2015-06-09 17:06:40 +01:00
Kegan Dougal
4ff6ecd58c
Add room name UTs and add self-chat room name.
2015-06-09 17:05:56 +01:00
Kegan Dougal
fd2bd4784d
Fix linters
2015-06-09 16:08:14 +01:00
Kegan Dougal
13462ad1aa
Add more Room and RoomState unit tests.
2015-06-09 16:07:44 +01:00
Kegan Dougal
a0bd25a6d2
Handle power levels and update RoomMember properties.
...
Add unit tests for RoomState.
2015-06-09 15:23:04 +01:00
Kegan Dougal
327a1674aa
Add missing user field to RoomMember.
2015-06-09 11:25:10 +01:00
Kegan Dougal
f086bcca4c
Add User class. Convert store to store/get User objects.
2015-06-09 10:55:26 +01:00
Kegan Dougal
2fb68cfed2
Handle m.typing events.
2015-06-09 10:27:37 +01:00
Kegsay
7d2dc07c3f
Remove lying info.
2015-06-08 17:48:59 +01:00
Kegan Dougal
8d2f058d3d
Appease linters
2015-06-08 17:31:53 +01:00
Kegan Dougal
a43447b00e
Add tests to exercise room name / timeline logic; fix some bugs as a result.
2015-06-08 17:27:10 +01:00
Kegan Dougal
2d00998b61
Move getFriendlyRoomName to Room. Add recalculate() function to cache info.
2015-06-08 16:10:23 +01:00
Kegan Dougal
9fa7fa0487
Shuffle around how events are stored.
...
Rather than having MatrixInMemoryStore do it all, we make the right object do
the right thing, and keep the store for storing said objects.
2015-06-08 15:43:18 +01:00
Kegan Dougal
c73881f3fe
Use utils.keys rather than Object.keys for older browsers.
2015-06-08 12:22:23 +01:00
Kegan Dougal
a2257aeb0b
Move getFriendlyDisplayName to RoomMember class. Add more utlity functions.
2015-06-08 12:21:23 +01:00
Kegan Dougal
7ce3a781f3
Add Room, RoomState and RoomMember classes.
2015-06-08 11:47:15 +01:00
Kegan Dougal
e48eb5a9ed
Use the right glob expression
2015-06-08 10:53:31 +01:00
Kegan Dougal
86ca88a71d
Tweak coverage include fileset to not include spec files.
2015-06-08 10:50:58 +01:00
Kegan Dougal
65453f8359
Update browser readme; ignore jsdoc/coverage folders.
2015-06-08 10:43:00 +01:00
Kegan Dougal
5013a3bd3d
Add lint command
2015-06-08 10:38:34 +01:00
Kegsay
9df62b89ca
Add info on running tests/linters
2015-06-08 10:38:17 +01:00
Kegan Dougal
8d8efd037b
Appease linters.
2015-06-08 10:32:20 +01:00
Kegan Dougal
fd8a754ef7
Add code coverage.
2015-06-08 10:29:07 +01:00
Kegan Dougal
c4aeac31c1
Fix tests; add logs and use promises when flushing.
2015-06-08 10:17:24 +01:00
Kegsay
4ccb6a026a
Merge pull request #7 from matrix-org/testing-setup
...
Testing setup
2015-06-08 09:49:38 +01:00
Kegan Dougal
9ee386db88
Merge branch 'develop' into testing-setup
...
Conflicts:
package.json
2015-06-08 09:49:15 +01:00
Kegsay
6f2930cadb
Merge pull request #6 from matrix-org/arch-changes
...
Architecture changes
2015-06-08 09:43:11 +01:00
Kegan Dougal
bf1a9f83e6
Appease closure linter.
2015-06-05 17:45:56 +01:00
Kegan Dougal
be6ab91ab5
Add docs for mock-request.HttpBackend to make it less magical.
2015-06-05 17:42:49 +01:00
Kegan Dougal
3d90942e9b
Appease jshint
2015-06-05 17:36:15 +01:00
Kegan Dougal
0d25fbcbe7
Add MatrixClient.startClient tests using Jasmine.
2015-06-05 17:32:50 +01:00
Kegan Dougal
6f4b600c0b
Appease closure linter.
2015-06-05 14:54:06 +01:00
Kegan Dougal
735eefcb6d
Bug fixes in data store.
2015-06-05 14:51:10 +01:00
Kegan Dougal
f27c7f203d
Document the deal with the request function.
2015-06-05 14:29:25 +01:00
Kegan Dougal
7ed92fd4f9
More jsdoc
2015-06-05 14:03:00 +01:00
Kegan Dougal
02064bac8a
Recombine initialSync/event high-level logic with HTTP API calls.
2015-06-05 13:30:11 +01:00
Kegan Dougal
300568ef70
Add ability for power users to access the response headers/status code if they desire.
2015-06-05 11:54:27 +01:00
Kegan Dougal
d095eff1a4
Bake in support for promises.
...
This means we can specify the SDK's dependency on Q to make setting things up
significantly easier.
2015-06-05 11:41:26 +01:00
Kegan Dougal
fce4d5d1d6
Add MatrixError class. More jsdoc voodoo to get things looking right.
2015-06-05 11:28:28 +01:00
Kegan Dougal
5681517a30
Setup jsdoc typedefs for callback/promise.
2015-06-05 10:19:52 +01:00
Kegan Dougal
051f3c42b7
Add more jsdoc.
2015-06-04 17:08:40 +01:00
Kegan Dougal
35052e9f13
Add jshint as build step. Add dist/README
2015-06-04 16:42:49 +01:00
Kegan Dougal
7ab3e25218
Add @module docs. Remove browser-build.sh
...
Add @links for HTML output. Replace browser-build.sh with inline commands
in package.json so building will work on non-unix machines. Update README.
2015-06-04 16:34:00 +01:00