fix: fixed status messages not showing (MESSENGER-6173)

This commit is contained in:
JanNiklas Grabowski
2024-07-03 13:17:31 +02:00
parent 6a22f7ab36
commit 93fb072522
2 changed files with 9 additions and 15 deletions

View File

@@ -21,7 +21,6 @@ import Foundation
case none = 0
case mixed = 1
case all = 2
case onlyMember = 3
}
@objc class FederationEventHelper: NSObject {
@@ -59,23 +58,19 @@ import Foundation
}
@objc func isCollapsedACLEvents( events: [MXEvent]) -> CollapsedACLEvents {
var aclEventCount = 0, otherEventCount = 0, memberEventCount = 0
var aclEventCount = 0, otherEventCount = 0
for event in events {
if event.eventType == .roomServerACL {
aclEventCount += 1
} else if event.eventType == .roomMember {
memberEventCount += 1
} else {
if event.eventType != .roomServerACL {
otherEventCount += 1
} else {
aclEventCount += 1
}
}
if aclEventCount > 0 && otherEventCount == 0 && memberEventCount == 0 {
if aclEventCount > 0 && otherEventCount == 0 {
return .all
} else if otherEventCount > 0 && aclEventCount == 0 && memberEventCount == 0 {
} else if otherEventCount > 0 && aclEventCount == 0 {
return .none
} else if memberEventCount > 0 && otherEventCount == 0 && aclEventCount == 0 {
return .onlyMember
} else {
return .mixed
}