mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
refactor and cleanup [skip ci]
This commit is contained in:
27
submodules/Postbox/Sources/ChatListHolesView.swift
Normal file
27
submodules/Postbox/Sources/ChatListHolesView.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
import Foundation
|
||||
|
||||
public struct ChatListHolesEntry: Hashable {
|
||||
public let groupId: PeerGroupId
|
||||
public let hole: ChatListHole
|
||||
}
|
||||
|
||||
final class MutableChatListHolesView {
|
||||
fileprivate var entries = Set<ChatListHolesEntry>()
|
||||
|
||||
func update(holes: Set<ChatListHolesEntry>) -> Bool {
|
||||
if self.entries != holes {
|
||||
self.entries = holes
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final class ChatListHolesView {
|
||||
public let entries: Set<ChatListHolesEntry>
|
||||
|
||||
init(_ mutableView: MutableChatListHolesView) {
|
||||
self.entries = mutableView.entries
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user