Skip to content

feat: Show an email-avatar for email-contacts and email-chats #6916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 20, 2025

Conversation

Hocuri
Copy link
Collaborator

@Hocuri Hocuri commented Jun 13, 2025

Mark email-contacts and email-chats as such by setting a special avatar. Then, the UIs can remove the letter-icon from next to the name again, and we have less overall clutter in Delta Chat.

Screenshot_20250613-160033

@Hocuri Hocuri requested review from r10s and link2xt June 13, 2025 14:01
} else if self.typ == Chattype::Broadcast {
if let Ok(image_rel) = get_broadcast_icon(context).await {
} else if !self.is_encrypted(context).await? {
// This is an email-contact chat, show a special avatar that marks it as such
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mimeparser supports setting group avatars even for unencrypted chats. Should we really unsupport this? Maybe it's still better to have that "email" character at the end of the chat/contact name, but add it artificially in the core (i agree that UIs shouldn't care about this)? Green verification checkmarks are shown at the end of the name as well, would be good to unify everything somehow. One more reason: let's say i have email contacts "Alice" and "Bob" which both don't have avatars. Currently they have different colors with "A" and "B" inside which help me distinguish them, but the PR suggests they look the same.

Copy link
Collaborator Author

@Hocuri Hocuri Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mimeparser supports setting group avatars even for unencrypted chats. Should we really unsupport this?

It seems unlikely to me that this feature was in widespread use, but, sure, this is a downside of this approach.

Maybe it's still better to have that "email" character at the end of the chat/contact name, but add it artificially in the core

Like, an emoji?

The main reasoning for moving the icon into the avatar was minimizing visual clutter in the UI.

One more reason: let's say i have email contacts "Alice" and "Bob" which both don't have avatars. Currently they have different colors with "A" and "B" inside which help me distinguish them, but the PR suggests they look the same.

Yes, this is a downside.

All in all, I'm like +0.1 on this PR, because I do like the removal of visual clutter, but don't have a strong opinion on it. @r10s, who is our main UI person, after some real-life discussions around the topic, decided that we'll go for putting the icon into the avatar.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remind me why we need this email pictogram in the UIs at all? In release versions we don't have it. And if we need it, maybe it's still possible to preserve colors and put the email unicode char / emoji inside? This gray icon looks boring, e.g. i have many email threads and i'm glad to see all this spectrum. Btw, green checkmarks also clutter the UI, e.g. in WhatsApp i don't see anything like this. Just putting in one more opinion, it's fine to merge if that's already agreed

@r10s
Copy link
Contributor

r10s commented Jun 14, 2025

looks really great, just tested on iOS thanks a lot for pushing that forward.

as discussed, the "Device Chat" and the "Saved Messages" avatars got broken.

  • for the device messages, maybe because they are considered to be "unencrypted", the chat also does not have a green checkmark
  • for the saved messages, maybe because the other way round, and then somehow the "encrypted" thing takes precedence, not sure.

for both i checked the code on iOS, at least at a first glance, there is nothing special handled, on master, both avatars are displayed nicely

@Hocuri Hocuri changed the title feat: Show an email-avatar for email-contacts and email-chats [WIP] feat: Show an email-avatar for email-contacts and email-chats Jun 15, 2025
@Hocuri Hocuri force-pushed the hoc/pgp-contacts-email-avatar branch from 1858cdd to 388100e Compare June 15, 2025 21:31
Hocuri added 3 commits June 15, 2025 23:38
…_image()

Before, the icons were statefully written into the database using update_saved_messages_icon() / update_device_icon()
@Hocuri Hocuri force-pushed the hoc/pgp-contacts-email-avatar branch from 388100e to 57eaf5d Compare June 15, 2025 21:38
@Raiden-GH
Copy link

Raiden-GH commented Jun 15, 2025

I also use DC to communicate with non-DC contacts. That's why I always thought it was a shame that you can't set avatars for these contacts. As a workaround, I placed an emoji that somehow suited the person in front of their name. Other users probably do the same. For this reason, I believe this PR would worsen DC's UI and not improve it. It would make it harder to distinguish between contacts. If all DC contacts had the same avatar, that would also be a problem. Furthermore, I always liked that in DC it doesn't really matter whether a contact uses DC or not. A user selects a chat, writes a message, and that's it.

But if email contacts should be easier to identify, perhaps a small icon (envelope or @) on the bottom left side of the avatar would make sense?

E-Mail-Indikator

P.S. The avatars in the mockup image should, of course, be made of letters or emojis. I didn't notice the mistake until I was finished.

Copy link
Contributor

@r10s r10s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great! works as expected now.

for the lower differentiation among contacts in a larger non-chat-mailgroup - this is known and accepted, the advantages seem to outweigh that, so we want to give it a try. some, unsorted quick written list:

  • we have a very clear distinction between chatmail and non-chatmail now, allowing us to move forward with other signals
  • less UI cluttering
  • it is very confusing otherwise, having the same contact with the same avatar twice
  • avatars for non-chatmail cannot really be changed, so there is also a ux-failure (we might need to disallow that in the UI, however)
  • there is still the name to distinguish, similar to other mail apps
  • large non-chatmail groups are comparable rare
  • focus is clearly chatmail, it is fine to let look email a bit boring, and most distinguishable by that
  • we do not want to have more complex solutions for now, instead concentrate on making things work first, we can always iterate :)

The test was failing because the blobdir path contains `\`, which serde
interpreted as an escape.
@Hocuri Hocuri force-pushed the hoc/pgp-contacts-email-avatar branch from 6f8217c to 88eb02b Compare June 16, 2025 10:28
@Raiden-GH
Copy link

Raiden-GH commented Jun 16, 2025

I use a regular email account to keep in touch with non-DC users. That's about one-third of my total contacts in DC! For DC users, I use chatmail accounts of course. Most people probably do it this way, and only a few DC users have a regular email account to chat with other DC users.
Therefore, it's not clear to me why the distinction between chatmail and non-chatmail was ever necessary.

it is very confusing otherwise, having the same contact with the same avatar twice

I don't understand this argument. It's not a problem to use a different avatar for each profile.

Hocuri added a commit that referenced this pull request Jun 16, 2025
Previously, messages were not rewritten. This meant that all messages
stayed with the old email-identified contact.
github.com//pull/6916 made it very obvious that all
messages sent into a group before the PGP-contacts migration got the
email avatar.

With this PR, all encrypted messages are rewritten to the PGP-contact
identified by the current autocrypt key. It is not possible to find out
which key was actually used to sign the message.
@Hocuri Hocuri changed the title [WIP] feat: Show an email-avatar for email-contacts and email-chats feat: Show an email-avatar for email-contacts and email-chats Jun 16, 2025
@Hocuri
Copy link
Collaborator Author

Hocuri commented Jun 16, 2025

it is very confusing otherwise, having the same contact with the same avatar twice

I don't understand this argument. It's not a problem to use a different avatar for each profile.

If you had both an encrypted and an unencrypted chat with a contact, then there will be two contacts now - one identified by the email address, for unencrypted messages, and one identified by the PGP-key-fingerprint, for encrypted messages.

@iequidoo
Copy link
Collaborator

iequidoo commented Jun 16, 2025

  • we have a very clear distinction between chatmail and non-chatmail now

Let me clarify the wording: between pgp contacts and email contacts. We don't need to even distinguish Delta Chat contacts and others as long as they use pgp-capable clients.

  • avatars for non-chatmail cannot really be changed, so there is also a ux-failure (we might need to disallow that in the UI, however)

Avatars for ad-hoc groups can be changed, and this will be unsupported from now, but probably it's fine, not a widely used feature.

large non-chatmail groups are comparable rare

The problem is that the chatlist won't look as nice as currently. I still don't understand why we need to drop colors (we can display an "email" emoji / unicode char inside, as we do currently for the first contact's char). Coloring can't be dropped completely anyway because pgp contacts still need it. K-9 Mail also uses colors, i'd like our UI not to look much worse.

EDIT: Btw, Telegram even puts two characters into the colored avatar placeholder, so we can put there "📧A" for "Alice" f.e. I'm not saying that we really need this, just a note.

@Raiden-GH
Copy link

We don't need to even distinguish Delta Chat contacts and others as long as they use pgp-capable clients.

This is also my opinion on the matter.
DC is now designed to encourage users to create a chatmail account. The option to set up a regular account has been more or less hidden. Chatmail accounts only allow the sending and receiving of encrypted messages. So there's no danger of accidentally sending unencrypted emails. So why differentiate between chatmail and non-chatmail?

@iequidoo
Copy link
Collaborator

iequidoo commented Jun 16, 2025

So why differentiate between chatmail and non-chatmail?

I think @r10s actually wanted to say "pgp contacts (identified by pgp keys) and non-pgp contacts (identified by email addresses)" and "pgp chats (where all contacts are identified by pgp keys) and non-pgp threads".

Hocuri added a commit that referenced this pull request Jun 19, 2025
Previously, messages were not rewritten. This meant that all messages
stayed with the old email-identified contact.
github.com//pull/6916 made it very obvious that all
messages sent into a group before the PGP-contacts migration got the
email avatar.

With this PR, all encrypted messages are rewritten to the PGP-contact
identified by the current autocrypt key. It is not possible to find out
which key was actually used to sign the message.
@Hocuri Hocuri merged commit 4eb1a5e into link2xt/pgp-contacts Jun 20, 2025
52 of 53 checks passed
@Hocuri Hocuri deleted the hoc/pgp-contacts-email-avatar branch June 20, 2025 17:27
Hocuri added a commit that referenced this pull request Jun 20, 2025
Previously, messages were not rewritten. This meant that all messages
stayed with the old email-identified contact.
github.com//pull/6916 made it very obvious that all
messages sent into a group before the PGP-contacts migration got the
email avatar.

With this PR, all encrypted messages are rewritten to the PGP-contact
identified by the current autocrypt key. It is not possible to find out
which key was actually used to sign the message.
@iequidoo
Copy link
Collaborator

I still don't understand why we need to drop colors (we can display an "email" emoji / unicode char inside, as we do currently for the first contact's char)

Do i correctly understand that this would need some new API / UIs' code changes and can't be done at the moment? Some explanation is needed so that users who use Delta Chat as an email client too could be referred here because questions have already arised.

@r10s
Copy link
Contributor

r10s commented Jun 20, 2025

thanks for additional feedback.

in do not think, that would require a new api, core could generate colored images - the examples above, however are too colorful and too less distinguishable. it should be far more decent, maybe having the envelope colored.
at some point we can consider to iterate, but atm, there are much more important things to do, we like to give the avatars as now a try in practise for some time.
currently, i do not want to throw more resources at that.

note, that we do not regard delta-as-only-email-client as the primary usecase swe optimize for. traction proves that not the worse choice. if in doubt, as here, we go for chatmail. it is clear, that this is not loved by everyone

still, where not in conflict, we even aim to add things - eg to add the option to create a new email-thread, including subject :)

Hocuri added a commit that referenced this pull request Jun 23, 2025
Previously, messages were not rewritten. This meant that all messages
stayed with the old email-identified contact.
github.com//pull/6916 made it very obvious that all
messages sent into a group before the PGP-contacts migration got the
email avatar.

With this PR, all encrypted messages are rewritten to the PGP-contact
identified by the current autocrypt key. It is not possible to find out
which key was actually used to sign the message.
Hocuri added a commit that referenced this pull request Jun 23, 2025
Previously, messages were not rewritten. This meant that all messages
stayed with the old email-identified contact.
#6916 made it very obvious that all messages sent into a group before
the PGP-contacts migration got the email avatar.

With this PR, all encrypted messages are rewritten to the PGP-contact
identified by the current autocrypt key. It is not possible to find out
which key was actually used to sign the message.

---------

Co-authored-by: iequidoo <117991069+iequidoo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants