alphapapa / ement.el

A Matrix client for GNU Emacs
GNU General Public License v3.0
488 stars 44 forks source link

Support for user avatars #166

Open alphapapa opened 1 year ago

alphapapa commented 1 year ago

Support for user avatars is available in a WIP branch here: https://github.com/alphapapa/ement.el/tree/wip/user-avatars It seems to work pretty well, but it should be tested more carefully before being merged.

Stebalien commented 1 year ago

It would be nice if avatars were displayed in the margin when using elemental style sender headers. That way, the sender automatically aligns with the rest of the text.

It would be even better if we could have large multi-line avatars... but, this is emacs and doing that would require deep magic and image slicing.

alphapapa commented 1 year ago

It would be nice if avatars were displayed in the margin when using elemental style sender headers. That way, the sender automatically aligns with the rest of the text.

That would be nice, and it would imitate Element further, but it doesn't seem like Emacs handles images in margins very well. But maybe this could be improved; patches welcome.

It would be even better if we could have large multi-line avatars... but, this is emacs and doing that would require deep magic and image slicing.

Yeah...that would be nice...but...

Stebalien commented 1 year ago

That would be nice, and it would imitate Element further, but it doesn't seem like Emacs handles images in margins very well. But maybe this could be improved; patches welcome.

It worked for me in a quick hack, but getting it right-aligned seems more difficult.

(I probably won't get around to this any time soon, unfortunately).

alphapapa commented 1 year ago

It worked for me in a quick hack, but getting it right-aligned seems more difficult.

Yeah, I've tried various combinations of display properties, but I also wasn't able to get them aligned in the margins. (IIRC there's a comment somewhere in the Elisp manual that says that's not supported for images, but the details escape me.) We might be able to approximate that by using the non-margin style with wrap-prefix properties.

It would be even better if we could have large multi-line avatars... but, this is emacs and doing that would require deep magic and image slicing.

Also, that would be doubly difficult due to the header line (having the sender displayname) being a separate node in the buffer from the first following event. Synchronizing that kind of decoration when events can be received and inserted in any order would be difficult, lacking some kind of high-level UI API to automate it.

AndreiSva commented 1 year ago

If this gets implemented, it'd be nice to have an option to disable the avatars.

alphapapa commented 1 year ago

If this gets implemented, it'd be nice to have an option to disable the avatars.

Naturally.