aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index 7a3e12073..5df54861f 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/entities/Message.java
@@ -5,6 +5,7 @@ import android.database.Cursor;
import android.text.SpannableStringBuilder;
import android.util.Log;
+import java.lang.ref.WeakReference;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
@@ -105,6 +106,7 @@ public class Message extends AbstractEntity {
private Boolean treatAsDownloadable = null;
private FileParams fileParams = null;
private List<MucOptions.User> counterparts;
+ private WeakReference<MucOptions.User> user;
private Message(Conversation conversation) {
this.conversation = conversation;
@@ -317,6 +319,16 @@ public class Message extends AbstractEntity {
this.fileParams = null;
}
+ public void setMucUser(MucOptions.User user) {
+ this.user = new WeakReference<>(user);
+ }
+
+ public boolean sameMucUser(Message otherMessage) {
+ final MucOptions.User thisUser = this.user == null ? null : this.user.get();
+ final MucOptions.User otherUser = otherMessage.user == null ? null : otherMessage.user.get();
+ return thisUser != null && thisUser == otherUser;
+ }
+
public String getErrorMessage() {
return errorMessage;
}