From e3219fbd72db13e3b1ec57c181e670f8bfe957a8 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 2 May 2018 20:39:37 +0200 Subject: added search result context menu + date separators --- .../java/de/pixart/messenger/entities/IndividualMessage.java | 12 ++++++++++++ src/main/java/de/pixart/messenger/entities/Message.java | 11 +---------- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'src/main/java/de/pixart/messenger/entities') 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 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 counterparts; private WeakReference 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(); -- cgit v1.2.3