This PR introduces the ability to upload an avatar image and display avatars of participants in a chat and people in your roster.
I've introduced two state containers SessionState and ChatSessionState. These carry state about the current user and the selected chat (See rationale here) and can be shared between reducers.
It's now possible to go into the "Edit profile" screen and upload a new avatar image by dragging & dropping it onto the avatar field in the top left.
I'm sorry that this grew so large but I had to take several shortcuts already:
There's no activity indicator nor error handling when uploading the avatar. Once you see the new image however you know that everything went well.
Avatar metadata and images are loaded eagerly as soon as the ProseCoreClient receives the roster. Images are cached between restarts however.
Images are uploaded with a maximum side-length of 600px.
Downloaded images are only cached in one size with a maximum side-length of 300px.
Resizing before the upload could be improved by distinguishing if the dragged item was a file URL or an image and then resizing the image via ImageIO and not loading the whole thing at once into memory.
I've chosen to ignore reducer lifecycle warnings at this time. I didn't want to introduce yet another concept in this PR.
Avatars from other users are not updated in real-time when changed. You need to restart to app to load the new ones. This is because I couldn't get to reliably receive pubsub notifications. marc@prose.org -> cram@prose.org worked without a problem, but not the other way around. I have to investigate that separately.
This PR introduces the ability to upload an avatar image and display avatars of participants in a chat and people in your roster.
I've introduced two state containers
SessionState
andChatSessionState
. These carry state about the current user and the selected chat (See rationale here) and can be shared between reducers.It's now possible to go into the "Edit profile" screen and upload a new avatar image by dragging & dropping it onto the avatar field in the top left.
I'm sorry that this grew so large but I had to take several shortcuts already: