mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-10 16:29:55 +00:00
ContactListNode: fix queue ordering
CreateGroupController: display errors on creation ChatList: use muted mention badges in Archive
This commit is contained in:
parent
94c157bcee
commit
3e9f242acb
@ -767,6 +767,18 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
contentImageMedia = file
|
contentImageMedia = file
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
} else if let webpage = media as? TelegramMediaWebpage, case let .Loaded(content) = webpage.content {
|
||||||
|
if let image = content.image {
|
||||||
|
textLeftCutout += 26.0
|
||||||
|
contentImageMedia = image
|
||||||
|
break
|
||||||
|
} else if let file = content.file {
|
||||||
|
if file.isVideo && !file.isInstantVideo {
|
||||||
|
textLeftCutout += 26.0
|
||||||
|
contentImageMedia = file
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -884,7 +896,11 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
let totalMentionCount = tagSummaryCount - actionsSummaryCount
|
let totalMentionCount = tagSummaryCount - actionsSummaryCount
|
||||||
if !isPeerGroup {
|
if !isPeerGroup {
|
||||||
if totalMentionCount > 0 {
|
if totalMentionCount > 0 {
|
||||||
currentMentionBadgeImage = PresentationResourcesChatList.badgeBackgroundMention(item.presentationData.theme)
|
if Namespaces.PeerGroup.archive == item.peerGroupId {
|
||||||
|
currentMentionBadgeImage = PresentationResourcesChatList.badgeBackgroundInactiveMention(item.presentationData.theme)
|
||||||
|
} else {
|
||||||
|
currentMentionBadgeImage = PresentationResourcesChatList.badgeBackgroundMention(item.presentationData.theme)
|
||||||
|
}
|
||||||
mentionBadgeContent = .mention
|
mentionBadgeContent = .mention
|
||||||
} else if item.index.pinningIndex != nil && !isAd && currentBadgeBackgroundImage == nil {
|
} else if item.index.pinningIndex != nil && !isAd && currentBadgeBackgroundImage == nil {
|
||||||
currentPinnedIconImage = PresentationResourcesChatList.badgeBackgroundPinned(item.presentationData.theme)
|
currentPinnedIconImage = PresentationResourcesChatList.badgeBackgroundPinned(item.presentationData.theme)
|
||||||
|
|||||||
@ -1118,7 +1118,8 @@ final class ContactListNode: ASDisplayNode {
|
|||||||
|> deliverOnMainQueue
|
|> deliverOnMainQueue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.disposable.set(transition.start(next: { [weak self] transition in
|
self.disposable.set((transition
|
||||||
|
|> deliverOnMainQueue).start(next: { [weak self] transition in
|
||||||
self?.enqueueTransition(transition)
|
self?.enqueueTransition(transition)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
@ -278,6 +278,16 @@ public func createGroupController(context: AccountContext, peerIds: [PeerId]) ->
|
|||||||
let controller = ChatController(context: context, chatLocation: .peer(peerId))
|
let controller = ChatController(context: context, chatLocation: .peer(peerId))
|
||||||
replaceControllerImpl?(controller)
|
replaceControllerImpl?(controller)
|
||||||
}
|
}
|
||||||
|
}, error: { error in
|
||||||
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
|
let text: String
|
||||||
|
switch error {
|
||||||
|
case .privacy:
|
||||||
|
text = presentationData.strings.Privacy_GroupsAndChannels_InviteToChannelMultipleError
|
||||||
|
case .generic:
|
||||||
|
text = presentationData.strings.Login_UnknownError
|
||||||
|
}
|
||||||
|
presentControllerImpl?(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}, changeProfilePhoto: {
|
}, changeProfilePhoto: {
|
||||||
|
|||||||
@ -64,6 +64,7 @@ enum PresentationResourceKey: Int32 {
|
|||||||
case chatListBadgeBackgroundActive
|
case chatListBadgeBackgroundActive
|
||||||
case chatListBadgeBackgroundInactive
|
case chatListBadgeBackgroundInactive
|
||||||
case chatListBadgeBackgroundMention
|
case chatListBadgeBackgroundMention
|
||||||
|
case chatListBadgeBackgroundInactiveMention
|
||||||
case chatListBadgeBackgroundPinned
|
case chatListBadgeBackgroundPinned
|
||||||
case chatListMutedIcon
|
case chatListMutedIcon
|
||||||
case chatListVerifiedIcon
|
case chatListVerifiedIcon
|
||||||
|
|||||||
@ -179,6 +179,12 @@ struct PresentationResourcesChatList {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static func badgeBackgroundInactiveMention(_ theme: PresentationTheme) -> UIImage? {
|
||||||
|
return theme.image(PresentationResourceKey.chatListBadgeBackgroundInactiveMention.rawValue, { theme in
|
||||||
|
return generateBadgeBackgroundImage(theme: theme, active: false, icon: generateTintedImage(image: UIImage(bundleImageName: "Chat List/MentionBadgeIcon"), color: theme.chatList.unreadBadgeInactiveTextColor))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
static func badgeBackgroundPinned(_ theme: PresentationTheme) -> UIImage? {
|
static func badgeBackgroundPinned(_ theme: PresentationTheme) -> UIImage? {
|
||||||
return theme.image(PresentationResourceKey.chatListBadgeBackgroundPinned.rawValue, { theme in
|
return theme.image(PresentationResourceKey.chatListBadgeBackgroundPinned.rawValue, { theme in
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat List/PeerPinnedIcon"), color: theme.chatList.pinnedBadgeColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat List/PeerPinnedIcon"), color: theme.chatList.pinnedBadgeColor)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user