aboutsummaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-03-08 21:13:24 +0100
committerlookshe <github@lookshe.org>2016-03-08 21:13:24 +0100
commit74d6d10cb76b7440f57db193a3c38e476206969c (patch)
tree665b7787c0f7bcb6d759e849972fa9658e84423f /libs
parent7be757de90fb71042b79b88a76cd36fc07b2ee87 (diff)
parentf051dd0bcdbd35d101420fb1f75f33a565a1e0f8 (diff)
Merge branch 'trz/rebase' into trz/rename
Diffstat (limited to 'libs')
-rw-r--r--libs/emojicon/src/main/java/github/ankushsachdeva/emojicon/EmojiconHandler.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/emojicon/src/main/java/github/ankushsachdeva/emojicon/EmojiconHandler.java b/libs/emojicon/src/main/java/github/ankushsachdeva/emojicon/EmojiconHandler.java
index 5523314b..f611a263 100644
--- a/libs/emojicon/src/main/java/github/ankushsachdeva/emojicon/EmojiconHandler.java
+++ b/libs/emojicon/src/main/java/github/ankushsachdeva/emojicon/EmojiconHandler.java
@@ -1407,6 +1407,11 @@ public final class EmojiconHandler {
public static final Map<Pattern, Integer> ANDROID_EMOTICONS = new HashMap<Pattern, Integer>();
private static final Pattern TIME_AND_SCORING_PATTERN = Pattern.compile("[0-9]{1,3}:[0-9]{1,3}");
+ private static final Pattern XMPP_PATTERN = Pattern
+ .compile("xmpp\\:(?:(?:["
+ + Patterns.GOOD_IRI_CHAR
+ + "\\;\\/\\?\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])"
+ + "|(?:\\%[a-fA-F0-9]{2}))+");
private static final Spannable.Factory spannableFactory = Spannable.Factory
.getInstance();
@@ -1459,6 +1464,11 @@ public final class EmojiconHandler {
falsePositives.add(Pair.create(timeAndScoringMatcher.start(), timeAndScoringMatcher.end()));
}
+ Matcher xmppMatcher = XMPP_PATTERN.matcher(spannable);
+ while (xmppMatcher.find()) {
+ falsePositives.add(Pair.create(xmppMatcher.start(), xmppMatcher.end()));
+ }
+
Map<Pattern, Integer> emoticons = ANDROID_EMOTICONS;
for (Map.Entry<Pattern, Integer> entry : emoticons.entrySet()) {
Matcher matcher = entry.getKey().matcher(spannable);