mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 01:22:41 +00:00
Don't display contact controls in My Profile
This commit is contained in:
parent
109d3f4bc4
commit
dba4c79106
@ -1363,70 +1363,72 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let reactionSourceMessageId = reactionSourceMessageId, !data.isContact {
|
|
||||||
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 3, text: presentationData.strings.UserInfo_SendMessage, action: {
|
|
||||||
interaction.openChat(nil)
|
|
||||||
}))
|
|
||||||
|
|
||||||
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 4, text: presentationData.strings.ReportPeer_ReportReaction, color: .destructive, action: {
|
if !isMyProfile {
|
||||||
interaction.openReport(.reaction(reactionSourceMessageId))
|
if let reactionSourceMessageId = reactionSourceMessageId, !data.isContact {
|
||||||
}))
|
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 3, text: presentationData.strings.UserInfo_SendMessage, action: {
|
||||||
} else if let _ = nearbyPeerDistance {
|
interaction.openChat(nil)
|
||||||
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 3, text: presentationData.strings.UserInfo_SendMessage, action: {
|
}))
|
||||||
interaction.openChat(nil)
|
|
||||||
}))
|
|
||||||
|
|
||||||
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 4, text: presentationData.strings.ReportPeer_Report, color: .destructive, action: {
|
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 4, text: presentationData.strings.ReportPeer_ReportReaction, color: .destructive, action: {
|
||||||
interaction.openReport(.user)
|
interaction.openReport(.reaction(reactionSourceMessageId))
|
||||||
}))
|
}))
|
||||||
} else {
|
} else if let _ = nearbyPeerDistance {
|
||||||
if !data.isContact {
|
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 3, text: presentationData.strings.UserInfo_SendMessage, action: {
|
||||||
if user.botInfo == nil {
|
interaction.openChat(nil)
|
||||||
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 3, text: presentationData.strings.PeerInfo_AddToContacts, action: {
|
}))
|
||||||
interaction.openAddContact()
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var isBlocked = false
|
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 4, text: presentationData.strings.ReportPeer_Report, color: .destructive, action: {
|
||||||
if let cachedData = data.cachedData as? CachedUserData, cachedData.isBlocked {
|
interaction.openReport(.user)
|
||||||
isBlocked = true
|
|
||||||
}
|
|
||||||
|
|
||||||
if isBlocked {
|
|
||||||
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 4, text: user.botInfo != nil ? presentationData.strings.Bot_Unblock : presentationData.strings.Conversation_Unblock, action: {
|
|
||||||
interaction.updateBlocked(false)
|
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
if user.flags.contains(.isSupport) || data.isContact {
|
if !data.isContact {
|
||||||
} else {
|
|
||||||
if user.botInfo == nil {
|
if user.botInfo == nil {
|
||||||
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 4, text: presentationData.strings.Conversation_BlockUser, color: .destructive, action: {
|
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 3, text: presentationData.strings.PeerInfo_AddToContacts, action: {
|
||||||
interaction.updateBlocked(true)
|
interaction.openAddContact()
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if let encryptionKeyFingerprint = data.encryptionKeyFingerprint {
|
var isBlocked = false
|
||||||
items[.peerInfo]!.append(PeerInfoScreenDisclosureEncryptionKeyItem(id: 5, text: presentationData.strings.Profile_EncryptionKey, fingerprint: encryptionKeyFingerprint, action: {
|
if let cachedData = data.cachedData as? CachedUserData, cachedData.isBlocked {
|
||||||
interaction.openEncryptionKey()
|
isBlocked = true
|
||||||
}))
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if user.botInfo != nil {
|
if isBlocked {
|
||||||
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 6, text: presentationData.strings.ReportPeer_Report, action: {
|
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 4, text: user.botInfo != nil ? presentationData.strings.Bot_Unblock : presentationData.strings.Conversation_Unblock, action: {
|
||||||
interaction.openReport(.default)
|
interaction.updateBlocked(false)
|
||||||
}))
|
}))
|
||||||
}
|
} else {
|
||||||
|
if user.flags.contains(.isSupport) || data.isContact {
|
||||||
|
} else {
|
||||||
|
if user.botInfo == nil {
|
||||||
|
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 4, text: presentationData.strings.Conversation_BlockUser, color: .destructive, action: {
|
||||||
|
interaction.updateBlocked(true)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let botInfo = user.botInfo, botInfo.flags.contains(.worksWithGroups) {
|
if let encryptionKeyFingerprint = data.encryptionKeyFingerprint {
|
||||||
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 7, text: presentationData.strings.Bot_AddToChat, color: .accent, action: {
|
items[.peerInfo]!.append(PeerInfoScreenDisclosureEncryptionKeyItem(id: 5, text: presentationData.strings.Profile_EncryptionKey, fingerprint: encryptionKeyFingerprint, action: {
|
||||||
interaction.openAddBotToGroup()
|
interaction.openEncryptionKey()
|
||||||
}))
|
}))
|
||||||
items[.peerInfo]!.append(PeerInfoScreenCommentItem(id: 8, text: presentationData.strings.Bot_AddToChatInfo))
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if user.botInfo != nil {
|
||||||
|
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 6, text: presentationData.strings.ReportPeer_Report, action: {
|
||||||
|
interaction.openReport(.default)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
if let botInfo = user.botInfo, botInfo.flags.contains(.worksWithGroups) {
|
||||||
|
items[.peerInfo]!.append(PeerInfoScreenActionItem(id: 7, text: presentationData.strings.Bot_AddToChat, color: .accent, action: {
|
||||||
|
interaction.openAddBotToGroup()
|
||||||
|
}))
|
||||||
|
items[.peerInfo]!.append(PeerInfoScreenCommentItem(id: 8, text: presentationData.strings.Bot_AddToChatInfo))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if let channel = data.peer as? TelegramChannel {
|
} else if let channel = data.peer as? TelegramChannel {
|
||||||
let ItemUsername = 1
|
let ItemUsername = 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user