Commit Graph

89 Commits (4d8f18742b5dc1563f58867604e215a7685df411)

Author SHA1 Message Date
Luke Barnard 4d8f18742b Check against non-existant promise to resolve a user's groups 2017-11-03 18:43:43 +00:00
Luke Barnard d64fc4c842 Fix Flair not appearing due to missing this._usersInFlight 2017-11-03 18:19:10 +00:00
David Baker 8800081cb9
Merge pull request #1567 from matrix-org/luke/fix-flair-store
Fix multiple requests for publicised groups of given user
2017-11-02 16:09:07 +00:00
Luke Barnard 21e09840dc Fix multiple requests for publicised groups of given user
Previously, a single user could end up in multiple batches, which would have been fine if the logic didn't assume otherwise. If a request took longer than 200ms, multiple batches would occur with intersecting sets of users, deleting promises that were then assumed to exist.

The logic now takes all "in flight" users to also not be "pending". Pending now means that the user will be processed in the next batch. "In flight" means the user is part of an ongoing batch.
2017-11-02 15:59:26 +00:00
Luke Barnard bf77b51b5e Merge branch 'develop' into luke/groups-room-publicity 2017-11-02 13:39:33 +00:00
Luke Barnard 790db94fd7 Add toggle to alter the visibility of a room-group association 2017-11-02 13:31:11 +00:00
Matthew Hodgson 7d7cd30e46 turn NPE on flair resolution errors into a logged error 2017-11-01 22:10:03 +00:00
Luke Barnard 16dca08b77 Use constants instead of string literals 2017-10-31 16:13:13 +00:00
Luke Barnard 775468e71a Display whether the group summary/room list is loading
This uses a `ready` flag assigned to each fetching API used by the GroupServer. I've avoided making this generic for now for want of not doing so early.
2017-10-31 11:42:09 +00:00
Luke Barnard 175fadbb57 Add unregiseterListener to GroupStore 2017-10-27 15:08:38 +01:00
Luke Barnard 5d0aa8d7f7 Handle 403 when inspecting invited users as non-member 2017-10-27 11:38:10 +01:00
Luke Barnard e094c32c62 Simplify GroupStore listener registration 2017-10-27 11:38:10 +01:00
Luke Barnard 7b666af24c When dispatching view_[my_]group[s], reset RoomViewStore
so that RoomTiles are not highlighted when the user is looking at MyGroups or GroupView
2017-10-24 16:32:52 +01:00
Luke Barnard 3ae31dd426 Make GroupStoreCache global for cross-package access 2017-10-24 10:39:47 +01:00
Luke Barnard b9dc5cb5ed Merge branch 'develop' into luke/groups-update-on-invite 2017-10-23 16:05:52 +01:00
Luke Barnard 0799e5cde4 Refresh group member lists after inviting users 2017-10-23 16:04:26 +01:00
Luke Barnard 0ff5b9c6a7 Invalidate the user's public groups cache when changing group publicity
This will make the changes to their Flair "live", but only from the user's own perspective.
2017-10-23 15:28:38 +01:00
Luke Barnard b0f8619754 Improve MyGroups UI
as per design layed out by @tur2live!
2017-10-19 17:24:45 +01:00
Luke Barnard 25d14af616 Export a global.singletonFlairStore to allow cross-project singleton 2017-10-19 12:00:03 +01:00
Luke Barnard 71443e9b94 Remove logs comments 2017-10-19 10:34:24 +01:00
Luke Barnard 5f3c06b38a Factor out Flair cache into FlairStore
This will make invalidating the userGroups cache for the user architecturally more sound (the plan is to have GroupStore hit FlairStore as opposed to Flair itself in order to invalidate the cache).
2017-10-19 10:28:59 +01:00
Luke Barnard 0415869b8c Add useful functions to GroupView to inspect user flags 2017-10-17 16:08:19 +01:00
Luke Barnard 917957c1dc Modify the group store to include group rooms
and modify components to use this new part of the store such that feedback can be given
when adding or removing a room from the room list.
2017-10-05 14:30:04 +01:00
Luke Barnard cbb36b163b Typo 2017-10-04 18:05:40 +01:00
Luke Barnard c1318e9102 Only maintain one GroupStore in the GroupStoreCache
So that the group store data is up-to-date and to prevent group stores hanging around in memory
2017-10-04 17:51:38 +01:00
Luke Barnard b16eb1713e Typo 2017-10-04 17:01:44 +01:00
Luke Barnard 4017fa7f1d Factor-out GroupStore and create GroupStoreCache
In order to provide feedback when adding a room to a group, the group summarry store needs to be extended to store the list of rooms in a group. This commit is the first step required.

The next step is to get the GroupRoomList listening to updates from GroupStore and expose the list of rooms from GroupStore.

(We're running out of words to describe the hierachy of things that store things)
2017-10-04 16:56:35 +01:00
David Baker 8ec1c3ecf4 lint 2017-09-26 14:58:49 +01:00
David Baker 8d0983ab02 Fix group membership publicity
* Read the new flag in the summary API (the one we were reading
   was actually whether the group server listed you as a member to
   non-members).
 * Remove call to now-dead _loadGroupFromServer andf use the store
   instead
2017-09-26 14:46:57 +01:00
Luke Barnard b8dca58f4f Pass matrixClient as an argument to GSS constructor 2017-09-25 10:02:13 +01:00
Luke Barnard 791bc5e7ac Create GroupSummaryStore for storing group summary stuff
- Acts as a layer between GroupView and the group APIs that modify the summary individually. This allows for abstraction of getting the new summary once a successful API hit has been done.
 - The plan is to also control the avatar, topic, body of the summary via the same class
2017-09-22 18:52:06 +01:00
David Baker 4d8eadad4f Clarify comment 2017-09-19 10:21:20 +01:00
David Baker c265ec9571 Fix RoomView stuck in 'accept invite' state
After accepting a 3pid invite.

Rather than clear the joining flag when the join request completes,
leave it so the RoomView can see that we're expecting the user to
be joined in the various stages that might go through (waiting for
join request, waiting for room object, waiting for 'joined' member
event). The problem in this case was that we had to wait a bit for
the last one, and there was no bit of state to represent it.

This hopefully also makes the logic somewhat simpler.

Fixes https://github.com/vector-im/riot-web/issues/5041
2017-09-15 15:07:09 +01:00
David Baker 1b355e1a13 Merge pull request #1391 from matrix-org/dbkr/fix_slash_join
Make /join join again
2017-09-15 09:56:02 +01:00
David Baker c814f02f34 Merge pull request #1390 from matrix-org/dbkr/create_room_no_spinner
Display spinner not room preview after room create
2017-09-15 09:18:55 +01:00
David Baker f3a4856593 Merge remote-tracking branch 'origin/develop' into dbkr/fix_slash_join 2017-09-14 23:09:26 +01:00
David Baker 1f837d2ae1 Make /join join again
The auto_join parameter to view_room got broken at some point so
/join took you to the room and then sat there like a lemon.

Fixes https://github.com/vector-im/riot-web/issues/5029
2017-09-14 23:06:00 +01:00
David Baker 6b6e59e0dd Display spinner not room preview after room create
After creating a room, display the activity spinner while we wait
for the room to come down the event stream.

This was the intention before but I can't see how it would have
worked: we were setting the 'joining' flag, but then resetting it
by claiming we were already joined in the view_room dispatch.

 * Send 'joining' instead of 'joined' in view_room dispatch, which
   will set the corresponding joining flag (ie. to indicate we've
   sent a request to join the room). Remove the 'joined' flag.
 * Reset 'joining' to false otherwise on a view_room dispatch to
   prevent it from leaking between rooms (this may have been the
   intention of the `if (payload.joined) newState.joining = false`?

Fixes https://github.com/vector-im/riot-web/issues/4701
2017-09-14 22:22:21 +01:00
David Baker ffb3d718d3 Fix the avatar / room name in room preview
When clicking on rooms from the room directory. When RoomViewStore
resolved the room alias, it threw away the out-of-band data in the
process. This must have been broken as part of the ILAG /
RoomViewStore stuff.
2017-09-13 15:48:53 +01:00
David Baker d714291aa1 Re-add doc on scroll state map structure 2017-09-08 13:27:14 +01:00
David Baker 7f44ac7403 Remove now unused stuff from RoomViewStore 2017-09-07 17:15:19 +01:00
David Baker 408b8c18ea Introduce a RoomScrollStateStore
to keep the place we're scrolled to in rooms. This mainly eleimates
the extra, superfluous onRoomViewStoreUpdate callback that
happened when the previous room saved back its scroll state.
Moving the scroll state to a separate store means we can have this
not emit events because nothing needs to know when the scroll state
changes.
2017-09-07 17:08:36 +01:00
Michael Telatynski 24599ace32
don't track error messages
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-08-10 13:49:11 +01:00
Michael Telatynski bf98c0da7c
un-i18n Modal Analytics
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-27 17:19:18 +01:00
Luke Barnard a921059432 Fix vector-im/riot-web#4526 by pretending to join
I thought about adding separate dispatches to prevent confusion but if anyone adds anything that listens to existing dispatches, they really ought to be grep-ing the world for said dispatch actions.
2017-07-06 17:40:27 +01:00
Luke Barnard 6b6af3f148 Remove RTE content_state logging 2017-07-06 11:17:54 +01:00
Luke Barnard df23a6cd85 Use Object.assign to set initial state of MessageComposerStore
Otherwise we just modify the initial state when running
2017-07-05 13:38:34 +01:00
Luke Barnard 3d5b3ed7ad Use ContentState instead and persist over localStorage 2017-07-05 11:49:34 +01:00
Luke Barnard 084a933dbd Implement MessageComposerStore to persist composer state across room switching
This behaviour was present in the old composer but implemented using local storage. This is unecessary as we don't really care about our drafts across clients, the important thing is that our draft is kept when switching rooms.

As a bonus, ifnore vertical arrow key presses when a modifier key is pressed so that the room switching keys (alt + up/down arrow) don't also cause history browsing (or autocomplete browsing).
2017-07-05 10:24:55 +01:00
Michael Telatynski 68fb11d2bf
de-lint LifecycleStore
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-01 14:35:40 +01:00