Bug 491076 - Feature Request: do display one's own sender/recipient email address and name
Summary: Feature Request: do display one's own sender/recipient email address and name
Status: RESOLVED FIXED
Alias: None
Product: kdepim
Classification: Applications
Component: messagecore (other bugs)
Version First Reported In: unspecified
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-31 18:00 UTC by Georg Schwarz
Modified: 2024-08-01 21:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Schwarz 2024-07-31 18:00:16 UTC
KDE PIM does not display one's own email address and name, but instead replaces it with "me".
This is certainly a feature appreciated by many users, however in a language like German this looks very awkward (for details see https://bugs.kde.org/show_bug.cgi?id=469713). So it would be very desirable to be able to switch off that feature.

I dug through the code to find out that it is a feature implemented in messagecore's stringutil. 
It is quite easy to add a switch, e.g. like this to messagelib/messagecore/src/utils/stringutil.cpp

Change line 443 from

const bool foundMe = onlyOneIdentity && (im->identityForAddress(prettyAddressStr) != KIdentityManagementCore::Identity::null());

to

const bool foundMe = !(MessageCore::MessageCoreSettings::self()->displayOwnIdentity()) && onlyOneIdentity && (im->identityForAddress(prettyAddressStr) != KIdentityManagementCore::Identity::null());


and in messagelib/messagecore/src/settings/messagecore.kcfg add an item like this:

<entry name="displayOwnIdentity" type="Bool">
      <default>false</default>
    </entry>

I added it to the General group, but I'm unsure whether this is the correct approach. Moreover I'm not sure whether the messagecore settings is the right spot for such a switch.
To test it, I set the default to true and opened an email sent by me (or sent to me) in kmail2. Worked as expected.
There should also be an easy way to change the setting via the CLI, isn't there?
In addition,  it would be nice to have a UI to toggle this setting. There seems to be a convenient way in messageviewer/src/ui/settings.ui, but I could not come up with an equivalent for messagecore.
Or is having that setting in messagelib/messageviewer/src/settings/messageviewer.kcfg.in a better idea? (after all it's about displaying a message's header)
Comment 1 Laurent Montel 2024-08-01 19:20:13 UTC
Git commit 32e5ed96880b2ab858a7c3a557f8e2e69a3991cb by Laurent Montel.
Committed on 01/08/2024 at 19:19.
Pushed by mlaurent into branch 'master'.

Fix bug 491076: do display one's own sender/recipient email address and name

Implement code from 	Georg Schwarz

M  +1    -1    CMakeLists.txt
M  +3    -0    messagecore/src/settings/messagecore.kcfg
M  +2    -1    messagecore/src/utils/stringutil.cpp

https://invent.kde.org/pim/messagelib/-/commit/32e5ed96880b2ab858a7c3a557f8e2e69a3991cb
Comment 2 Laurent Montel 2024-08-01 19:39:23 UTC
Git commit e2e6bf4db1de74895b7d3ba28cc47eac8cf8d17a by Laurent Montel.
Committed on 01/08/2024 at 19:39.
Pushed by mlaurent into branch 'master'.

Fix bug 491076: do display one's own sender/recipient email address and name

M  +1    -1    CMakeLists.txt
M  +9    -0    src/configuredialog/configureappearancepage.cpp
M  +1    -0    src/configuredialog/configureappearancepage.h

https://invent.kde.org/pim/kmail/-/commit/e2e6bf4db1de74895b7d3ba28cc47eac8cf8d17a
Comment 3 Georg Schwarz 2024-08-01 21:02:11 UTC
Thanks a lot for so quickly implementing this. Very much appreciated.
This should also fix or at least provide a reasonable solution to bug #277622.