mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Do not send to blocked recipients.
This commit is contained in:
@@ -34,6 +34,7 @@ public class GroupReceiptDatabase extends Database {
|
||||
public static final int STATUS_DELIVERED = 1;
|
||||
public static final int STATUS_READ = 2;
|
||||
public static final int STATUS_VIEWED = 3;
|
||||
public static final int STATUS_SKIPPED = 4;
|
||||
|
||||
public static final String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " (" + ID + " INTEGER PRIMARY KEY, " +
|
||||
MMS_ID + " INTEGER, " + RECIPIENT_ID + " INTEGER, " + STATUS + " INTEGER, " + TIMESTAMP + " INTEGER, " + UNIDENTIFIED + " INTEGER DEFAULT 0);";
|
||||
@@ -95,6 +96,26 @@ public class GroupReceiptDatabase extends Database {
|
||||
}
|
||||
}
|
||||
|
||||
public void setSkipped(Collection<RecipientId> recipients, long mmsId) {
|
||||
SQLiteDatabase db = databaseHelper.getSignalWritableDatabase();
|
||||
|
||||
db.beginTransaction();
|
||||
try {
|
||||
String query = MMS_ID + " = ? AND " + RECIPIENT_ID + " = ?";
|
||||
|
||||
for (RecipientId recipient : recipients) {
|
||||
ContentValues values = new ContentValues(1);
|
||||
values.put(STATUS, STATUS_SKIPPED);
|
||||
|
||||
db.update(TABLE_NAME, values, query, new String[]{ String.valueOf(mmsId), recipient.serialize()});
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
public @NonNull List<GroupReceiptInfo> getGroupReceiptInfo(long mmsId) {
|
||||
SQLiteDatabase db = databaseHelper.getSignalReadableDatabase();
|
||||
List<GroupReceiptInfo> results = new LinkedList<>();
|
||||
|
||||
Reference in New Issue
Block a user