mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Add the ability to forward content to multiple chats at once.
This commit is contained in:
committed by
Greyson Parrelli
parent
eacf03768f
commit
8d187c8ba1
@@ -65,6 +65,7 @@ import org.whispersystems.signalservice.api.storage.SignalGroupV2Record;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -962,6 +963,19 @@ public class ThreadDatabase extends Database {
|
||||
}
|
||||
}
|
||||
|
||||
public Map<RecipientId, Long> getThreadIdsIfExistsFor(@NonNull RecipientId ... recipientIds) {
|
||||
SQLiteDatabase db = databaseHelper.getReadableDatabase();
|
||||
SqlUtil.Query query = SqlUtil.buildCollectionQuery(RECIPIENT_ID, Arrays.asList(recipientIds));
|
||||
|
||||
Map<RecipientId, Long> results = new HashMap<>();
|
||||
try (Cursor cursor = db.query(TABLE_NAME, new String[]{ ID, RECIPIENT_ID }, query.getWhere(), query.getWhereArgs(), null, null, null, "1")) {
|
||||
while (cursor != null && cursor.moveToNext()) {
|
||||
results.put(RecipientId.from(CursorUtil.requireString(cursor, RECIPIENT_ID)), CursorUtil.requireLong(cursor, ID));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public long getOrCreateValidThreadId(@NonNull Recipient recipient, long candidateId) {
|
||||
return getOrCreateValidThreadId(recipient, candidateId, DistributionTypes.DEFAULT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user