aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/entities
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-05-09 21:47:50 +0200
committerChristian Schneppe <christian@pix-art.de>2019-05-18 00:01:57 +0200
commit294144943429503f62675d23b9911d43c0f41ce3 (patch)
tree6ca73458e72a8afe0a148f8971726eeb7311ea71 /src/main/java/de/pixart/messenger/entities
parent5b75d52d444d6cda368e85f5884163e229451ece (diff)
performance improvements
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Conversation.java13
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java1
2 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java
index 7e1a9e91a..8104e5ab1 100644
--- a/src/main/java/de/pixart/messenger/entities/Conversation.java
+++ b/src/main/java/de/pixart/messenger/entities/Conversation.java
@@ -207,7 +207,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
}
}
}
- for(Message result : results) {
+ for (Message result : results) {
onMessageFound.onMessageFound(result);
}
}
@@ -343,7 +343,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
}
}
}
- for(Message result : results) {
+ for (Message result : results) {
onMessageFound.onMessageFound(result);
}
}
@@ -568,7 +568,8 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
}
}
- public @NonNull CharSequence getName() {
+ public @NonNull
+ CharSequence getName() {
if (getMode() == MODE_MULTI) {
final String roomName = getMucOptions().getName();
final String subject = getMucOptions().getSubject();
@@ -933,12 +934,12 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
continue; //it's unsafe to use private messages as anchor. They could be coming from user archive
}
if (message.getStatus() == Message.STATUS_RECEIVED || message.isCarbon() || message.getServerMsgId() != null) {
- lastReceived = new MamReference(message.getTimeSent(),message.getServerMsgId());
+ lastReceived = new MamReference(message.getTimeSent(), message.getServerMsgId());
break;
}
}
}
- return MamReference.max(lastClear,lastReceived);
+ return MamReference.max(lastClear, lastReceived);
}
public void setMutedTill(long value) {
@@ -1131,7 +1132,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
for (int i = this.messages.size() - 1; i >= 0; --i) {
Message message = this.messages.get(i);
if ((message.getType() == Message.TYPE_IMAGE || message.getType() == Message.TYPE_FILE) && message.getEncryption() != Message.ENCRYPTION_PGP) {
- if (message.getStatus() == Message.STATUS_SEND_FAILED && !message.isFileDeleted() && message.needsUploading()){
+ if (message.getStatus() == Message.STATUS_SEND_FAILED && !message.isFileDeleted() && message.needsUploading()) {
++count;
}
}
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index 89236b0fd..9d23d5461 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/entities/Message.java
@@ -313,6 +313,7 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
this.body = body;
this.isGeoUri = null;
this.isXmppUri = null;
+ this.isWebUri = null;
this.isEmojisOnly = null;
this.treatAsDownloadable = null;
this.fileParams = null;