Add section to recent reactions page listing emoji already applied to message.

This commit is contained in:
Alex Hart
2020-07-30 17:02:17 -03:00
committed by Greyson Parrelli
parent e55f4fe6b6
commit 4c30b39e71
21 changed files with 430 additions and 131 deletions

View File

@@ -16,6 +16,8 @@ import org.thoughtcrime.securesms.database.documents.Document;
import org.thoughtcrime.securesms.database.documents.IdentityKeyMismatch;
import org.thoughtcrime.securesms.database.documents.IdentityKeyMismatchList;
import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper;
import org.thoughtcrime.securesms.database.model.MessageRecord;
import org.thoughtcrime.securesms.database.model.SmsMessageRecord;
import org.thoughtcrime.securesms.database.model.databaseprotos.ReactionList;
import org.thoughtcrime.securesms.database.model.ReactionRecord;
import org.thoughtcrime.securesms.insights.InsightsConstants;
@@ -55,6 +57,8 @@ public abstract class MessagingDatabase extends Database implements MmsSmsColumn
public abstract void markAsSending(long messageId);
public abstract void markAsRemoteDelete(long messageId);
public abstract MessageRecord getMessageRecord(long messageId) throws NoSuchMessageException;
final int getInsecureMessagesSentForThread(long threadId) {
SQLiteDatabase db = databaseHelper.getReadableDatabase();
String[] projection = new String[]{"COUNT(*)"};

View File

@@ -445,6 +445,7 @@ public class MmsDatabase extends MessagingDatabase {
return rawQuery(RAW_ID_WHERE, new String[] {messageId + ""});
}
@Override
public MessageRecord getMessageRecord(long messageId) throws NoSuchMessageException {
try (Cursor cursor = rawQuery(RAW_ID_WHERE, new String[] {messageId + ""})) {
MessageRecord record = new Reader(cursor).getNext();

View File

@@ -854,7 +854,8 @@ public class SmsDatabase extends MessagingDatabase {
return db.query(TABLE_NAME, MESSAGE_PROJECTION, where, null, null, null, null);
}
public SmsMessageRecord getMessage(long messageId) throws NoSuchMessageException {
@Override
public SmsMessageRecord getMessageRecord(long messageId) throws NoSuchMessageException {
SQLiteDatabase db = databaseHelper.getReadableDatabase();
Cursor cursor = db.query(TABLE_NAME, MESSAGE_PROJECTION, ID_WHERE, new String[]{messageId + ""}, null, null, null);
Reader reader = new Reader(cursor);