Create tel: links for phone numbers
ClosedPublic

Authored by vkrause on Jan 18 2019, 7:18 PM.

Details

Summary

KDE Connect can handle tel: URLs and trigger a call, so this enables to
directly call phone numbers found e.g. in emails.

This is obviously a heuristic and might need more fine-tuning, as we can't
depend on libphonenumber here for more precision.

Diff Detail

Repository
R244 KCoreAddons
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 7546
Build 7564: arc lint + arc unit
vkrause created this revision.Jan 18 2019, 7:18 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 18 2019, 7:18 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
vkrause requested review of this revision.Jan 18 2019, 7:18 PM
vkrause updated this revision to Diff 49836.Jan 18 2019, 7:22 PM

Handle empty tel: URLs, as found in the review email.

svuorela added inline comments.
src/lib/text/ktexttohtml.cpp
159

How are the thread safety of the KTextToHTML functions?

And does that match the thread safety of the QRegularExpression and the const methods in there?

vkrause added inline comments.Jan 25 2019, 2:18 PM
src/lib/text/ktexttohtml.cpp
159

Valid point. This isn't specified in the documentation, things like static bool triedLoadPlugin in the existing code suggest that this isn't thread-safe right now though.

vkrause updated this revision to Diff 50314.Jan 26 2019, 12:02 PM
  • Make phone number extraction opt-in, not all users might be able to handle tel: links.
  • Normalize phone numbers in the generated tel: URLs, otherwise some numbers aren't correctly handled by KDE Connect/Android and we end up in the browser rather than the caller app.
aacid added a subscriber: aacid.Jan 26 2019, 12:12 PM
aacid added inline comments.
src/lib/text/ktexttohtml.h
66

@since missing

vkrause updated this revision to Diff 50315.Jan 26 2019, 12:16 PM

Add @since.

apol added a subscriber: apol.Jan 27 2019, 5:39 AM

+1 Looks good.

svuorela accepted this revision.Feb 9 2019, 6:19 PM
This revision is now accepted and ready to land.Feb 9 2019, 6:19 PM
This revision was automatically updated to reflect the committed changes.