mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 02:58:33 +00:00
Consider groups 'unknown' if they have no title, avatar, or members.
This commit is contained in:
parent
3bd8aa8a86
commit
3b5d9a2cae
@ -114,7 +114,16 @@ public class GroupDatabase extends Database {
|
||||
}
|
||||
|
||||
public boolean isUnknownGroup(String groupId) {
|
||||
return !getGroup(groupId).isPresent();
|
||||
Optional<GroupRecord> group = getGroup(groupId);
|
||||
|
||||
if (!group.isPresent()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean noMetadata = group.get().getAvatar() == null && TextUtils.isEmpty(group.get().getTitle());
|
||||
boolean noMembers = group.get().getMembers().isEmpty() || (group.get().getMembers().size() == 1 && group.get().getMembers().contains(Recipient.self().getId()));
|
||||
|
||||
return noMetadata && noMembers;
|
||||
}
|
||||
|
||||
public Reader getGroupsFilteredByTitle(String constraint, boolean includeInactive) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user