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

29 Commits

Author SHA1 Message Date
Kegan Dougal
3061b95afe Add getPrevContent function and mark it's situational presence. 2015-06-12 11:26:33 +01:00
Kegan Dougal
71dacb14b1 Add MatrixEvent.sender and .target to pull the right name per message. 2015-06-12 11:05:57 +01:00
Kegan Dougal
da7b31cb7e Add Room.getJoinedMembers helper. UX tweaks to example. 2015-06-12 10:49:13 +01:00
Kegan Dougal
8aefad221a Add client.getRooms. Add 'syncComplete' event. Display room invites. 2015-06-11 17:52:52 +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
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
583e71180b Add JSDoc for all the events which the SDK will emit. 2015-06-10 14:42:40 +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
4ff6ecd58c Add room name UTs and add self-chat room name. 2015-06-09 17:05:56 +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
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
7ce3a781f3 Add Room, RoomState and RoomMember classes. 2015-06-08 11:47:15 +01:00
Kegan Dougal
6f4b600c0b Appease closure linter. 2015-06-05 14:54:06 +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
051f3c42b7 Add more jsdoc. 2015-06-04 17:08:40 +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