mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Merge commit '4b34a6643f212dab03affe205b8636ae8a6c687e'
Update widget
This commit is contained in:
@@ -30,6 +30,7 @@ public enum PostboxViewKey: Hashable {
|
||||
case basicPeer(PeerId)
|
||||
case allChatListHoles(PeerGroupId)
|
||||
case historyTagInfo(peerId: PeerId, tag: MessageTags)
|
||||
case topChatMessage(peerIds: [PeerId])
|
||||
|
||||
public var hashValue: Int {
|
||||
switch self {
|
||||
@@ -91,6 +92,8 @@ public enum PostboxViewKey: Hashable {
|
||||
return groupId.hashValue
|
||||
case let .historyTagInfo(peerId, tag):
|
||||
return peerId.hashValue ^ tag.hashValue
|
||||
case let .topChatMessage(peerIds):
|
||||
return peerIds.hashValue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,6 +273,12 @@ public enum PostboxViewKey: Hashable {
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case let .topChatMessage(peerIds):
|
||||
if case .topChatMessage(peerIds) = rhs {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -334,5 +343,7 @@ func postboxViewForKey(postbox: Postbox, key: PostboxViewKey) -> MutablePostboxV
|
||||
return MutableAllChatListHolesView(postbox: postbox, groupId: groupId)
|
||||
case let .historyTagInfo(peerId, tag):
|
||||
return MutableHistoryTagInfoView(postbox: postbox, peerId: peerId, tag: tag)
|
||||
case let .topChatMessage(peerIds):
|
||||
return MutableTopChatMessageView(postbox: postbox, peerIds: Set(peerIds))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user