Kegan Dougal
d151ac49f2
Mark events which fail to send.
2015-06-18 09:32:04 +01:00
Kegan Dougal
d74a71cc2d
linting and update README.
2015-06-17 17:47:57 +01:00
Kegan Dougal
8e6eb35dfe
Implement local echo.
...
Mark events being sent via the status property. Update CHANGELOG.
2015-06-17 17:42:12 +01:00
Kegan Dougal
8a844d59ec
Get historical display names working on messages.
...
Accessed via MatrixEvent.sender property. Deep copy the list of state events
from initial sync for old/current RoomState so updating the .sender property
doesn't affect both of them. Reverse the insertion of initial sync MatrixEvents
so state diverges to *earlier* points in time. Add a 'forwardLooking' property
to MatrixEvent to determine which out of 'content' and 'prev_content' entities
should take into account e.g. when determining display names. Finally, always
create new RoomMembers when they are updated in order to prevent corrupting
(read: sharing the same member object) the MatrixEvent.sender property of
existing events in the timeline.
2015-06-12 14:21:24 +01:00
Kegan Dougal
8aefad221a
Add client.getRooms. Add 'syncComplete' event. Display room invites.
2015-06-11 17:52:52 +01:00
Kegan Dougal
61f107f6f9
Hide the data store from the end-user. Proxy calls to getRoom.
2015-06-11 16:36:30 +01:00
Kegan Dougal
8e45d6b625
Bug fixes on initialSync and RoomMember.userId.
...
Don't assume that .state and .messages exist in /initialSync results.
Use state_key and not user_id when setting the userId of a RoomMember.
2015-06-11 16:29:36 +01:00
Kegan Dougal
19a5b99dea
Add RoomMember and RoomState event emissions with UTs. Hook everything up.
...
Distinguish between inserts and updates to the members dictionary to allow
listeners to add more hooks to the member before it has been given state.
2015-06-11 14:29:32 +01:00
Kegan Dougal
911ca1d5c5
Implement Room event emissions with UTs.
...
Shuffle test groupings into EventEmitter and startClient. Add more jsdoc.
2015-06-11 13:22:21 +01:00
Kegan Dougal
4c3e56ad4c
Add test for event emitting. Fix reEmit function.
2015-06-11 11:58:31 +01:00
Kegan Dougal
eaa02cd2ad
Add utils.inherits. Make User inherit EventEmitter.
...
utils.inherits is the Node.js impl but with the addition of a polyfill for
Object.create().
2015-06-11 11:37:43 +01:00
Kegan Dougal
c737068fe7
Don't fire events in the constructor; you can't listen for them.
2015-06-11 11:12:31 +01:00
Kegan Dougal
07f77c495b
Move event jsdoc to respective classes. Document which functions fire.
...
This tends to boil down into a setXEvent method which can fire if it updates
the model.
2015-06-11 10:54:25 +01:00
Kegan Dougal
58cbd3ab1b
Move RoomMember event jsdocs to the room-member module.
2015-06-10 17:25:34 +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
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
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
a2257aeb0b
Move getFriendlyDisplayName to RoomMember class. Add more utlity functions.
2015-06-08 12:21:23 +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
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
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
Kegan Dougal
31ffdf8a37
Style checks and more jsdoc.
2015-06-04 16:02:08 +01:00
Kegan Dougal
a95f9d3717
Make MatrixHttpApi a generic API interface; move specifics to MatrixClient.
...
Add a utils file to store common operations like map() and encodeParams().
Modify MatrixClient and MatrixHttpApi to accepts opts as constructors.
2015-06-04 15:39:36 +01:00
Kegan Dougal
d1e51de7ec
Split out matrix.js into different files. Glue things back.
...
Added a models directory. Added store, http-api and client files. Slowly
transitioning to the architecture outlined in SYJS-5.
2015-06-03 17:55:12 +01:00