Display 'Unknown group' for groups with no name.

master
Alan Evans 2020-06-10 17:16:47 -03:00
parent e13f3254ad
commit 400c592acf
1 changed files with 5 additions and 3 deletions

View File

@ -215,13 +215,15 @@ public final class GroupDatabase extends Database {
}
}
public List<String> getPushGroupNamesContainingMember(RecipientId recipientId) {
@WorkerThread
public List<String> getPushGroupNamesContainingMember(@NonNull RecipientId recipientId) {
return Stream.of(getPushGroupsContainingMember(recipientId))
.map(GroupRecord::getTitle)
.map(groupRecord -> Recipient.resolved(groupRecord.getRecipientId()).getDisplayName(context))
.toList();
}
public List<GroupRecord> getPushGroupsContainingMember(RecipientId recipientId) {
@WorkerThread
public @NonNull List<GroupRecord> getPushGroupsContainingMember(@NonNull RecipientId recipientId) {
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 query = MEMBERS + " LIKE ? AND " + MMS + " = ?";