aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/entities
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-05-02 20:39:37 +0200
committerChristian Schneppe <christian@pix-art.de>2018-05-02 20:39:37 +0200
commite3219fbd72db13e3b1ec57c181e670f8bfe957a8 (patch)
tree2fcd3ddc3e5ac701d00be957e6fc25f7dbca3273 /src/main/java/de/pixart/messenger/entities
parent41d726ef73a20e7e7ee1ff81c5f8326aa0e6c7d8 (diff)
added search result context menu + date separators
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r--src/main/java/de/pixart/messenger/entities/IndividualMessage.java12
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java11
2 files changed, 13 insertions, 10 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/IndividualMessage.java b/src/main/java/de/pixart/messenger/entities/IndividualMessage.java
index 7a1030fef..f8d0b7938 100644
--- a/src/main/java/de/pixart/messenger/entities/IndividualMessage.java
+++ b/src/main/java/de/pixart/messenger/entities/IndividualMessage.java
@@ -32,15 +32,27 @@ import android.database.Cursor;
import java.util.Set;
+import de.pixart.messenger.ui.adapter.MessageAdapter;
import rocks.xmpp.addr.Jid;
public class IndividualMessage extends Message {
+ private IndividualMessage(Conversational conversation) {
+ super(conversation);
+ }
private IndividualMessage(Conversational conversation, String uuid, String conversationUUid, Jid counterpart, Jid trueCounterpart, String body, long timeSent, int encryption, int status, int type, boolean carbon, String remoteMsgId, String relativeFilePath, String serverMsgId, String fingerprint, boolean read, String edited, boolean oob, String errorMessage, Set<ReadByMarker> readByMarkers, boolean markable) {
super(conversation, uuid, conversationUUid, counterpart, trueCounterpart, body, timeSent, encryption, status, type, carbon, remoteMsgId, relativeFilePath, serverMsgId, fingerprint, read, edited, oob, errorMessage, readByMarkers, markable);
}
+ public static Message createDateSeparator(Message message) {
+ final Message separator = new IndividualMessage(message.getConversation());
+ separator.setType(Message.TYPE_STATUS);
+ separator.body = MessageAdapter.DATE_SEPARATOR_BODY;
+ separator.setTime(message.getTimeSent());
+ return separator;
+ }
+
public static Message fromCursor(Cursor cursor, Conversational conversation) {
Jid jid;
try {
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index 605fa0001..cfe3c7fb8 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/entities/Message.java
@@ -17,7 +17,6 @@ import java.util.Set;
import de.pixart.messenger.Config;
import de.pixart.messenger.crypto.axolotl.FingerprintStatus;
import de.pixart.messenger.http.AesGcmURLStreamHandler;
-import de.pixart.messenger.ui.adapter.MessageAdapter;
import de.pixart.messenger.utils.CryptoHelper;
import de.pixart.messenger.utils.Emoticons;
import de.pixart.messenger.utils.GeoHelper;
@@ -108,7 +107,7 @@ public class Message extends AbstractEntity {
private List<MucOptions.User> counterparts;
private WeakReference<MucOptions.User> user;
- private Message(Conversational conversation) {
+ protected Message(Conversational conversation) {
this.conversation = conversation;
}
@@ -232,14 +231,6 @@ public class Message extends AbstractEntity {
return message;
}
- public static Message createDateSeparator(Message message) {
- final Message separator = new Message(message.getConversation());
- separator.setType(Message.TYPE_STATUS);
- separator.body = MessageAdapter.DATE_SEPARATOR_BODY;
- separator.setTime(message.getTimeSent());
- return separator;
- }
-
@Override
public ContentValues getContentValues() {
ContentValues values = new ContentValues();