aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-06-08 10:28:45 +0200
committerChristian Schneppe <christian@pix-art.de>2019-06-08 10:28:45 +0200
commit997da1a090cd43218e9af7636ddda4236740b723 (patch)
treeb92a8f12b55b3b029da35a533b55f54229acf56c /src
parent6e040b7ac2a1fb5152df40e0a7ca961e827a32e6 (diff)
performance improvements
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java3
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index 9d23d5461..e280d2527 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/entities/Message.java
@@ -776,9 +776,8 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
}
public synchronized boolean isWebUri() {
- String url = body.trim();
if (isWebUri == null) {
- isWebUri = Patterns.AUTOLINK_WEB_URL.matcher(url).matches() && !url.contains(" ");
+ isWebUri = Patterns.WEB_URL.matcher(body).matches();
}
return isWebUri;
}
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index 910d907a7..c47850461 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -644,7 +644,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
binding.scrollToBottomButton.setEnabled(true);
binding.scrollToBottomButton.show();
if (lastMessageUuid == null) {
- lastMessageUuid = conversation.getLatestMessage().getUuid();
+ new Thread(lastMessageUuid = conversation.getLatestMessage().getUuid()).start();
}
if (conversation.getReceivedMessagesCountSinceUuid(lastMessageUuid) > 0) {
binding.unreadCountCustomView.setVisibility(View.VISIBLE);