Bug 374830 - Context menu on e-mail address should offer "Copy e-mail address"
Summary: Context menu on e-mail address should offer "Copy e-mail address"
Status: RESOLVED FIXED
Alias: None
Product: trojita
Classification: Applications
Component: Desktop GUI (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Trojita default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-09 18:34 UTC by Robert Kratky
Modified: 2017-02-13 00:08 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Kratky 2017-01-09 18:34:16 UTC
The context menu shown when right-clicking on an e-mail address in the header of a message should offer the option to copy the e-mail address to the clipboard.

Right now, the menu only offers "Copy Link Location", which gets me the following (in this case unhelpful) URL:

mailto:joe@example.com?X-Trojita-DisplayName=Joe

It would be good if one could also copy just:

joe@example.com
Comment 1 Pali Rohár 2017-01-09 18:51:33 UTC
(In reply to Robert Kratky from comment #0)
> mailto:joe@example.com?X-Trojita-DisplayName=Joe

Now when I see this link, it should be changed to "mailto:?To=Joe%20%3Cjoe@example.com%3E" as X-Trojita-DisplayName means to create new email with header X-Trojita-DisplayName -- which is incorrect.
Comment 2 Jan Kundrát 2017-01-11 10:49:27 UTC
(In reply to Pali Rohár from comment #1)
> Now when I see this link, it should be changed to
> "mailto:?To=Joe%20%3Cjoe@example.com%3E" as X-Trojita-DisplayName means to
> create new email with header X-Trojita-DisplayName -- which is incorrect.

These links should never leave Trojita, so it's up to us to construct them in whatever way we like.

Robert is right in that this particular item should be changed to only copy the raw e-mail address.
Comment 3 Pali Rohár 2017-01-14 12:17:46 UTC
(In reply to Jan Kundrát from comment #2)
> (In reply to Pali Rohár from comment #1)
> > Now when I see this link, it should be changed to
> > "mailto:?To=Joe%20%3Cjoe@example.com%3E" as X-Trojita-DisplayName means to
> > create new email with header X-Trojita-DisplayName -- which is incorrect.
> 
> These links should never leave Trojita, so it's up to us to construct them
> in whatever way we like.

Yes. But now when Trojita supports mailto uris correctly, there is no need to use custom mailto headers which indicate display name and standard mailto: way can be used...
Comment 4 Jan Kundrát 2017-02-05 17:21:18 UTC
A series of patches which implement this is available at https://gerrit.vesnicky.cesnet.cz/r/#/q/status:open+project:trojita+branch:master+topic:mailto-bug-374830 . Feedback is welcome

And so are patches which deprecate our X-Trojita-DisplayName, Pali :).
Comment 5 Jan Kundrát 2017-02-13 00:08:40 UTC
Git commit d42deaec263c1a0cd00d0391f0b75b48c3471b0d by Jan Kundrát.
Committed on 05/02/2017 at 14:37.
Pushed by gerrit into branch 'master'.

GUI: Extracting e-mail addresses from a message body

Right now, we delegate link copying to WebKit, which means that it will
use URLs like "mailto:foo@example.org". That is suboptimal from the
user's point of view; they typically just "want to have that e-mail
address".

This patch ensures that we do this fancy thing when the URL is really a
simple one -- pointing to exactly one recipient. As a fallback option,
all other cases are handled by the existing code which just copies the
URL as-is.

Please note that this does not fix the issue that the linked bugreport
complained about -- the header widget with e-mail addresses is a QLabel,
so we will have to do a slightly different dance for that.

Change-Id: I930f4eecd291af643c736701849d4c92fc8fc43d

M  +18   -3    src/Gui/SimplePartWidget.cpp
M  +1    -0    src/Gui/SimplePartWidget.h

https://commits.kde.org/trojita/d42deaec263c1a0cd00d0391f0b75b48c3471b0d
Comment 6 Jan Kundrát 2017-02-13 00:08:40 UTC
Git commit 434f677d4909e751ef59d2c8b5e2899b05eae022 by Jan Kundrát.
Committed on 06/02/2017 at 11:29.
Pushed by gerrit into branch 'master'.

GUI: Clipboard copying of e-mail addresses from the header view

Previously, the context menu offered some options for accessing the
QLabel (this class is actually just a pretty QLabel)'s text, for
selecting all of it, and copying stuff.

The most important, IMHO, is to have access to the actual e-mail address
(as requested by the associated bugreport), and to the human readable
text for the sake of completeness.

The code is still a tad inconsistent because the List-Post header for
indicating an active mailing list does not currently use the
OneEnvelopeAddress class. Mailing list addresses will therefore remain
unaffected by this patch; their copy action is still going to copy a
complete mailto: URL.
Change-Id: I4e515045d0241e4c1064389aa777f58e72c7c999

M  +26   -2    src/Gui/OneEnvelopeAddress.cpp
M  +2    -0    src/Gui/OneEnvelopeAddress.h

https://commits.kde.org/trojita/434f677d4909e751ef59d2c8b5e2899b05eae022