Skip to content
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

linkify relevant URI types: bitcoin, bridge, market, openpgp4fpr, xmpp #684

Closed
wants to merge 2 commits into from

Conversation

Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
@eighthave
Copy link

@eighthave eighthave commented Jun 13, 2015

This expands the linkifying in the message view to include some relevant
and common URI schemes.

This makes all of the regexps compiled once at start time, to prevent them
from being recompiled each time a new email is viewed.

Here are some example URIs that work:
openpgp4fpr:5E61C8780F86295CE17D86779F0FE587374BBE81
openpgp4fpr:9F0FE587374BBE81
openpgp4fpr:374BBE81
market://details?id=info.guardianproject.checkey
market://details?id=com.fsck.k9
xmpp:to@foo.com?subscribe;otr-fingerprint=98273491287349817243987124
xmpp:gptest@xmpp.jp
xmpp://gptest@xmpp.jp
xmpp:gptest@jabber.ccc.de?subscribe;otr-fingerprint=DC45EB0B00CD76D05C327C9143B4025697413ED6

Here are some examples of wrong URIs that should not work:
openpgp4fpr:374BBE8
market:details?id=info.guardianproject.checkey

@maniac103
Copy link
Contributor

@maniac103 maniac103 commented Jun 13, 2015

I think it would be a good idea to only linkify those if the relevant app is installed (IOW, the intent for those URIs is resolvable).

eighthave added 2 commits Jun 15, 2015
This expands the linkifying in the message view to include some relevant
and common URI schemes.

This makes all of the regexps compiled once at start time, to prevent them
from being recompiled each time a new email is viewed.

Here are some example URIs that work:
bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W
geo:34.99393,-106.61568
openpgp4fpr:5E61C8780F86295CE17D86779F0FE587374BBE81
openpgp4fpr:9F0FE587374BBE81
openpgp4fpr:374BBE81
market://details?id=info.guardianproject.checkey
market://details?id=com.fsck.k9
xmpp:to@foo.com?subscribe;otr-fingerprint=98273491287349817243987124
xmpp:gptest@xmpp.jp
xmpp://gptest@xmpp.jp
xmpp:gptest@jabber.ccc.de?subscribe;otr-fingerprint=DC45EB0B00CD76D05C327C9143B4025697413ED6

Here are some examples of wrong URIs that should not work:
openpgp4fpr:374BBE8
market:details?id=info.guardianproject.checkey
In order to prevent pointlessly confusing linkifying in the message body,
K-9 should only linkify special links (i.e. non-HTTP) if there is an app
installed that can handle that URI scheme.  This happens in onResume() in
both MessageList and MessageCompose so that the info is reasonably current
when the linkifying happens.
@eighthave eighthave force-pushed the linkify-more-uris branch from 7c0b399 to 8c9d6fb Jun 15, 2015
@eighthave
Copy link
Author

@eighthave eighthave commented Jun 15, 2015

@maniac103 good idea, I updated this pull request to do just that.

@frank334
Copy link

@frank334 frank334 commented Jun 23, 2015

The issue with the OsmAnd URLs is solved now. Location sharing works with the osmand.net link. Now I'm curious for the next K-9 update, if the geo: URI will be clickable too.

@jberkel
Copy link
Member

@jberkel jberkel commented Jun 24, 2015

I would move this code into a new class + tests are missing

@cketti
Copy link
Member

@cketti cketti commented Feb 21, 2017

I created issue #2265 to keep track of this feature. It also contains some notes about how I'd like this to be implemented.

@cketti cketti closed this Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment