mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-27 21:50:50 +00:00
Merge commit 'ba5d7051c425c2f2bfd355b9a5e9ef2999f18dd8'
This commit is contained in:
commit
0e6c8c1488
@ -403,14 +403,16 @@ private enum StatsEntry: ItemListNodeEntry {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var options: [ItemListPeerItemRevealOption] = []
|
var options: [ItemListPeerItemRevealOption] = []
|
||||||
|
if !peer.isDeleted {
|
||||||
options.append(ItemListPeerItemRevealOption(type: .accent, title: strings.Stats_GroupTopPoster_History, action: {
|
options.append(ItemListPeerItemRevealOption(type: .accent, title: strings.Stats_GroupTopPoster_History, action: {
|
||||||
arguments.openPeerHistory(peer.id)
|
arguments.openPeerHistory(peer.id)
|
||||||
}))
|
}))
|
||||||
if canPromote {
|
if canPromote && arguments.context.account.peerId != peer.id {
|
||||||
options.append(ItemListPeerItemRevealOption(type: .neutral, title: strings.Stats_GroupTopPoster_Promote, action: {
|
options.append(ItemListPeerItemRevealOption(type: .neutral, title: strings.Stats_GroupTopPoster_Promote, action: {
|
||||||
arguments.promotePeer(peer.id)
|
arguments.promotePeer(peer.id)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: .firstLast, context: arguments.context, peer: peer, height: .generic, aliasHandling: .standard, nameColor: .primary, nameStyle: .plain, presence: nil, text: .text(textComponents.joined(separator: ", ")), label: .none, editing: ItemListPeerItemEditing(editable: true, editing: false, revealed: revealed), revealOptions: ItemListPeerItemRevealOptions(options: options), switchValue: nil, enabled: true, highlighted: false, selectable: arguments.context.account.peerId != peer.id, sectionId: self.section, action: {
|
return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: .firstLast, context: arguments.context, peer: peer, height: .generic, aliasHandling: .standard, nameColor: .primary, nameStyle: .plain, presence: nil, text: .text(textComponents.joined(separator: ", ")), label: .none, editing: ItemListPeerItemEditing(editable: true, editing: false, revealed: revealed), revealOptions: ItemListPeerItemRevealOptions(options: options), switchValue: nil, enabled: true, highlighted: false, selectable: arguments.context.account.peerId != peer.id, sectionId: self.section, action: {
|
||||||
arguments.openPeer(peer.id)
|
arguments.openPeer(peer.id)
|
||||||
}, setPeerIdWithRevealedOptions: { peerId, fromPeerId in
|
}, setPeerIdWithRevealedOptions: { peerId, fromPeerId in
|
||||||
@ -432,14 +434,16 @@ private enum StatsEntry: ItemListNodeEntry {
|
|||||||
textComponents.append(strings.Stats_GroupTopAdminBans(topAdmin.bannedCount))
|
textComponents.append(strings.Stats_GroupTopAdminBans(topAdmin.bannedCount))
|
||||||
}
|
}
|
||||||
var options: [ItemListPeerItemRevealOption] = []
|
var options: [ItemListPeerItemRevealOption] = []
|
||||||
|
if !peer.isDeleted {
|
||||||
options.append(ItemListPeerItemRevealOption(type: .accent, title: strings.Stats_GroupTopAdmin_Actions, action: {
|
options.append(ItemListPeerItemRevealOption(type: .accent, title: strings.Stats_GroupTopAdmin_Actions, action: {
|
||||||
arguments.openPeerAdminActions(peer.id)
|
arguments.openPeerAdminActions(peer.id)
|
||||||
}))
|
}))
|
||||||
if canPromote {
|
if canPromote && arguments.context.account.peerId != peer.id {
|
||||||
options.append(ItemListPeerItemRevealOption(type: .neutral, title: strings.Stats_GroupTopAdmin_Promote, action: {
|
options.append(ItemListPeerItemRevealOption(type: .neutral, title: strings.Stats_GroupTopAdmin_Promote, action: {
|
||||||
arguments.promotePeer(peer.id)
|
arguments.promotePeer(peer.id)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: .firstLast, context: arguments.context, peer: peer, height: .generic, aliasHandling: .standard, nameColor: .primary, nameStyle: .plain, presence: nil, text: .text(textComponents.joined(separator: ", ")), label: .none, editing: ItemListPeerItemEditing(editable: true, editing: false, revealed: revealed), revealOptions: ItemListPeerItemRevealOptions(options: options), switchValue: nil, enabled: true, highlighted: false, selectable: arguments.context.account.peerId != peer.id, sectionId: self.section, action: {
|
return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: .firstLast, context: arguments.context, peer: peer, height: .generic, aliasHandling: .standard, nameColor: .primary, nameStyle: .plain, presence: nil, text: .text(textComponents.joined(separator: ", ")), label: .none, editing: ItemListPeerItemEditing(editable: true, editing: false, revealed: revealed), revealOptions: ItemListPeerItemRevealOptions(options: options), switchValue: nil, enabled: true, highlighted: false, selectable: arguments.context.account.peerId != peer.id, sectionId: self.section, action: {
|
||||||
arguments.openPeer(peer.id)
|
arguments.openPeer(peer.id)
|
||||||
}, setPeerIdWithRevealedOptions: { peerId, fromPeerId in
|
}, setPeerIdWithRevealedOptions: { peerId, fromPeerId in
|
||||||
@ -453,14 +457,16 @@ private enum StatsEntry: ItemListNodeEntry {
|
|||||||
var textComponents: [String] = []
|
var textComponents: [String] = []
|
||||||
textComponents.append(strings.Stats_GroupTopInviterInvites(topInviter.inviteCount))
|
textComponents.append(strings.Stats_GroupTopInviterInvites(topInviter.inviteCount))
|
||||||
var options: [ItemListPeerItemRevealOption] = []
|
var options: [ItemListPeerItemRevealOption] = []
|
||||||
|
if !peer.isDeleted {
|
||||||
options.append(ItemListPeerItemRevealOption(type: .accent, title: strings.Stats_GroupTopPoster_History, action: {
|
options.append(ItemListPeerItemRevealOption(type: .accent, title: strings.Stats_GroupTopPoster_History, action: {
|
||||||
arguments.openPeerHistory(peer.id)
|
arguments.openPeerHistory(peer.id)
|
||||||
}))
|
}))
|
||||||
if canPromote {
|
if canPromote && arguments.context.account.peerId != peer.id {
|
||||||
options.append(ItemListPeerItemRevealOption(type: .neutral, title: strings.Stats_GroupTopPoster_Promote, action: {
|
options.append(ItemListPeerItemRevealOption(type: .neutral, title: strings.Stats_GroupTopPoster_Promote, action: {
|
||||||
arguments.promotePeer(peer.id)
|
arguments.promotePeer(peer.id)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: .firstLast, context: arguments.context, peer: peer, height: .generic, aliasHandling: .standard, nameColor: .primary, nameStyle: .plain, presence: nil, text: .text(textComponents.joined(separator: ", ")), label: .none, editing: ItemListPeerItemEditing(editable: true, editing: false, revealed: revealed), revealOptions: ItemListPeerItemRevealOptions(options: options), switchValue: nil, enabled: true, highlighted: false, selectable: arguments.context.account.peerId != peer.id, sectionId: self.section, action: {
|
return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: .firstLast, context: arguments.context, peer: peer, height: .generic, aliasHandling: .standard, nameColor: .primary, nameStyle: .plain, presence: nil, text: .text(textComponents.joined(separator: ", ")), label: .none, editing: ItemListPeerItemEditing(editable: true, editing: false, revealed: revealed), revealOptions: ItemListPeerItemRevealOptions(options: options), switchValue: nil, enabled: true, highlighted: false, selectable: arguments.context.account.peerId != peer.id, sectionId: self.section, action: {
|
||||||
arguments.openPeer(peer.id)
|
arguments.openPeer(peer.id)
|
||||||
}, setPeerIdWithRevealedOptions: { peerId, fromPeerId in
|
}, setPeerIdWithRevealedOptions: { peerId, fromPeerId in
|
||||||
|
@ -837,10 +837,12 @@ private func settingsEditingItems(data: PeerInfoScreenData?, state: PeerInfoStat
|
|||||||
interaction.openSettings(.username)
|
interaction.openSettings(.username)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
if let settings = data.globalSettings, settings.accountsAndPeers.count + 1 < maximumNumberOfAccounts {
|
||||||
items[.account]!.append(PeerInfoScreenActionItem(id: ItemAddAccount, text: presentationData.strings.Settings_AddAnotherAccount, alignment: .center, action: {
|
items[.account]!.append(PeerInfoScreenActionItem(id: ItemAddAccount, text: presentationData.strings.Settings_AddAnotherAccount, alignment: .center, action: {
|
||||||
interaction.openSettings(.addAccount)
|
interaction.openSettings(.addAccount)
|
||||||
}))
|
}))
|
||||||
items[.account]!.append(PeerInfoScreenCommentItem(id: ItemAddAccountHelp, text: presentationData.strings.Settings_AddAnotherAccount_Help))
|
items[.account]!.append(PeerInfoScreenCommentItem(id: ItemAddAccountHelp, text: presentationData.strings.Settings_AddAnotherAccount_Help))
|
||||||
|
}
|
||||||
|
|
||||||
items[.logout]!.append(PeerInfoScreenActionItem(id: ItemLogout, text: presentationData.strings.Settings_Logout, color: .destructive, alignment: .center, action: {
|
items[.logout]!.append(PeerInfoScreenActionItem(id: ItemLogout, text: presentationData.strings.Settings_Logout, color: .destructive, alignment: .center, action: {
|
||||||
interaction.openSettings(.logout)
|
interaction.openSettings(.logout)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user