kopia lustrzana https://github.com/ryukoposting/Signal-Android
Remove MMS groups from message request logic.
rodzic
24528bf101
commit
2f879ce4d6
|
@ -183,17 +183,17 @@ public final class GroupDatabase extends Database {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getGroupNamesContainingMember(RecipientId recipientId) {
|
public List<String> getPushGroupNamesContainingMember(RecipientId recipientId) {
|
||||||
return Stream.of(getGroupsContainingMember(recipientId))
|
return Stream.of(getPushGroupsContainingMember(recipientId))
|
||||||
.map(GroupRecord::getTitle)
|
.map(GroupRecord::getTitle)
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<GroupRecord> getGroupsContainingMember(RecipientId recipientId) {
|
public List<GroupRecord> getPushGroupsContainingMember(RecipientId recipientId) {
|
||||||
SQLiteDatabase database = databaseHelper.getReadableDatabase();
|
SQLiteDatabase database = databaseHelper.getReadableDatabase();
|
||||||
String table = TABLE_NAME + " INNER JOIN " + ThreadDatabase.TABLE_NAME + " ON " + TABLE_NAME + "." + RECIPIENT_ID + " = " + ThreadDatabase.TABLE_NAME + "." + ThreadDatabase.RECIPIENT_ID;
|
String table = TABLE_NAME + " INNER JOIN " + ThreadDatabase.TABLE_NAME + " ON " + TABLE_NAME + "." + RECIPIENT_ID + " = " + ThreadDatabase.TABLE_NAME + "." + ThreadDatabase.RECIPIENT_ID;
|
||||||
String query = MEMBERS + " LIKE ?";
|
String query = MEMBERS + " LIKE ? AND " + MMS + " = ?";
|
||||||
String[] args = new String[]{"%" + recipientId.serialize() + "%"};
|
String[] args = new String[]{"%" + recipientId.serialize() + "%", "0"};
|
||||||
String orderBy = ThreadDatabase.TABLE_NAME + "." + ThreadDatabase.DATE + " DESC";
|
String orderBy = ThreadDatabase.TABLE_NAME + "." + ThreadDatabase.DATE + " DESC";
|
||||||
|
|
||||||
List<GroupRecord> groups = new LinkedList<>();
|
List<GroupRecord> groups = new LinkedList<>();
|
||||||
|
|
|
@ -38,7 +38,7 @@ final class MessageRequestRepository {
|
||||||
void getGroups(@NonNull RecipientId recipientId, @NonNull Consumer<List<String>> onGroupsLoaded) {
|
void getGroups(@NonNull RecipientId recipientId, @NonNull Consumer<List<String>> onGroupsLoaded) {
|
||||||
executor.execute(() -> {
|
executor.execute(() -> {
|
||||||
GroupDatabase groupDatabase = DatabaseFactory.getGroupDatabase(context);
|
GroupDatabase groupDatabase = DatabaseFactory.getGroupDatabase(context);
|
||||||
onGroupsLoaded.accept(groupDatabase.getGroupNamesContainingMember(recipientId));
|
onGroupsLoaded.accept(groupDatabase.getPushGroupNamesContainingMember(recipientId));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -235,7 +235,7 @@ public class RecipientUtil {
|
||||||
|
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
private static boolean isProfileSharedViaGroup(@NonNull Context context, @NonNull Recipient recipient) {
|
private static boolean isProfileSharedViaGroup(@NonNull Context context, @NonNull Recipient recipient) {
|
||||||
return Stream.of(DatabaseFactory.getGroupDatabase(context).getGroupsContainingMember(recipient.getId()))
|
return Stream.of(DatabaseFactory.getGroupDatabase(context).getPushGroupsContainingMember(recipient.getId()))
|
||||||
.anyMatch(group -> Recipient.resolved(group.getRecipientId()).isProfileSharing());
|
.anyMatch(group -> Recipient.resolved(group.getRecipientId()).isProfileSharing());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue