Commit graph

193 commits

Author SHA1 Message Date
Travis Ralston
b0b7932f5f Move status context menu to its own component
This fixes a lot of the state bugs such as buttons not updating, etc. 

This commit also adds the border around the avatar to indicate a status is set.
2018-12-12 22:26:39 -07:00
Travis Ralston
a91963e5ee Replace the avatar next to the composer with a status entry menu
The checkmark might change, and there appears to be some state tracking mishaps that need to be worked out.

Part of https://github.com/vector-im/riot-web/issues/1528
2018-12-12 18:03:30 -07:00
Aaron Raimist
49ce4ef117
eslint --fix src/
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-26 22:50:38 -05:00
Bruno Windels
0767c278e7 put userId next to member in read receipt, fall back when member missing 2018-10-10 16:14:09 +02:00
Bruno Windels
debcc20604 also show spinner on new CATCHUP state 2018-08-30 15:39:48 +02:00
Bruno Windels
d7868dbe33 delegate avatar selection to room for rooms with two members (but not in m.direct) 2018-08-30 10:54:01 +02:00
Bruno Windels
06160f5fae fix lint 2018-08-27 18:52:33 +02:00
Bruno Windels
6a077655e9 bring back old behaviour to also show member avatars if not marked as 1:1 room 2018-08-27 18:48:21 +02:00
Bruno Windels
36665d3c69 Fix: dont show 1:1 avatar for room with only 2 members loaded 2018-08-27 17:40:31 +02:00
Matthew Hodgson
8a1bd8da69 tell eslint to ignore viewAvatarOnClick being unused 2018-05-06 00:22:14 +01:00
Matthew Hodgson
500f58a963 fix deeply irritating react warning about viewAvatarOnClick on BaseAvatar 2018-05-05 23:25:50 +01:00
Aidan Gauland
6a918861bb Add UI for displaying room avatars full size
Change the onClick action on the RoomAvatar inside RoomHeader so that it brings
up a lightbox with the full-size avatar.
2018-04-21 15:47:31 +12:00
Travis Ralston
fe2cbc584d Merge branch 'develop' into travis/remove-presence 2018-04-11 15:17:28 -06:00
Luke Barnard
d877384d64
Merge pull request #593 from matrix-org/luke/fix-render-1-1-avatars-when-others-leave
Use correct 1-1 room avatar after users leave
2018-04-11 11:21:18 +01:00
Luke Barnard
8ca1243ecb Add null-guard to prevent RoomAvatar NPE when room is null
which may have been occuring when peeking into a room that the
client hasn't got a Room object for.

Fixes https://github.com/vector-im/riot-web/issues/6432
2018-04-03 17:35:34 +01:00
Luke Barnard
c903cc6375 Fix tests 2018-03-14 14:55:36 +00:00
Luke Barnard
8672b97f9a Improve room list performance when receiving messages
In summary this makes RoomTiles (and RoomAvatars) do more for
themselves in terms of reacting individually to state changes in
the js-sdk.

Instead of force updating the entire room list for avatar changes
and room name changes, do this in the RoomTile and RoomAvatar
instead. This increases the number of listeners listening to the
matrix client, but allows us to properly implement a
shouldComponentUpdate for RoomTile (because the avatar, name and
notification count are now in component state)
2018-03-14 14:29:55 +00:00
David Baker
d416b9d7d1 Copyright 2018-03-12 15:24:32 +00:00
David Baker
ac85938186 Fix syntax fail 2018-03-12 15:23:22 +00:00
lukebarnard
2549b44768 Linting 2018-02-07 18:57:32 +00:00
Luke Barnard
cf4ae681f4
Offline mode (#1723)
* Allow the client to run without connection to HS (i.e. using indexeddb)

Allows running without having pushRules (it's safe not to have these 
when running from indexeddb sync.)

This means rooms will be displayed with "unknown" notifcation state.

This assumes anything that uses the push rules will get pushRule state
again when the client starts syncing again.

For recovering from being disconnected, 
* If an avatar has fallen back, try again on reconnection
* If a thumbnail image failed to load, retry on reconnect
* Load joined groups when reconnecting

Update tests to give MELS a context.matrixClient
2018-02-06 17:50:53 +00:00
Luke Barnard
121b776e8a
Merge branch 'develop' into luke/fix-render-1-1-avatars-when-others-leave 2018-02-06 16:46:25 +00:00
Aidan Gauland
35780f5ae0 Remove use of deprecated React.PropTypes
Replace all uses of React.PropTypes with PropTypes and importing PropTypes from
'prop-types'.
2017-12-26 14:03:18 +13:00
Travis Ralston
cc5eb77658 Remove presence management
The feature is incredibly buggy and doesn't work as expected due to server behaviour and client interaction. One of the major problems is the constantly confused presence state - this is caused by the mobile apps conflicting on the state of the web app, causing it to consider the user offline or online (and rarely away) depending on how riot-android/ios is behaving at the time.

This reverts two PRs:
* https://github.com/matrix-org/matrix-react-sdk/pull/1620
* https://github.com/matrix-org/matrix-react-sdk/pull/1482

The changes to the context menu positioning were not reverted as they are useful outside of presence management.

Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-12-25 14:25:13 -07:00
Travis Ralston
5f3fda2950
Update MemberPresenceAvatar.js
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-11-21 09:01:56 -07:00
Travis Ralston
28ff0a4ee7 Disable presence controls if there's no presence
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-11-17 22:25:15 -07:00
Richard van der Hoff
4e7fd55fb4 MemberPresenceAvatar: fix null references
avoid assuming that `member` has a `user`
2017-11-17 14:35:33 +00:00
Travis Ralston
f58e8826c0 Use the correct settings store for presence
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-11-14 19:18:04 -07:00
Matthew Hodgson
f05958e334
Merge pull request #1482 from turt2live/travis/presence
Implement user-controlled presence
2017-11-14 23:53:16 +00:00
Luke Barnard
0dcd52d88f Fix some react warnings firing 2017-11-01 17:12:22 +00:00
Luke Barnard
14d600a69f Fix initial in GroupAvatar in GroupView 2017-10-30 15:04:12 +00:00
Travis Ralston
e773585a02 Merge remote-tracking branch 'matrix-org/develop' into travis/presence
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-10-25 11:21:39 -06:00
Luke Barnard
e89371fb1c Add click-to-open-settings functionality to GroupAvatar 2017-10-23 14:54:57 +01:00
Luke Barnard
ea1dbe1f76 Fix invites to groups without names 2017-10-19 15:47:52 +01:00
Travis Ralston
7307bc412f Respond to updates from presence context menu
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-10-14 23:16:12 -06:00
Travis Ralston
c483717282 Make onClick be a context menu for presence
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-10-14 21:44:07 -06:00
Travis Ralston
788e16a716 Linting
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-10-14 20:23:50 -06:00
Travis Ralston
0b20681f6a Put presence management behind a labs setting
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-10-14 19:13:46 -06:00
Travis Ralston
6cd07731c4 Add MemberPresenceAvatar and control presence ourselves
Includes rudimentary support for custom statuses and user-controlled status. Some minor tweaks have also been made to better control how we advertise our presence.

Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-10-14 14:37:47 -06:00
Luke Barnard
d3f9a3aeb5 Run eslint --fix
Fixing 1000s of lint issues. Some rules cannot be `--fix`ed but this goes some way to linting the entire codebase.
2017-10-11 17:56:17 +01:00
Luke Barnard
f3b6b2cc06 Fix GroupView summary rooms displaying without avatars
- GroupView can now render with rooms in the summary that do not have an avatar
 - RoomAvatar no longer has a redundant fallback avatar (this is handled by BaseAvatar)
 - RoomAvatar was delinted
2017-09-27 16:18:15 +01:00
David Baker
c2034d5335 Add user list to groups 2017-07-25 15:56:16 +01:00
David Baker
4e49ebd6ce Change incorrect refs to this.props 2017-07-11 14:31:07 +01:00
David Baker
c1833f9833 Merge remote-tracking branch 'origin/dbkr/my_groups' into dbkr/groups_better_groupview 2017-07-07 13:44:35 +01:00
David Baker
183f45bc1f Fix lint errors 2017-07-07 10:41:59 +01:00
David Baker
fa37d03db6 Improve the Group View page
Show the rooms in the group in thir various categories, etc
2017-07-06 19:13:14 +01:00
David Baker
3b06db0725 Pass with, height & resizeMethod through
Was spelt wrong anyway
2017-07-05 11:39:22 +01:00
David Baker
c07057d1d4 Extract props we don't want to pass to BaseAvatar 2017-06-30 16:05:19 +01:00
David Baker
84e13d5437 Add GroupAvatar to handle fallback images etc.
And a few misc tidyups
2017-06-29 17:51:38 +01:00
Luke Barnard
defecb1b14 Implement /user/@userid:domain?action=chat
This is a URL that can be used to start a chat with a user.
 - If the user is a guest, setMxId dialog will appear before anything and a defered action will cause `ChatCreateOrReuseDialog` to appear once they've logged in.
 - If the user is registered, they will not see the setMxId dialog.

fixes https://github.com/vector-im/riot-web/issues/4034
2017-06-02 11:36:18 +01:00
Robert Swain
39de37b547 *Avatar: Calculate thumbnail dimensions based on devicePixelRatio
Multiply the dimension by the device pixel ratio and then round it to
get the width/height of the thumbnail to use in the request.
2017-04-27 12:38:03 +02:00
Robert Swain
3d507e9840 (Room)?Avatar: Request 96x96 avatars on high DPI screens 2017-04-21 00:05:52 +02:00
David Baker
e7a32faf64 Wrap multiline JSX in parens 2017-02-02 18:47:24 +00:00
David Baker
10edab06a6 Don't c+p the complex markup 2017-02-02 18:41:50 +00:00
David Baker
7484cc3f70 Make default avatars clickable
BaseAvatar can be passed an onClick which is called when it's, er,
clicked, except when it was the default avatar in which case it
merrily ignored it. Make it not ignore it.
2017-02-02 18:29:33 +00:00
David Baker
b561b711df Fix expanding/unexapnding read receipts
Make the AccessibleButton element be the img directly rather than
wrapping it in a div which is unnecessary and breaks the rendering.

Fixes https://github.com/vector-im/riot-web/issues/3052
2017-02-02 17:36:26 +00:00
Richard van der Hoff
770820e6fa Fix a bunch of lint complaints 2017-01-24 22:41:52 +00:00
Richard van der Hoff
6dd46d532a Merge remote-tracking branch 'origin/develop' into rav/hotkey-ux 2017-01-24 20:47:24 +00:00
David Baker
18d4d3392a Fix a bunch of linting errors
eslint --fix and a few manual ones
2017-01-20 14:22:27 +00:00
Jani Mustonen
959163f2ef Proper accessible buttons 2017-01-13 19:36:41 +02:00
Jani Mustonen
d2ff2715ce Buttonified almost everything. Stylesheet is broken. 2017-01-13 19:36:40 +02:00
Luke Barnard
714b63519a Remove empty line 2016-12-20 11:50:35 +00:00
Luke Barnard
583f86eb06 Handle the case where the other 1-1 user left 2016-12-19 18:41:34 +00:00
Luke Barnard
10017522e2 Use correct 1-1 room avatar after users leave
The correct 1-1 avatar is used with rooms in which there are only two users with either "join" or "invite" as their membership (importantly, not "leave" or otherwise).

(This is important when a user moves accounts and re-joins previously left 1-1 chats)
2016-12-19 17:59:13 +00:00
Kegan Dougal
bd7553d1ea Add read receipt times to the hovertip of read markers
Fixes #2709. Surprisingly, this data was never passed down to
ReadReceiptMarker.
2016-12-08 16:23:20 +00:00
Luke Barnard
beecbc7cd7 Fix join/part collapsing regressions (#553)
* Fix join/part collapsing regressions

* Simplify loop

* Explain e,e

* Explain return null in _renderSummary

* Kill it properly

* Move . to _renderSummary

* Only use the first and last events to decide whether a net change has occured

* Do not sort events by TS before summarising

* fix loop and comment

* remove data-number-events

* Better explanation comment in _renderSummary

* Less tortuous comment
2016-11-16 14:42:30 +00:00
Luke Barnard
5109833c42 Use correct prop types 2016-11-11 13:55:32 +00:00
Luke Barnard
0695037f5f pass in prop onClick by default 2016-11-10 17:30:35 +00:00
Luke Barnard
87e8f0e4da trailing commas 2016-11-10 17:27:59 +00:00
Luke Barnard
d8bc4d9a6f Factor out avatar click leads to view_user 2016-11-10 15:18:59 +00:00
Matthew Hodgson
5df98d70f4 add debugging to MemberAvatar to try to kick jenkins... 2016-08-27 01:18:48 +01:00
Aviral Dasgupta
4c1dcb924b reskindex and use sdk.getComponent for EmojiText 2016-08-11 07:55:12 +05:30
Aviral Dasgupta
09e8a45cde Add EmojiText component for emoji replacement. 2016-08-10 00:31:51 +05:30
Richard van der Hoff
124a816751 Silence some more react warnings
Remove some spurious props which were causing react warnings
2016-08-01 17:10:46 +01:00
Richard van der Hoff
39ae8c6e46 formatting
PR feedback
2016-07-27 15:41:24 +01:00
Richard van der Hoff
1a600b0674 Stop the Avatar classes setting properties on <span>s
React apparently now checks the properties which are set on DOM elements, and
grumbles noisily about unexpected ones. Update BaseAvatar and RoomAvatar so
that they don't set unrelated properties on the DOM elements.
2016-07-27 11:38:04 +01:00
Aviral Dasgupta
020f1f4320 feat: emojify ALL THE THINGS! 2016-07-05 10:16:17 +05:30
Richard van der Hoff
5706a879d0 Hack around absence of String.codePointAt on PhantomJS
I've been trying to get some tests working under PhantomJS, which appears not
to support String.codePointAt (which is, to be fair, an ES6 addition). For our
limited usecase, it's easier to implement the functionality from first
principles than to try to polyfill support.
2016-04-13 10:35:07 +01:00
Matthew Hodgson
005ebbd037 stop avatar mxids being copy-pastable (unless they contain an initial). should significantly improve https://github.com/vector-im/vector-web/issues/893 2016-03-15 00:21:05 +00:00
Matthew Hodgson
05a3dab528 fix roomavatars on FF 2016-03-03 16:16:40 +00:00
David Baker
2dbed2aa02 Clarify when room / oobData can/can't be set 2016-03-02 11:59:17 +00:00
David Baker
9085a2a866 Pass room metadata from 3pid invite emails all the way through to the relevant components so we can display it. 2016-03-01 18:23:57 +00:00
Will Hunt
081a975d2a Added ES6 function 'fromCodePoint' to retrive first initial for default avatars that begin with a large unicode character. 2016-02-25 16:23:38 +00:00
Kegan Dougal
f213901e29 Return early when calculating one-to-one room avatars
Object.keys() is O(n) and is wasted because we only care if the keys are 1 or 2.
Use `for .. in` instead and return early if there are >2 keys.

Profiling indicates this cuts wasted time from ~74ms to ~32ms for me (who has
a large number of rooms with large numbers of people in them).
2016-01-22 11:11:56 +00:00
Kegan Dougal
855bef17fa Fold BaseAvatar state mainly into state.urls to avoid too many code paths. 2016-01-15 17:05:05 +00:00
Kegan Dougal
d8d79722ac Make RoomAvatar use BaseAvatar 2016-01-15 16:13:25 +00:00
Kegan Dougal
cfb81a4aec Factor out avatar stuff to BaseAvatar. Make MemberAvatar use it instead. 2016-01-15 12:02:28 +00:00
Kegan Dougal
8c9352c484 Make MemberAvatar and MemberTile work without RoomMember objects 2016-01-13 16:55:28 +00:00
Matthew Hodgson
0772f50fab update copyright for 2016 2016-01-07 04:06:52 +00:00
Matthew Hodgson
c67005c306 switch avatar initial layout to work with Open Sans 2015-11-30 17:15:02 +00:00
Matthew Hodgson
960cc2d6b4 simplify avatar logic slightly 2015-11-30 14:39:42 +00:00
Kegan Dougal
1dc4e14606 Import things at the right levels 2015-11-26 13:49:39 +00:00
Kegan Dougal
7846d49403 Add missing deps; Move stuff in 'views' to have functional descriptors 2015-11-26 13:45:04 +00:00