Commit graph

890 commits

Author SHA1 Message Date
Bruno Windels
787308375c prevent toggling in vm while already busy
otherwise the check in SendQueue to prevent duplicates might fail
2021-06-24 14:33:16 +02:00
Bruno Windels
299294daff prevent re(d)action in left/kicked room 2021-06-24 14:24:22 +02:00
Bruno Windels
3fa0f234bb not used 2021-06-24 14:12:55 +02:00
Bruno Windels
366d3761b8 remove waiting for update event (it might not come in case of dupe)
also remove duplicate logging impl for re(d)action at cost of
double haveAnnotation call
2021-06-24 13:35:59 +02:00
Bruno Windels
7557e2f437 not used 2021-06-24 13:26:14 +02:00
Bruno Windels
38b465cb9d rename vm.toggleReaction to vm.toggle 2021-06-24 13:15:20 +02:00
Bruno Windels
a4a7c23148 use pending re(d)action timestamp to have stable reaction sorting order
also move more logic into the matrix layer, from Reaction(s)ViewModel
to PendingAnnotation
2021-06-24 12:26:38 +02:00
RMidhunSuresh
eb35f46214 Make sure room does exist before creating vm
- This will stop the code from throwing when opening /details on
  UnknownRoomView.

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-24 14:58:02 +05:30
RMidhunSuresh
e2fd90bdc2 Remove Segment import
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-24 13:48:53 +05:30
Bruno Windels
c585d76ce5 also clear pending reaction promise when an error is thrown 2021-06-23 17:47:47 +02:00
Bruno Windels
1a5a64864a don't double log redactReaction 2021-06-23 17:47:18 +02:00
Bruno Windels
48588687a5 share logic whether have reacted already between basemsgtile & reactvm 2021-06-23 15:38:12 +02:00
Bruno Windels
a1d24894eb this will block if we have a pending redaction & reaction
so the reaction won't be aborted
2021-06-23 11:45:24 +02:00
Bruno Windels
442d4cce03 make the react/redactReaction promise only return after update happened 2021-06-23 11:44:53 +02:00
Bruno Windels
18562d30d8 integration tests for local echo of toggling reactions 2021-06-23 11:43:14 +02:00
Bruno Windels
b153613200 determine toggle state correctly with both pending redaction & reaction 2021-06-23 11:41:28 +02:00
RMidhunSuresh
12305be06a Fix issue #397
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-19 16:01:02 +05:30
Bruno Windels
099f99a96b check power levels to see if we can react 2021-06-17 09:41:25 +02:00
Bruno Windels
fd54539e1c clarify comment 2021-06-17 09:41:10 +02:00
Bruno Windels
94635a18e0 actually, 0 or -1 mean you have a local redaction 2021-06-16 12:41:42 +02:00
Bruno Windels
3b629622d9 need to keep pending count around if 0 or less for redaction local echo
also need to be able to tell the difference between no pending reactions
and redactions and the sum being 0 (having both a redaction and
reaction) so we keep isPending to true
2021-06-16 10:23:22 +02:00
Bruno Windels
e5c1094153 WIP 2021-06-15 19:06:41 +02:00
RMidhunSuresh
4f05d9a5b7 Make navigation changes in one go
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-15 14:34:26 +05:30
RMidhunSuresh
97e484b8e6 Rename toggle --> open
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-15 14:30:27 +05:30
RMidhunSuresh
88a1e34987 Unsubscribe on dispose
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-14 21:04:44 +05:30
RMidhunSuresh
7b811aa927 Remove space after brace in two places
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-14 20:33:32 +05:30
RMidhunSuresh
e10b455b27 Rename method
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-14 20:32:05 +05:30
Bruno Windels
75ee509361 fix lint 2021-06-11 11:30:11 +02:00
Bruno Windels
81a721f880 make equality stable in comparator for reaction 2021-06-11 11:04:48 +02:00
Bruno Windels
1d9709d4e3 also compare by key if the timestamps are the same 2021-06-11 11:02:31 +02:00
Bruno Windels
757e08c62c WIP 4 2021-06-10 18:29:10 +02:00
RMidhunSuresh
f3f1436bb0 Rename room info to room details everywhere
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
efd37d811f Update on changes to vm
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
008f3601ca Remove link support from Menu
- Not needed anymore since every link item has been rewritten as a
  button.

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
332fbdda84 Move variable to scope of conditional
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
7fbcf89539 Remove unncessary empty line
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
eb870cfc23 Use url instead of link
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
fcc2afba08 Do not compute link in getter
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
04065847dc Remove unused getter
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
c6f3b1fbbe Do not use private props from room summary
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
4700009c68 Add new test for parseUrlPath
Make sure that the details panel stays open during room change.

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
5b74038912 Check value of details everywhere
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
b2448e1207 Calculate path when button is clicked
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
37e052c061 details do not need to be child of rooms
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
a4bcb21a85 Move details handling to separate function
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
7f922afe79 Reduce duplication in code
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
04933acbfb Add missing checks
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
8d254c91e3 Undo formatting/stylistic changes
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
3273682155 Do not show room id instead of canonical alias
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
00dbd3db06 Add menu entry to launch RoomInfoView
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
426d0779ee Keep RoomInfoView open across room/grid changes
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
02d79b52a4 Prefer canonical alias over room_id if available
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
2dcec6343d Info icon should open/close view alternatively
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
9ac415fa4f Show panel when first visit contains /details
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
4edc58ebcf Add button in Room header to open details
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
37367cde65 Make close button close the view
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
6f1b77b6fa Add room avatar to RoomInfoView
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
191eb09a76 Fallback to canonical alias if no names found
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
9a605cc6c6 Remove unnecessary check
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
c3333f5fe8 Extract method
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
ddaa9b46c0 Dispose vm preemptively
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
7e38c3ea88 Remove right panel on grid update if needed
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
98d8d44695 Allow details to be child of rooms
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
439910f6ca Handle case when path.get() may be null
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
96959a3c4c Put name of property in emitChange
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
986271d02a Add code to toggle RoomInformation panel
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
c7fd0fac07 Allow details to be child of room
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
RMidhunSuresh
c7ba472042 Add view and vm for RoomInformation
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-06-09 16:51:18 +05:30
Bruno Windels
206d18f498 WIP2 2021-06-08 16:56:17 +02:00
Bruno Windels
2ebadb36c3 WIP 2021-06-08 13:20:55 +02:00
Bruno Windels
280de98858 fix lint 2021-06-04 16:41:37 +02:00
Bruno Windels
b7402ce43c support local echo for adding a reaction 2021-06-04 15:34:44 +02:00
Bruno Windels
3e2b7ba5fa obsolete, already provided in parent class 2021-06-03 21:01:26 +02:00
Bruno Windels
1385a22e60 don't recreate the reactions after clearing it with the last one removed 2021-06-03 21:00:57 +02:00
Bruno Windels
cc444fa207 we actually don't need any of the view model infrastructure
all the updates go over the observable list
2021-06-03 21:00:25 +02:00
Bruno Windels
8d4d9c6e8d WIP 2021-06-03 19:57:48 +02:00
Bruno Windels
2eb2e4e9b3 more stable sorting order for reactions 2021-06-03 19:57:29 +02:00
Bruno Windels
bb8acbefa3 support undoing a reaction 2021-06-03 19:57:16 +02:00
Bruno Windels
20abb01ee8 very basic way of sending a reaction 2021-06-03 19:16:53 +02:00
Bruno Windels
2152d5e833 expose reactions on base message tile as vm with observable list 2021-06-03 19:15:49 +02:00
Bruno Windels
b05345ee27 only show redacted messages 2021-06-03 16:50:37 +02:00
Bruno Windels
b83613924c don't assume there is at least 1 tile before loading at top
it can happen that all tiles are not renderable, and we should just
keep calling loadAtTop
2021-06-03 09:25:56 +02:00
Bruno Windels
7a96f84cab also show redaction reason for redaction local echo 2021-06-02 12:17:09 +02:00
Bruno Windels
15f6ab8b7e only show cancel option if not already sending 2021-06-02 11:56:15 +02:00
Bruno Windels
dc2e21495b explain why this is needed 2021-05-31 15:46:57 +02:00
Bruno Windels
8196a02f9d don't even need isOwn member anymore 2021-05-31 15:25:01 +02:00
Bruno Windels
00231443d3 timeline has the own member, so can just use timeline, not ownUserId 2021-05-31 15:18:44 +02:00
Bruno Windels
606d40c9d4 simplify canRedact logic in view by overriding in RedactedTile 2021-05-31 13:55:08 +02:00
Bruno Windels
23459aad52 check if you are allowed to redact a message 2021-05-31 13:52:03 +02:00
Bruno Windels
762ed96a3b Not needed as both evententry and pendingevententry return timestamp 2021-05-31 11:58:01 +02:00
Bruno Windels
0596ca06b1 emit remove before linking up sibling tiles
otherwise emitting the update from updatePreviousSibling has
the wrong idx
2021-05-31 11:56:41 +02:00
Bruno Windels
c6e2607f1f guard against updates emitted while populating during first subscription
This came up now because Timeline uses a MappedList to map PendingEvents
to PendingEventEntries. In the map function, we setup links between
entries to support local echo for relations. When opening a timeline
that has unsent relations, the initial populating of the MappedList
will try to emit an update for the target entry in remoteEntries.
This all happens while the ListView of the timeline is calling subscribe
and all collections in the chain are populating themselves based on
their sources.

This usually entails calling subscribe on the source,
and now you are subscribed, iterate over the source (as you're not
allowed to query an unsubscribed observable collection, as it might not
be populated yet, and even if it did, it wouldn't be guaranteed to be
up to date as events aren't flowing yet).

So in this concrete example, TilesCollection hadn't populated its tiles
yet and when the update to the target of the unsent relation reached
TilesCollection, the tiles array was still null and it crashed.

I thought what would be the best way to fix this and have a solid model
for observable collections to ensure they are always compatible with
each other. I considered splitting up the subscription process in two
steps where you'd first populate the source and then explicitly start
events flowing.

I didn't go with this way because it's really only updates that
make sense to be emitted during setup.
A missed update wouldn't usually bring the collections out of sync
like a missed add or remove would. It would just mean the UI isn't
updated (or any subsequent filtered collections are not updated),
but this should be fine to ignore during setup, as you can rely
on the subscribing collections down the chain picking up the update
while populating. If we ever want to support add or remove events
during setup, we would have to explicitly support them, but for now
they are correct to throw.

So for now, just ignore update events that happen during setup
where needed.
2021-05-27 10:02:05 +02:00
Bruno Windels
a8e43d4850 remove leftover logging 2021-05-27 09:18:22 +02:00
Bruno Windels
56495c9d13 fix gap failing to fill 2nd time + unit regression test 2021-05-27 09:10:10 +02:00
Bruno Windels
ca4d09e923 add logging and return promise from Tile.redact 2021-05-26 13:08:54 +02:00
Bruno Windels
ce7147e463 put redactions in their own view, and allow aborting while still queued 2021-05-26 13:07:56 +02:00
Bruno Windels
cb622be653 rerender tile when becoming or stopped being redacted 2021-05-25 12:58:20 +02:00
Bruno Windels
8a8c5569dc provide redact method on tile and room
also add some logging
2021-05-20 14:53:17 +02:00
Bruno Windels
b655c34bbb also show reason for redaction 2021-05-20 13:20:12 +02:00
Bruno Windels
780ad44032 render redacted messages 2021-05-20 13:15:35 +02:00
Bruno Windels
1f17edc248 fix undefined variable, this probably breaks restoring the last url 2021-05-20 11:11:07 +02:00
Bruno Windels
df8686099f
Merge pull request #356 from MidhunSureshR/linkify-doc
Add jsdoc comments for clickable link code + Minor Changes
2021-05-18 13:30:23 +00:00
Bruno Windels
c3ef801566 offer back button when session loading fails 2021-05-18 15:27:31 +02:00
Bruno Windels
d567664d8b ensure there is a session id in last-session action 2021-05-18 14:47:45 +02:00
Bruno Windels
2c7ea44afd don't expose last url to root VM so it isn't confused by empty path
instead, check the length of the path in a dedicated method in
the router
2021-05-18 14:27:09 +02:00
Bruno Windels
dd880529ac make redirects in initial url be reflected in url bar 2021-05-18 13:52:31 +02:00
Bruno Windels
1bec1033d1 translate last-session to a real session id 2021-05-18 13:52:13 +02:00
Bruno Windels
754e7e7bb2 clarify with comments 2021-05-18 11:54:18 +02:00
Bruno Windels
f92b1df4fc update copyright comments 2021-05-18 11:54:10 +02:00
Bruno Windels
54798d3079 unreachable now 2021-05-18 11:50:02 +02:00
Bruno Windels
2cf100efaa refine unknown room view 2021-05-18 11:46:55 +02:00
Bruno Windels
c04a8140a3 offer to rejoin archived room from menu 2021-05-18 11:07:46 +02:00
Bruno Windels
03be63572d ask to join when room id is unknown 2021-05-18 11:07:19 +02:00
Bruno Windels
3acb3bb48c fix memory leak when switching room ids 2021-05-18 11:06:48 +02:00
RMidhunSuresh
72f58b6001 Change lines[i] to line
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-18 14:26:56 +05:30
RMidhunSuresh
11d551f8a3 Add js-doc for parsePlainBody
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-17 20:39:23 +05:30
RMidhunSuresh
d671bcec31 Add js-docs for linkify function
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-17 20:32:35 +05:30
Bruno Windels
645470cd03 no need for private prop here 2021-05-17 12:45:55 +02:00
Bruno Windels
ce976226f9 rename MessageTile to BaseMessageTile
since MessageTile doesn't have a shape property anymore
2021-05-17 12:15:13 +02:00
Bruno Windels
67714040e7 rename BaseTextMessageTile to BaseTextTile 2021-05-17 12:14:15 +02:00
Bruno Windels
054c51b82f add caching MessageBody in BaseTextMessageTile,use in EncryptedEventTile
missing body in EncryptedEventTile was what caused the bug
2021-05-17 11:27:30 +02:00
Bruno Windels
01b8b397b6 expose sourceString on result of parsing message body
and also do some cleanup
2021-05-17 11:26:30 +02:00
Bruno Windels
62bb891e79 don't accept closing parenthesis as last character of url 2021-05-12 22:49:34 +02:00
Bruno Windels
56699baaf1 dont need this anymore 2021-05-12 18:31:13 +02:00
Bruno Windels
86d60496c0 Don't move read rooms to lower sorting position 2021-05-12 18:28:39 +02:00
Bruno Windels
402a5e5d54 fix room list sorting not keeping sorting position after clearing unread 2021-05-12 18:26:55 +02:00
Bruno Windels
93c08c16c1
Merge pull request #345 from MidhunSureshR/linkify
Render URLs as clickable links in timeline
2021-05-12 15:40:46 +00:00
Bruno Windels
b30b62416c add option to forget archived room 2021-05-12 15:38:54 +02:00
Bruno Windels
f331d84292 add options menu in room header with leave room option 2021-05-12 13:59:08 +02:00
RMidhunSuresh
851e8d34a4 Incorporate better regex from review
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-12 16:15:30 +05:30
RMidhunSuresh
00bcdbab37 Fix broken test
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-12 16:15:07 +05:30
RMidhunSuresh
bb74656348 Grammar fix
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-12 15:59:44 +05:30
RMidhunSuresh
2e657fbbbd Add failing test for link ending with <
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-12 15:56:33 +05:30
RMidhunSuresh
55b7c55efe Pull callback args into variables
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-12 15:52:05 +05:30
RMidhunSuresh
9d898bdf47 Change word to improve meaning
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 22:32:05 +05:30
RMidhunSuresh
b521797f4d Explain the reason for double escapes
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 22:28:14 +05:30
RMidhunSuresh
ef15968a3d Add some helpful pointers
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 22:26:45 +05:30
RMidhunSuresh
c6d7cef491 Refactor regex to improve readability
- Split regex into components
- Add informative comments

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 22:21:37 +05:30
RMidhunSuresh
31740f4ec6 Put regex into separate file
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 22:18:52 +05:30
RMidhunSuresh
6f0362802a Move linkify.js to separate directory
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 22:17:08 +05:30
RMidhunSuresh
027f6020e7 Modified regex to allow unicode in fragment
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 22:15:36 +05:30
RMidhunSuresh
e20810b0cb Add test for unicode after fragment without path
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 20:44:39 +05:30
RMidhunSuresh
7be9f93909 Make regex module-level constant
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 20:32:36 +05:30
RMidhunSuresh
03208b88d5 Move link tests to linkify
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 20:19:29 +05:30
Bruno Windels
a0e3848cf6 dispose existing view model when changing status, otherwise we leak! 2021-05-11 16:39:33 +02:00
Bruno Windels
8b8214cd1b reference count archived rooms and keep track of active ones
so we don't create two instances for the same id, one for sync, and one
for displaying, and hence updates from sync being pushed on a different
instance than the one displaying, and not updating the view.
2021-05-11 16:09:58 +02:00
RMidhunSuresh
dbe76e973e Add braces to all blocks
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 17:59:03 +05:30
Bruno Windels
82a1b37363 refresh room view model when going from joined -> archived
given we have a dedicated class (ArchivedRoom) for it now
2021-05-11 13:11:38 +02:00
Bruno Windels
e3c1644d09 show leave reason instead of composer for archived room 2021-05-11 13:11:11 +02:00
Bruno Windels
9ea0138ffd don't open room view when clearing room id 2021-05-11 13:10:21 +02:00
RMidhunSuresh
3830a95af2 Cache result in TextTile
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 16:03:14 +05:30
RMidhunSuresh
051771397c Fix bug in which links preceeded text
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 13:59:45 +05:30
RMidhunSuresh
3beaf88a8b Rename messageFormat to body
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 13:46:38 +05:30
RMidhunSuresh
070bc96186 Fallback to empty string if content is undefined
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 13:43:54 +05:30
RMidhunSuresh
577883a1d4 Refactor loop
Don't handle last element separately

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 13:31:33 +05:30
RMidhunSuresh
03b971d898 Added tests for new linkify
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-11 12:55:39 +05:30
RMidhunSuresh
17be7c4f4d Add newline to message
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-10 22:10:50 +05:30
RMidhunSuresh
fc3b391aa9 Use MessageBodyBuilder instead of linkify
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-10 21:41:57 +05:30
RMidhunSuresh
55f2d79d07 Move newline handling to MessageBodyBuilder
- Also add a insert method to reflect new design.

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-10 21:37:27 +05:30
RMidhunSuresh
787d438a74 Refactored Linkifier class into single function
Modified design so that linkify interacts with MessageBodyBuilder
through callbacks.

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-10 21:30:11 +05:30
RMidhunSuresh
dca649dfd4 Moved files into more appropriate locations
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-10 19:53:40 +05:30
RMidhunSuresh
06a6cae4af Rename MessageBodyBuilder to MessageBodyBuilder
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-10 19:50:26 +05:30
RMidhunSuresh
2f883d049c Return new message format instead of message text
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-08 19:20:07 +05:30
RMidhunSuresh
9ca0d93a01 Add tests for linkify
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-08 19:18:45 +05:30
RMidhunSuresh
32fd1eb318 Implement linkifier
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-08 19:17:43 +05:30
RMidhunSuresh
3c46a07a1e Implement object format to represent chat messages
Every chat text message can be split into parts such as text, newline
and links.

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-05-08 19:02:44 +05:30
Bruno Windels
a8d4ee0dd6 different room view models don't need to initiate switching now
as this is triggered by observing the room status
2021-05-07 13:11:17 +02:00
Bruno Windels
6c58c61da9 move switching room view models to a dedicated observable
based on the observing the room status
2021-05-07 13:10:35 +02:00
Bruno Windels
644698aed7 remove room from room list when leaving 2021-05-06 14:15:47 +02:00
Bruno Windels
e1d4c75d18 pass avatar sizes from view to view model rather than repeating there
and risk a mismatch resulting in too large/small image
2021-04-28 14:11:35 +02:00
Bruno Windels
15dfb6c202 clarify 2021-04-28 10:05:21 +02:00
Bruno Windels
ef6f10c5a2 test for Path.replace 2021-04-28 09:53:44 +02:00
Bruno Windels
1c5b953026 hide non-joined rooms in left panel for now
until we support archiving/forgetting the room
2021-04-27 16:16:07 +02:00
Bruno Windels
396ec4dfd9 also in grid remove room id from nav path when refreshing room vm fails 2021-04-27 15:33:12 +02:00
Bruno Windels
799ea50c68 remove obsolete logging 2021-04-27 15:02:00 +02:00
Bruno Windels
32d9f6e830 expose inviter user id 2021-04-27 15:01:35 +02:00
Bruno Windels
a95df54978 scale down inviter avatar 2021-04-27 15:01:20 +02:00
Bruno Windels
15fba7a07d missing semicolon 2021-04-27 14:43:26 +02:00
Bruno Windels
781235cb07 scale up room avatar 2021-04-27 14:43:13 +02:00
Bruno Windels
f902f255a4 add roomDescription property 2021-04-27 14:42:37 +02:00
Bruno Windels
b6573258fb always show inviter if present 2021-04-27 14:42:12 +02:00
Bruno Windels
87defbfb51 sort invites most recent first 2021-04-27 14:27:14 +02:00
Bruno Windels
aaf4e79a73 make media repo available on invite 2021-04-27 11:01:33 +02:00
Bruno Windels
f2d7f5e4da refresh vm when left room receives invite
clean up room vm switching in the process
2021-04-23 18:06:38 +02:00
Bruno Windels
2e9ddf9c2c prevent key collisions between rooms and invites before creating tile vm 2021-04-22 17:22:47 +02:00
Bruno Windels
20f4474eb6 missing semicolon 2021-04-21 18:13:29 +02:00
Bruno Windels
76933e51aa fix default avatar color being broken in room list 2021-04-21 17:48:40 +02:00
Bruno Windels
1cf49688d6 show invites at the top of the room list 2021-04-21 17:26:34 +02:00
Bruno Windels
9961d3e4fc unused code 2021-04-21 15:48:27 +02:00
Bruno Windels
7e2870acef wire up InviteViewModel in Session/RoomGridViewModel
and:
 - switch to room once accepted
 - close invite if rejected
2021-04-21 15:47:39 +02:00
Bruno Windels
0cc95f5083 first draft of InviteViewModel 2021-04-21 15:45:51 +02:00
Bruno Windels
16f275ca34 make pass-through props smaller 2021-04-21 15:34:35 +02:00
Bruno Windels
a91a584201 not used anymore 2021-04-21 15:33:45 +02:00
Bruno Windels
9c19fa5c63 utility to remove room from path (with our without grid)
which will be used when rejecting an invite
2021-04-21 15:33:08 +02:00
Bruno Windels
bb1c64e1ac add left panel tile view model for invites
and track in-progress state in Invite so it is shared by left panel
and open invite
2021-04-20 19:01:40 +02:00
Bruno Windels
1505f2d101
Merge pull request #307 from vector-im/hs/deault-hs-url
Allow specifying a custom defaultHomeServer
2021-04-01 13:03:46 +00:00
Bruno Windels
10e9e7388f expose checking pusher on homeserver in setting 2021-04-01 15:01:04 +02:00
Will Hunt
6bdf7f1ee9 Allow specifying a custom defaultHomeServer 2021-03-30 17:43:03 +01:00
Bruno Windels
7b9904e423 add UI in settings for push notifs status/enable/disable 2021-03-23 18:20:23 +01:00
RMidhunSuresh
3d1ddccbd8 Add previous name in name change announcement
- Fixes issue 269 in which the announcement generated when a member
  changes their name would show as :
  <new_name> changed their name to <new_name>
  instead of:
  <old_name> changed their name to <new_name>

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-03-19 23:28:50 +05:30
Bruno Windels
9506bf1b81 clean up video upload error handling 2021-03-10 13:43:55 +01:00
Bruno Windels
a672b0c78a better error handling in video decoding 2021-03-10 13:40:11 +01:00
Bruno Windels
948249bb3d better error reporting for unsupported codecs when uploading 2021-03-10 13:39:34 +01:00
Bruno Windels
35e6dffd0b don't rely on mime-types to decide to use main url for thumbnail
so it does not break when clients forget to set the mimetype
2021-03-10 10:01:07 +01:00
Bruno Windels
c6ff56a942 send video messages 2021-03-09 19:35:25 +01:00
Bruno Windels
ee6f3e5457 render video messages 2021-03-09 19:35:10 +01:00
Bruno Windels
299fcfd4d1 extract base class from image tile to inherit from for video tile 2021-03-09 19:33:54 +01:00
Bruno Windels
2d4003379e Fix #97 2021-03-08 22:25:18 +01:00
Bruno Windels
961d0cb224
Merge pull request #249 from vector-im/bwindels/ui-sent-status
show message already as black when sent but no remote echo yet
2021-03-03 13:08:46 +00:00
Bruno Windels
6f6346d5c3 detect when hitting beginning of timeline when loading timeline 2021-03-02 19:29:55 +01:00
Bruno Windels
856001160b show message already as black when sent but no remote echo yet 2021-02-26 10:40:08 +01:00
Bruno Windels
1093895133 log opening timeline
also load the timeline when opening it in the room, so logging
starts in the room (and we don't need to pass the logger to Timeline)
and also API-wise it makes more sense to
not return uninitialized objects
2021-02-24 11:21:04 +01:00
Bruno Windels
29df61eb8a remove superfluous console log 2021-02-24 10:57:29 +01:00
Bruno Windels
59928432df better logs filename 2021-02-16 17:46:07 +01:00
Bruno Windels
ee4a382578 revert this back 2021-02-16 15:38:43 +01:00
Bruno Windels
7dc3707871 add button to export logs 2021-02-16 15:27:24 +01:00
Bruno Windels
e6c108c6e0 no need to copy it over in viewmodel 2021-02-12 18:06:14 +01:00
Bruno Windels
89599e9f87 WIP 2021-02-11 21:07:18 +01:00
Bruno Windels
2f0f168c6e show 'sending' while waiting for remote echo for filetile instead of unknown status 2020-11-20 16:38:16 +01:00
Bruno Windels
9ab81eea02 add setting for image compression level 2020-11-20 15:51:16 +01:00
Bruno Windels
f7a07a9e79 adjust fileview/tile to pendingevent changes 2020-11-20 11:45:14 +01:00
Bruno Windels
8b8d06cf3e show error for attachments still need upload but missing after refresh 2020-11-19 14:42:29 +01:00
Bruno Windels
59a92bdf97 vm changes for improved image view 2020-11-18 20:10:05 +01:00
Bruno Windels
f6dbb23f79 better error handling for file and picture upload 2020-11-18 20:07:31 +01:00
Bruno Windels
47147f2d46 progress bar for upload, add cancel button, no lightbox while uploading 2020-11-18 20:06:34 +01:00
Bruno Windels
a930dec8db adjust ImageTile to state machine changes 2020-11-18 13:05:10 +01:00
Bruno Windels
91f7970d66 Merge branch 'master' into bwindels/upload-images 2020-11-16 19:31:04 +01:00
Bruno Windels
d1a95c664d require space after /me 2020-11-16 19:29:29 +01:00
Bruno Windels
671e23a123 basic reporting of image upload progress in % 2020-11-16 15:10:44 +01:00
Bruno Windels
41738ad660 local echo for image tiles 2020-11-13 19:15:21 +01:00
Bruno Windels
8b82c991e7 wire up image uploads 2020-11-13 19:15:03 +01:00
Bruno Windels
41fb3e742e fix file upload attachment api changes 2020-11-13 19:13:35 +01:00
Bruno Windels
d2a4242e5b support multiple attachments per event 2020-11-13 17:19:19 +01:00
Bruno Windels
6fd10b63e5 add device pixel ratio scaling while at it 2020-11-12 13:50:32 +01:00
Bruno Windels
8b16d8bc99 handle upload failures better 2020-11-11 13:06:03 +01:00
Bruno Windels
fd9eccec4d support local echo in FileTile while uploading 2020-11-11 11:52:06 +01:00
Bruno Windels
e2dd9b9f77 fix typos/refactor errors 2020-11-11 11:47:13 +01:00
Bruno Windels
65d02072c8 hook up UI 2020-11-11 11:47:05 +01:00
Bruno Windels
7088b2cdc8 support attachment upload and sending from room api 2020-11-11 10:47:55 +01:00
Bruno Windels
2cfffa015d WIP 2020-11-10 22:36:26 +01:00
Bruno Windels
c65e8bea11 clean up properly 2020-11-10 19:05:50 +01:00
Bruno Windels
2d8000d11d file tile view 2020-11-10 17:50:53 +01:00
Bruno Windels
a3ca0feda9 file tile view model 2020-11-10 17:50:38 +01:00
Bruno Windels
373a42c7a8 allow downloading plaintext attachments also, with or without cache 2020-11-10 17:49:48 +01:00
Bruno Windels
a4f610ad3f support emotes 2020-11-10 15:13:31 +01:00
Bruno Windels
fd498b3d24 no need to keep track of promise, fn is internally rate-limited now 2020-11-10 14:02:07 +01:00
Bruno Windels
44a2febce9 hook it up 2020-11-06 23:43:02 +01:00
Bruno Windels
9f453c0984 fix #152 2020-11-05 21:19:34 +01:00
Bruno Windels
c9147e6b9a implement first draft of image lightbox 2020-10-30 15:20:11 +01:00
Bruno Windels
7d81306a49 return BufferHandles from the media repository
BufferHandles are platform specific handles to a buffer. On web,
they have a .blob and .url property.
2020-10-30 15:18:27 +01:00
Bruno Windels
68a0dd30ca add lightbox navigation and basic view & view model 2020-10-29 11:12:32 +01:00
Bruno Windels
fe6e4464fd pass all viewmodel options to tile view models 2020-10-29 11:10:34 +01:00
Bruno Windels
862a0ba56b show image decryption error 2020-10-29 10:29:08 +01:00
Bruno Windels
d1e78a735a show error in label for now 2020-10-29 10:18:05 +01:00
Bruno Windels
97c3a4b8f3 store error when loading encrypted images 2020-10-27 16:21:08 +01:00
Bruno Windels
e7ff6decbf remove unneeded quotes 2020-10-27 16:20:41 +01:00
Bruno Windels
77dca5dd55 add update parameter when replacing tile 2020-10-27 16:19:36 +01:00
Bruno Windels
fcc4c21ad2 filter mime types for blob urls 2020-10-27 14:35:33 +01:00
Bruno Windels
ee1e62207c apply platform changes to decrypting images 2020-10-26 17:18:17 +01:00
Bruno Windels
3ed5ea8b0b Merge branch 'master' into bwindels/decrypt-images 2020-10-26 17:08:29 +01:00
Bruno Windels
1a518cdd28 more refactor fixes 2020-10-26 16:31:30 +01:00
Bruno Windels
03351d2e1f extract platform class to put all platform specific code in 2020-10-26 15:44:11 +01:00
Bruno Windels
2e0d1363c7 fix 2020-10-26 10:16:23 +01:00
Bruno Windels
a6224135e3 extract blob url code to platform (WIP) 2020-10-26 10:14:46 +01:00
Bruno Windels
cbd48aa528 only load main image when clicking thumbnail 2020-10-26 09:49:42 +01:00
Bruno Windels
3a6268f0c1 basic PoC of image decryption working
needs looooaaads of cleanup still
2020-10-23 17:25:11 +02:00
Bruno Windels
df8eed14aa expose whether we already have a 4s key,to show the 4s setup in settings
it's a tri-state of null/false/true with null meaning we need to
go online first to know as only then we try to setup session backup
2020-10-23 12:57:47 +02:00
Bruno Windels
7459985e00 show storage usage in settings 2020-10-20 17:50:43 +02:00
Bruno Windels
1e1b254678 adjust prop names 2020-10-20 15:26:22 +02:00
Bruno Windels
601bdbb25d make session backup banner dismissable 2020-10-20 14:42:17 +02:00
Bruno Windels
6f09bd97b6 move setting view models in own dir / file 2020-10-20 12:10:41 +02:00
Bruno Windels
6f82d81f39 better session backup ui 2020-10-19 18:29:13 +02:00
Bruno Windels
1e599be142 Merge branch 'master' into bwindels/settings-screen 2020-10-19 13:45:17 +02:00
Bruno Windels
6bf8e976cb don't assign timelineVM before loaded, so prop doesn't return it
... if the binding happens to be evaluating (which it was during mount)

follow-up from bwindels/fix-crash-switch-rooms-too-fast
2020-10-19 13:39:19 +02:00
Bruno Windels
f07b4a6554
Merge pull request #167 from vector-im/bwindels/fix-redirects
Fix back button not working when changing rooms
2020-10-19 11:01:07 +00:00
Bruno Windels
cdcdc07c06 fix a crash when switching rooms before the messages have loaded
as we were not disposing the timeline view model
(but still not leaking though)
2020-10-19 12:57:21 +02:00
Bruno Windels
8357260133 fix an applying an url also pushing a copy of the url back on history
it should replace instead, as it is a redirect
2020-10-19 12:55:42 +02:00
Bruno Windels
974f77a71d WIP 2020-10-16 18:06:20 +02:00
Bruno Windels
90435a8fb7 semicolons, add them 2020-10-16 15:48:49 +02:00
Bruno Windels
e599d8b6fa also clear 2020-10-16 15:47:13 +02:00
Bruno Windels
74e6d018f4 ensure url creation does not race on the current path of the navigation 2020-10-16 15:46:06 +02:00
Bruno Windels
5a30855227 rename urlRouter option in view models to urlCreator 2020-10-16 13:02:21 +02:00
Bruno Windels
788bce7904 reduce navigation boilerplate
this makes the url router adjust the url when the navigation path is
changed, instead of doing urlRouter.applyUrl() and
urlRouter.history.pushUrl().

This history field and applyUrl method on URLRouter are now private,
as the URLRouter should only be used to generate urls you want to
put in an <a href="..."></a>, anything else should use navigator.push()
2020-10-16 12:46:14 +02:00
Bruno Windels
7c2fc516bb restore last url if not providing a specific one on startup 2020-10-14 15:10:32 +02:00
Bruno Windels
4f46854362 add close session button 2020-10-14 14:54:46 +02:00
Bruno Windels
d96f8adcc7 fix back button in room header not working 2020-10-14 14:53:52 +02:00
Bruno Windels
6ad7be8726 fix leaking left panel view model after closing session 2020-10-14 11:34:34 +02:00
Bruno Windels
fa8bec0b56 fix room view model being leaked when closing session 2020-10-14 11:26:10 +02:00
Bruno Windels
3d327b0875 also open the initial room in the room list 2020-10-14 10:20:00 +02:00
Bruno Windels
2333a959a2 actually apply the /session/<id> url after login! 2020-10-13 17:10:28 +02:00
Bruno Windels
ab354e9f38 update prop type 2020-10-13 15:19:54 +02:00
Bruno Windels
afbfb0c82c anticipate non-found rooms 2020-10-13 15:18:13 +02:00
Bruno Windels
081820d8fb also update view when going to an not-found room 2020-10-13 15:14:07 +02:00
Bruno Windels
a14795e3f8 unused 2020-10-13 15:05:11 +02:00
Bruno Windels
d1d675ed7a make navigation observables already return new value before they emit 2020-10-13 14:54:57 +02:00
Bruno Windels
7f3e0f237b also do redirect after initial navigation 2020-10-13 14:43:45 +02:00
Bruno Windels
1780f334ea more tests 2020-10-13 13:13:47 +02:00
Bruno Windels
d9c8a6339e support empty strings for rooms segment 2020-10-13 13:13:35 +02:00
Bruno Windels
7b13e45e19 fix creating the rooms segment 2020-10-13 13:13:15 +02:00
Bruno Windels
a360d0a2b9 also unset room vm if moving away from room 2020-10-13 13:12:49 +02:00
Bruno Windels
379d65edf1 also create new vm when coming for grid if transfering vm fails 2020-10-13 13:12:30 +02:00
Bruno Windels
77a58041eb clean-up room grid initialization with vm transfering
also handle duplicate rooms, and add unit tests for grid vm
2020-10-13 13:11:19 +02:00
Bruno Windels
db5c98a706 support reassigning to null from untrack 2020-10-13 13:10:27 +02:00
Bruno Windels
4e8e9eae26 first round of fixes 2020-10-12 18:31:55 +02:00
Bruno Windels
14d2dcbc60 remove dead code 2020-10-12 17:49:41 +02:00
Bruno Windels
b2d6b7014b first draft of url navigation for grid 2020-10-12 17:49:06 +02:00
Bruno Windels
6c2c29a7da WIP 2020-10-09 19:43:11 +02:00
Bruno Windels
927e8134d3 use url navigation in root view model
also track all view models as it is
important everything is properly disposed now
2020-10-09 17:03:38 +02:00
Bruno Windels
35e85c55e0 use urls instead of callbacks to navigate in session picker 2020-10-09 17:03:13 +02:00
Bruno Windels
0f8f558889 dispose session container from view model 2020-10-09 17:01:22 +02:00
Bruno Windels
d48bbd122a make applyUrl and history public
so we don't need to bother with silent flags in replaceUrl
2020-10-09 17:00:19 +02:00
Bruno Windels
35b83b7976 make SessionLoadViewModel transfer ownership of container with callback
also, deleting the session when navigating away is now done by
LoginViewModel
2020-10-09 16:59:34 +02:00
Bruno Windels
41c1c9a6c3 rename Brawl -> Root
one of the last occurrences of brawl
2020-10-09 09:59:59 +02:00
Bruno Windels
696e7856f8 some cleanup 2020-10-09 09:56:01 +02:00
Bruno Windels
00bd4364f0 early draft of loading session via url scheme 2020-10-08 18:23:37 +02:00
Bruno Windels
087aff4ef4 set to true if undefined passed in as well 2020-10-08 18:23:08 +02:00
Bruno Windels
4fe971775c more url router work, differentiate between path and url
rename hashobservable to history
2020-10-08 18:22:36 +02:00
Bruno Windels
5c2425796c Merge branch 'master' into bwindels/url-routing 2020-10-08 16:33:19 +02:00
Bruno Windels
2cbe349a4d don't read private parts 2020-10-08 14:21:34 +02:00
Bruno Windels
47a43869e6 fix grid layout in IE 11
this brings back index addressing rather than x y in the grid vm,
as we need to have a css class for every position for IE 11,
as we can't use css variables and autoprefixer can
translate grid-areas
2020-10-08 14:17:43 +02:00
Bruno Windels
f6d9ffa7bb friends don't read each others private properties 2020-10-07 14:36:08 +02:00
Bruno Windels
46b24c3f24 fix room not changing when not in grid view 2020-10-07 14:32:57 +02:00
Bruno Windels
537972b97b clarify comment 2020-10-07 14:25:32 +02:00
Bruno Windels
99ff387dec index the room by x,y instead of index from the view
so it is easier to implement a focus-ring as a separate dom node
2020-10-07 14:18:35 +02:00
Bruno Windels
b9d2da736a when opening room, focus in grid if already open 2020-10-07 13:18:19 +02:00
Bruno Windels
1ff6d36ec3 add grid toggle button to left panel 2020-10-07 12:31:52 +02:00
Bruno Windels
dc1357bb31 support clearing unread when focusing a room 2020-10-07 12:30:46 +02:00
Bruno Windels
614ec08238 integrate grid vm with session vm, allowing to switch 2020-10-07 12:25:40 +02:00
Bruno Windels
5a1d255d2a implement room grid view model 2020-10-07 12:23:02 +02:00
Bruno Windels
01ff806b86 WIP 2020-10-07 09:40:51 +02:00
Bruno Windels
b373a177ec create room url in room tile 2020-10-06 18:05:52 +02:00
Bruno Windels
221b94adbf room tile should be passed child options 2020-10-06 18:05:38 +02:00
Bruno Windels
5ab947e7de pass urlRouter and navigation as view model options 2020-10-06 18:05:02 +02:00
Bruno Windels
b8dcb249ff implement url router 2020-10-06 18:03:12 +02:00
Bruno Windels
ef428809b5 implement navigation stack 2020-10-06 18:01:56 +02:00
Bruno Windels
cac3daca72 add LeftPanelView(Model) with room filtering 2020-10-06 12:23:11 +02:00
Bruno Windels
c532cb5aea add hidden flag to room tile vm
also move to leftpanel dir
2020-10-06 12:21:11 +02:00
Bruno Windels
3359d49161 off both passphrase and security key options 2020-09-21 19:19:55 +02:00
Bruno Windels
1d33ab20a5 fix decrypted tiles not corresponding to a tile 2020-09-18 13:36:16 +02:00
Bruno Windels
ed913ca24b add dispose to room encryption 2020-09-18 13:08:18 +02:00
Bruno Windels
2de406afa0 log secret storage error as well 2020-09-18 12:12:19 +02:00
Bruno Windels
6375574a56 show error 2020-09-17 18:59:40 +02:00
Bruno Windels
5b45c00322 switch to security key 2020-09-17 18:55:28 +02:00
Bruno Windels
fe5b732c97 cleanup, better copy text 2020-09-17 18:54:55 +02:00
Bruno Windels
494c5cbcf0 notify UI when we need session backup 2020-09-17 18:00:00 +02:00
Bruno Windels
a11b612640 await this 2020-09-14 17:45:02 +02:00
Bruno Windels
b2e6e8687e dispose tiles
also add more defence against emitting event when disposed
2020-09-14 17:44:37 +02:00
Bruno Windels
9ea961ae53 don't crash when we don't have a subscription anymore 2020-09-14 17:43:06 +02:00
Bruno Windels
8555fd5f18 a little extra caution 2020-09-14 15:47:00 +02:00
Bruno Windels
aa5d55bbf2 show when e2ee is enabled in timeline 2020-09-14 15:47:00 +02:00
Bruno Windels
8c4d68def9 show decryption errors in timeline 2020-09-14 15:47:00 +02:00
Bruno Windels
4875095ea3 fix event tiles not updating when event is decrypted when room keys come 2020-09-11 17:47:35 +02:00
Bruno Windels
0dece5b04f make continuation logic work well with pending events
- don't use display name to compare but user id
   (pending doesn't have display name yet)
 - use current time as timestamp
2020-09-11 11:43:40 +02:00
Bruno Windels
843e3e6b1c show encrypted status of room 2020-09-11 11:35:53 +02:00
Bruno Windels
de1cc0d739 abort decrypt requests when changing room 2020-09-10 17:43:01 +02:00
Bruno Windels
0bf1723d99 Worker WIP 2020-09-10 15:40:30 +01:00
Bruno Windels
fdbc5f3c1d WIP worker work 2020-09-10 13:00:11 +02:00
Bruno Windels
f8e3a75471 fix typo 2020-09-09 10:22:29 +02:00
Bruno Windels
4c1aaaf416 show "setting up encryption keys..." step during login 2020-09-08 17:16:34 +02:00
Bruno Windels
c32ac2c764 use decryption result to show message verification status in timeline 2020-09-08 10:50:39 +02:00
Bruno Windels
5a12904cc3 log errors during session load 2020-09-02 14:54:57 +02:00
Bruno Windels
cfa011a317 remove room list sorting logging, works well now 2020-08-31 16:21:12 +02:00
Bruno Windels
6a9cbf7f33 store and sort by m.lowpriority tag 2020-08-27 20:52:51 +02:00
Bruno Windels
05821b0fdf use same check for timestamp validity as timestamp can be undefined sometimes 2020-08-27 12:42:38 +02:00
Bruno Windels
1a6931129b log as info 2020-08-27 10:50:30 +02:00
Bruno Windels
9e891c3442 log actual timestamps as well
so we can see if they are anything but null or a number
2020-08-27 10:48:12 +02:00
Bruno Windels
4b682ad930 use the same check when seeing if either does not have a timestamp 2020-08-27 10:45:20 +02:00
Bruno Windels
41a7448c74 add logging for room list sorting 2020-08-27 10:40:49 +02:00
Bruno Windels
59443e6602 close the room tile view model as well when closing a room so it does not stay selected 2020-08-27 10:07:47 +02:00
Bruno Windels
b39c15d88d Room.name can actually return null now
so protect against this, and fall back to "Empty Room"
2020-08-21 18:14:32 +02:00
Bruno Windels
f551010968 render badge on room 2020-08-21 15:50:47 +02:00
Bruno Windels
5837aed346 remove obsolete comment 2020-08-21 14:27:16 +02:00
Bruno Windels
00e20d2088 take null timestamps into account 2020-08-21 14:11:26 +02:00
Bruno Windels
5d1bc61f61 don't open a room when already open 2020-08-21 13:45:55 +02:00
Bruno Windels
eae5bc4230 sort unread rooms first, then on last message timestamp, then alphabet. 2020-08-21 11:58:05 +02:00
Bruno Windels
dbf5e59d87 clear unread state 2s after opening the room 2020-08-21 11:57:49 +02:00
Bruno Windels
89392434ad render unread rooms as bold 2020-08-21 11:57:38 +02:00
Bruno Windels
f0d0dbb30f fix member event reporting 2020-08-20 17:43:51 +02:00
Bruno Windels
4fefe94302 render avatar in room header 2020-08-20 17:33:08 +02:00
Bruno Windels
00718c582a render avatar img in room list 2020-08-20 17:32:55 +02:00
Bruno Windels
cff39019cb extract renderAvatar
and use avatarTitle instead of sender for img title
2020-08-20 17:32:18 +02:00
Bruno Windels
59bdd2b015 render avatar on message tiles 2020-08-20 16:03:52 +02:00
Bruno Windels
5d0ee21267 move mxcUrl functions to media repo class 2020-08-20 15:40:43 +02:00
Bruno Windels
843f4fa0f7 fix flood issue when back-filling isn't available 2020-08-20 15:28:22 +02:00
Bruno Windels
036b305c96 use display name for room name change tiles 2020-08-20 15:24:16 +02:00
Bruno Windels
d31a1b5fff render display name in timeline 2020-08-20 10:26:28 +02:00
Bruno Windels
9ff4f3839c Merge branch 'master' into bwindels/memberlist 2020-08-19 12:13:38 +02:00
Bruno Windels
2526198251 replace usage of readPath with ?. 2020-08-19 11:36:43 +02:00
Bruno Windels
614a00b741 don't continue messages from more than 5min ago 2020-08-19 10:28:09 +02:00
Bruno Windels
fad728069a don't show date & time on pending events 2020-08-19 10:27:27 +02:00
Bruno Windels
1c779cf95c render encrypted tiles as such so we don't fetch the whole history 2020-08-17 17:41:57 +02:00
Bruno Windels
0b1d9bf25e unused now 2020-08-17 17:41:49 +02:00
Bruno Windels
37597e2acb mark fragment in storage when start of timeline is reached
so we don't keep looping to fetch more messages
when scrolled all the way up
2020-08-17 17:41:10 +02:00
Bruno Windels
08de7c3569 loading screen while loading timeline
so we can set timelineVM directly to TimelineList
2020-08-17 16:34:25 +02:00
Bruno Windels
1e4f331989 fill top gap instead of loading more events from storage 2020-08-17 15:13:12 +02:00
Bruno Windels
cf0af775e3 make SimpleTile inherit from ViewModel
to use same update mechanism and have viewmodel infra available for tile
2020-08-17 15:11:39 +02:00
Bruno Windels
9745c58144 use readPath in ImageTile 2020-08-17 14:20:54 +02:00
Bruno Windels
0d3ab21044
Merge pull request #19 from vector-im/bwindels/small-bits
Various small bits
2020-08-17 12:15:28 +00:00
Bruno Windels
b5e7131050 only use 1 letter for avatar initial 2020-08-17 10:47:47 +02:00
Bruno Windels
404e6f8b87 make alphabetical sort order stable 2020-08-17 10:47:27 +02:00
Bruno Windels
70e6515b5c dont crash on m.image without url 2020-08-17 10:29:29 +02:00
Bruno Windels
c12ecd6cc1 style session picker 2020-08-14 14:49:15 +02:00
Bruno Windels
19e5d310e0 move avatar one level lower because we'll need it in the session picker 2020-08-14 14:33:13 +02:00
Bruno Windels
61801ee2cd add send button to composer 2020-08-13 18:10:45 +02:00
Bruno Windels
44cc691c79 add avatar and sender user colors 2020-08-13 12:41:00 +02:00
Bruno Windels
5aacf85166 mark room tile as active when clicked 2020-08-12 17:40:41 +02:00
Bruno Windels
7f50e3d137 allow overriding the "emit change" mechanism in ViewModel
so view models that should send updates through their collection
can still use the same "emitChange" method on ViewModel
2020-08-12 17:39:11 +02:00
Bruno Windels
00a85697ab add license header in all source files 2020-08-05 18:38:55 +02:00
Bruno Windels
f5d3092031 WIP 2020-06-26 23:26:24 +02:00
Bruno Windels
e2c8b5e595 pass vm field to emitChange 2020-06-24 22:43:29 +02:00
Bruno Windels
2b17d0f691 spell height correctly 2020-05-09 21:21:55 +02:00
Bruno Windels
7f221cda65 show images intimeline 2020-05-09 20:02:08 +02:00
Bruno Windels
c55a197303 pass options to parent in LoginViewModel 2020-05-07 19:17:15 +02:00
Bruno Windels
b65da9b8a9 display sync errors in status bar 2020-05-07 00:05:21 +02:00
Bruno Windels
06fc3101e8 make login view enabled again if load view is not busy anymore 2020-05-06 23:44:52 +02:00
Bruno Windels
c4b17e4be6 cleanup SessionViewModel, use ViewModel dispose infrastructure 2020-05-05 23:17:27 +02:00
Bruno Windels
3adc609e07 implement session status bar, with feedback on connection status 2020-05-05 23:16:51 +02:00
Bruno Windels
b0e59c30dd correctly pass options to ViewModel ctor 2020-05-05 23:14:58 +02:00
Bruno Windels
d7a8b1616a use t.view for room sub views
also move composer to own vm
2020-05-04 22:23:43 +02:00
Bruno Windels
1fa14a99e9 correctly wait for catchup sync 2020-05-04 19:38:23 +02:00
Bruno Windels
cc87e35f23 use ViewModel super class for all view models that need binding 2020-05-04 19:23:11 +02:00
Bruno Windels
d3f7fb5089 prototype how i18n would look like 2020-04-30 18:27:59 +02:00
Bruno Windels
8bde627cdb more WIP 2020-04-29 10:10:20 +02:00
Bruno Windels
657ec9aa62 move loading view state to own view model, so we're more free how to show it, and we can better reuse it 2020-04-23 09:06:04 +02:00
Bruno Windels
acc511e69f extract loading into a sub viewmodel
to show the loading in a separate view
2020-04-22 21:53:55 +02:00
Bruno Windels
b2954fd774 extract loadLabel logic to reuse in SessionPickerViewModel 2020-04-22 21:53:37 +02:00
Bruno Windels
0424ffe231 disable this for now as sync is not an EventEmitter anymore 2020-04-22 20:53:57 +02:00
Bruno Windels
449262e3c1 adjust ctor of SessionViewModel to accept sessionContainer now 2020-04-22 20:52:56 +02:00
Bruno Windels
e37101210c adjust LoginView(Model) further to showing loading status in place 2020-04-22 20:52:28 +02:00
Bruno Windels
96aa4f83b9 remove loading section in BrawlView 2020-04-22 20:49:49 +02:00
Bruno Windels
c95981a35d remove unused code 2020-04-20 23:10:33 +02:00
Bruno Windels
b32f5711bf port BrawlViewModel to SessionContainer 2020-04-20 23:10:13 +02:00
Bruno Windels
f4983b5ba6 port SessionPickerViewModel to SessionContainer 2020-04-20 22:49:14 +02:00
Bruno Windels
a5965ad378 port LoginViewModel over to SessionContainer 2020-04-20 22:48:56 +02:00
Bruno Windels
31f3886eba move EventEmitter to utils 2020-04-20 21:35:53 +02:00
Bruno Windels
001dbefbcf stop using default exports
because it becomes hard to remember where you used them and where not
2020-04-20 21:26:39 +02:00
Bruno Windels
87b23d062c fix imports after reshuffleling 2020-04-20 19:47:45 +02:00
Bruno Windels
80f7caadbe rename SessionsStore to SessionInfoStorage 2020-04-19 19:13:38 +02:00
Bruno Windels
1f15ca6498 more WIP 2020-04-18 19:16:16 +02:00
Bruno Windels
378b75c98a more WIP and breakage 2020-04-09 23:19:49 +02:00
Bruno Windels
ef267ca331 WIP2 2020-04-05 15:11:15 +02:00
Bruno Windels
e4563135bf look at prev_content when handling member events 2020-03-30 21:59:44 +02:00
Bruno Windels
c830f50325 catch errors while persisting a new message 2020-03-30 21:33:04 +02:00
Bruno Windels
6d68ec1bac move fillGap to room 2020-03-21 23:40:40 +01:00
Bruno Windels
f729108226 pass emit update fn through setter so we control when tile can update 2020-03-21 14:28:09 +01:00
Bruno Windels
a3714f49cc group public methods for a tile together 2020-03-21 14:26:56 +01:00
Bruno Windels
4176af56ea add failing test for problem 2020-03-21 14:22:16 +01:00
Bruno Windels
35c090dcb4 add proper import/export functionality 2019-12-14 18:29:35 +01:00
Bruno Windels
d073f2825b show json in one line when clearing cache
also make naming consistent
2019-10-24 10:54:20 +02:00
Bruno Windels
d34a0c73b5 show json in list instead of alert so we can copy it 2019-10-13 08:29:23 +02:00