1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00
Commit Graph

54 Commits

Author SHA1 Message Date
Kegan Dougal
07d3f43d8b Refactor terminal app; add /invite and /roominfo. 2015-06-23 15:22:57 +01:00
Kegan Dougal
57914969b8 Add MatrixClient.resendEvent to manually resend an event that was not sent.
Bundle txnId as MatrixEvent._txnId instead of exposing it to every place that
happens to need it (since it's so tightly coupled with MatrixEvent)
2015-06-23 14:08:02 +01:00
Kegan Dougal
378c7fd6cb Update docs 2015-06-23 12:15:41 +01:00
Kegan Dougal
7534f59af2 Hook up the callback fn for scrollback. Update CHANGELOG. 2015-06-23 12:04:43 +01:00
Kegan Dougal
6737388766 Implement pagination via the scrollback() function. Update CHANGELOG. 2015-06-23 11:36:30 +01:00
Kegan Dougal
b7ed78b432 Update CHANGELOG. Add StubStore.
Default to a no-op store class to prevent having to constantly check for
MatrixClient.store and other defensive checks which clutters the intent
of the code.
2015-06-23 11:03:08 +01:00
Kegan Dougal
9c2a2902eb Fix bug where hibernating laptops fail to restart the event stream.
On some devices, the act of hibernating black holes the request so the
success/failure callbacks never fire. This prevents a re-poll as that is done
in the callbacks. To fix this, we add a local timer which, when it fires,
will forcibly do a re-poll. The local timer has a timeout value several
seconds more than the timeout= value (which should've returned by then).
2015-06-23 10:40:53 +01:00
Kegan Dougal
ef77c6f989 Sync room state when another device joins a room. 2015-06-23 10:18:13 +01:00
Kegan Dougal
bc0e2ad504 Sync room state when joining via client.joinRoom
Does not currently sync state when another device joins.
Update node example app to refresh room list.
2015-06-22 17:50:49 +01:00
Kegan Dougal
756fe4ddcb Implement MatrixScheduler. 2015-06-19 16:53:28 +01:00
Kegan Dougal
18db0d8c02 Emit 'Room' event when the Room is fully populated rather than newly created. 2015-06-19 16:05:13 +01:00
Kegan Dougal
2f78ceb6fc Design the API for the scheduler and hook MatrixClient up to it.
Scheduler itself still needs internal impl.
2015-06-19 15:50:05 +01:00
Kegan Dougal
8a9f84a4b2 Don't return something which doesn't exist. 2015-06-18 17:49:13 +01:00
Kegan Dougal
7e12ea4273 Start gluing MatrixClient and MatrixScheduler. 2015-06-18 12:07:18 +01:00
Kegan Dougal
18a3ce415c Add _queues to MatrixScheduler. 2015-06-18 11:49:34 +01:00
Kegan Dougal
9cb37fbe4f Actually allow MatrixClient to not have a store. Update jsdoc. 2015-06-18 09:59:02 +01:00
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