Make phone numbers in media captions clickable

This commit is contained in:
Andrey Startsev 2016-01-04 13:55:21 +03:00
parent 6033ee2f5c
commit 668fea41f6

View file

@ -737,7 +737,7 @@ public class MessageObject {
caption = Emoji.replaceEmoji(messageOwner.media.caption, textPaint.getFontMetricsInt(), AndroidUtilities.dp(20), false); caption = Emoji.replaceEmoji(messageOwner.media.caption, textPaint.getFontMetricsInt(), AndroidUtilities.dp(20), false);
if (containsUrls(caption)) { if (containsUrls(caption)) {
try { try {
Linkify.addLinks((Spannable) caption, Linkify.WEB_URLS); Linkify.addLinks((Spannable) caption, Linkify.WEB_URLS | Linkify.PHONE_NUMBERS);
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }