Various fixes
@ -8479,14 +8479,16 @@ Sorry for the inconvenience.";
|
|||||||
"Conversation.SuggestedPhotoTextExpanded" = "%@ suggests you to use this profile photo for your Telegram account.";
|
"Conversation.SuggestedPhotoTextExpanded" = "%@ suggests you to use this profile photo for your Telegram account.";
|
||||||
"Conversation.SuggestedPhotoTextYou" = "You suggested **%@** to use this profile photo.";
|
"Conversation.SuggestedPhotoTextYou" = "You suggested **%@** to use this profile photo.";
|
||||||
"Conversation.SuggestedPhotoView" = "View Photo";
|
"Conversation.SuggestedPhotoView" = "View Photo";
|
||||||
"Conversation.SuggestedPhotoSuccess" = "You have updated your Telegram account photo.";
|
"Conversation.SuggestedPhotoSuccess" = "Photo updated";
|
||||||
|
"Conversation.SuggestedPhotoSuccessText" = "You can change it in [Settings]().";
|
||||||
|
|
||||||
"Conversation.SuggestedVideoTitle" = "Suggested Video";
|
"Conversation.SuggestedVideoTitle" = "Suggested Video";
|
||||||
"Conversation.SuggestedVideoText" = "**%@** suggests you to use this profile video.";
|
"Conversation.SuggestedVideoText" = "**%@** suggests you to use this profile video.";
|
||||||
"Conversation.SuggestedVideoTextExpanded" = "%@ suggests you to use this profile video for your Telegram account.";
|
"Conversation.SuggestedVideoTextExpanded" = "%@ suggests you to use this profile video for your Telegram account.";
|
||||||
"Conversation.SuggestedVideoTextYou" = "You suggested **%@** to use this profile video.";
|
"Conversation.SuggestedVideoTextYou" = "You suggested **%@** to use this profile video.";
|
||||||
"Conversation.SuggestedVideoView" = "View Video";
|
"Conversation.SuggestedVideoView" = "View Video";
|
||||||
"Conversation.SuggestedVideoSuccess" = "You have updated your Telegram account video.";
|
"Conversation.SuggestedVideoSuccess" = "Video updated";
|
||||||
|
"Conversation.SuggestedVideoSuccessText" = "You can change it in [Settings]().";
|
||||||
|
|
||||||
"CacheEvictionMenu.CategoryExceptions_1" = "%@ Exception";
|
"CacheEvictionMenu.CategoryExceptions_1" = "%@ Exception";
|
||||||
"CacheEvictionMenu.CategoryExceptions_any" = "%@ Exceptions";
|
"CacheEvictionMenu.CategoryExceptions_any" = "%@ Exceptions";
|
||||||
@ -8525,3 +8527,11 @@ Sorry for the inconvenience.";
|
|||||||
"PeerInfo.HideMembersLimitedParticipantCountText_1" = "Only groups with more than **%d member** can have their member list hidden.";
|
"PeerInfo.HideMembersLimitedParticipantCountText_1" = "Only groups with more than **%d member** can have their member list hidden.";
|
||||||
"PeerInfo.HideMembersLimitedParticipantCountText_any" = "Only groups with more than **%d members** can have their member list hidden.";
|
"PeerInfo.HideMembersLimitedParticipantCountText_any" = "Only groups with more than **%d members** can have their member list hidden.";
|
||||||
"PeerInfo.HideMembersLimitedRights" = "You don't have permission to change this setting.";
|
"PeerInfo.HideMembersLimitedRights" = "You don't have permission to change this setting.";
|
||||||
|
|
||||||
|
"Privacy.Exceptions" = "EXCEPTIONS";
|
||||||
|
"Privacy.ExceptionsCount_1" = "%@ EXCEPTION";
|
||||||
|
"Privacy.ExceptionsCount_any" = "%@ EXCEPTIONS";
|
||||||
|
"Privacy.Exceptions.DeleteAllExceptions" = "Delete All Exceptions";
|
||||||
|
|
||||||
|
"Privacy.Exceptions.DeleteAll" = "Delete All";
|
||||||
|
"Privacy.Exceptions.DeleteAllConfirmation" = "Are you sure you want to delete all exceptions?";
|
||||||
|
|||||||
@ -19,138 +19,174 @@ private final class SelectivePrivacyPeersControllerArguments {
|
|||||||
let removePeer: (PeerId) -> Void
|
let removePeer: (PeerId) -> Void
|
||||||
let addPeer: () -> Void
|
let addPeer: () -> Void
|
||||||
let openPeer: (EnginePeer) -> Void
|
let openPeer: (EnginePeer) -> Void
|
||||||
|
let deleteAll: () -> Void
|
||||||
|
|
||||||
init(context: AccountContext, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, removePeer: @escaping (PeerId) -> Void, addPeer: @escaping () -> Void, openPeer: @escaping (EnginePeer) -> Void) {
|
init(context: AccountContext, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, removePeer: @escaping (PeerId) -> Void, addPeer: @escaping () -> Void, openPeer: @escaping (EnginePeer) -> Void, deleteAll: @escaping () -> Void) {
|
||||||
self.context = context
|
self.context = context
|
||||||
self.setPeerIdWithRevealedOptions = setPeerIdWithRevealedOptions
|
self.setPeerIdWithRevealedOptions = setPeerIdWithRevealedOptions
|
||||||
self.removePeer = removePeer
|
self.removePeer = removePeer
|
||||||
self.addPeer = addPeer
|
self.addPeer = addPeer
|
||||||
self.openPeer = openPeer
|
self.openPeer = openPeer
|
||||||
|
self.deleteAll = deleteAll
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum SelectivePrivacyPeersSection: Int32 {
|
private enum SelectivePrivacyPeersSection: Int32 {
|
||||||
case add
|
|
||||||
case peers
|
case peers
|
||||||
|
case delete
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum SelectivePrivacyPeersEntryStableId: Hashable {
|
private enum SelectivePrivacyPeersEntryStableId: Hashable {
|
||||||
|
case header
|
||||||
case add
|
case add
|
||||||
case peer(PeerId)
|
case peer(PeerId)
|
||||||
|
case delete
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum SelectivePrivacyPeersEntry: ItemListNodeEntry {
|
private enum SelectivePrivacyPeersEntry: ItemListNodeEntry {
|
||||||
case peerItem(Int32, PresentationTheme, PresentationStrings, PresentationDateTimeFormat, PresentationPersonNameOrder, SelectivePrivacyPeer, ItemListPeerItemEditing, Bool)
|
case peerItem(Int32, PresentationTheme, PresentationStrings, PresentationDateTimeFormat, PresentationPersonNameOrder, SelectivePrivacyPeer, ItemListPeerItemEditing, Bool)
|
||||||
case addItem(PresentationTheme, String, Bool)
|
case addItem(PresentationTheme, String, Bool)
|
||||||
|
case headerItem(PresentationTheme, String)
|
||||||
|
case deleteItem(PresentationTheme, String)
|
||||||
|
|
||||||
var section: ItemListSectionId {
|
var section: ItemListSectionId {
|
||||||
switch self {
|
switch self {
|
||||||
case .peerItem:
|
case .addItem, .peerItem, .headerItem:
|
||||||
return SelectivePrivacyPeersSection.peers.rawValue
|
return SelectivePrivacyPeersSection.peers.rawValue
|
||||||
case .addItem:
|
case .deleteItem:
|
||||||
return SelectivePrivacyPeersSection.add.rawValue
|
return SelectivePrivacyPeersSection.delete.rawValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var stableId: SelectivePrivacyPeersEntryStableId {
|
var stableId: SelectivePrivacyPeersEntryStableId {
|
||||||
switch self {
|
switch self {
|
||||||
case let .peerItem(_, _, _, _, _, peer, _, _):
|
case let .peerItem(_, _, _, _, _, peer, _, _):
|
||||||
return .peer(peer.peer.id)
|
return .peer(peer.peer.id)
|
||||||
case .addItem:
|
case .addItem:
|
||||||
return .add
|
return .add
|
||||||
|
case .headerItem:
|
||||||
|
return .header
|
||||||
|
case .deleteItem:
|
||||||
|
return .delete
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static func ==(lhs: SelectivePrivacyPeersEntry, rhs: SelectivePrivacyPeersEntry) -> Bool {
|
static func ==(lhs: SelectivePrivacyPeersEntry, rhs: SelectivePrivacyPeersEntry) -> Bool {
|
||||||
switch lhs {
|
switch lhs {
|
||||||
case let .peerItem(lhsIndex, lhsTheme, lhsStrings, lhsDateTimeFormat, lhsNameOrder, lhsPeer, lhsEditing, lhsEnabled):
|
case let .peerItem(lhsIndex, lhsTheme, lhsStrings, lhsDateTimeFormat, lhsNameOrder, lhsPeer, lhsEditing, lhsEnabled):
|
||||||
if case let .peerItem(rhsIndex, rhsTheme, rhsStrings, rhsDateTimeFormat, rhsNameOrder, rhsPeer, rhsEditing, rhsEnabled) = rhs {
|
if case let .peerItem(rhsIndex, rhsTheme, rhsStrings, rhsDateTimeFormat, rhsNameOrder, rhsPeer, rhsEditing, rhsEnabled) = rhs {
|
||||||
if lhsIndex != rhsIndex {
|
if lhsIndex != rhsIndex {
|
||||||
return false
|
|
||||||
}
|
|
||||||
if lhsPeer != rhsPeer {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if lhsTheme !== rhsTheme {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if lhsStrings !== rhsStrings {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if lhsDateTimeFormat != rhsDateTimeFormat {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if lhsNameOrder != rhsNameOrder {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if lhsEditing != rhsEditing {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if lhsEnabled != rhsEnabled {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
} else {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
case let .addItem(lhsTheme, lhsText, lhsEditing):
|
if lhsPeer != rhsPeer {
|
||||||
if case let .addItem(rhsTheme, rhsText, rhsEditing) = rhs, lhsTheme === rhsTheme, lhsText == rhsText, lhsEditing == rhsEditing {
|
|
||||||
return true
|
|
||||||
} else {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if lhsTheme !== rhsTheme {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if lhsStrings !== rhsStrings {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if lhsDateTimeFormat != rhsDateTimeFormat {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if lhsNameOrder != rhsNameOrder {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if lhsEditing != rhsEditing {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if lhsEnabled != rhsEnabled {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
case let .addItem(lhsTheme, lhsText, lhsEditing):
|
||||||
|
if case let .addItem(rhsTheme, rhsText, rhsEditing) = rhs, lhsTheme === rhsTheme, lhsText == rhsText, lhsEditing == rhsEditing {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
case let .headerItem(lhsTheme, lhsText):
|
||||||
|
if case let .headerItem(rhsTheme, rhsText) = rhs, lhsTheme === rhsTheme, lhsText == rhsText {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
case let .deleteItem(lhsTheme, lhsText):
|
||||||
|
if case let .deleteItem(rhsTheme, rhsText) = rhs, lhsTheme === rhsTheme, lhsText == rhsText {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static func <(lhs: SelectivePrivacyPeersEntry, rhs: SelectivePrivacyPeersEntry) -> Bool {
|
static func <(lhs: SelectivePrivacyPeersEntry, rhs: SelectivePrivacyPeersEntry) -> Bool {
|
||||||
switch lhs {
|
switch lhs {
|
||||||
|
case .deleteItem:
|
||||||
|
return false
|
||||||
case let .peerItem(index, _, _, _, _, _, _, _):
|
case let .peerItem(index, _, _, _, _, _, _, _):
|
||||||
switch rhs {
|
switch rhs {
|
||||||
|
case .deleteItem:
|
||||||
|
return true
|
||||||
case let .peerItem(rhsIndex, _, _, _, _, _, _, _):
|
case let .peerItem(rhsIndex, _, _, _, _, _, _, _):
|
||||||
return index < rhsIndex
|
return index < rhsIndex
|
||||||
case .addItem:
|
case .addItem, .headerItem:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
case .addItem:
|
case .addItem:
|
||||||
switch rhs {
|
switch rhs {
|
||||||
case .peerItem:
|
case .peerItem, .deleteItem:
|
||||||
return true
|
return true
|
||||||
|
case .headerItem:
|
||||||
|
return false
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
case .headerItem:
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem {
|
func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem {
|
||||||
let arguments = arguments as! SelectivePrivacyPeersControllerArguments
|
let arguments = arguments as! SelectivePrivacyPeersControllerArguments
|
||||||
switch self {
|
switch self {
|
||||||
case let .peerItem(_, _, strings, dateTimeFormat, nameDisplayOrder, peer, editing, enabled):
|
case let .peerItem(_, _, strings, dateTimeFormat, nameDisplayOrder, peer, editing, enabled):
|
||||||
var text: ItemListPeerItemText = .none
|
var text: ItemListPeerItemText = .none
|
||||||
if let group = peer.peer as? TelegramGroup {
|
if let group = peer.peer as? TelegramGroup {
|
||||||
text = .text(strings.Conversation_StatusMembers(Int32(group.participantCount)), .secondary)
|
text = .text(strings.Conversation_StatusMembers(Int32(group.participantCount)), .secondary)
|
||||||
} else if let channel = peer.peer as? TelegramChannel {
|
} else if let channel = peer.peer as? TelegramChannel {
|
||||||
if let participantCount = peer.participantCount {
|
if let participantCount = peer.participantCount {
|
||||||
text = .text(strings.Conversation_StatusMembers(Int32(participantCount)), .secondary)
|
text = .text(strings.Conversation_StatusMembers(Int32(participantCount)), .secondary)
|
||||||
} else {
|
} else {
|
||||||
switch channel.info {
|
switch channel.info {
|
||||||
case .group:
|
case .group:
|
||||||
text = .text(strings.Group_Status, .secondary)
|
text = .text(strings.Group_Status, .secondary)
|
||||||
case .broadcast:
|
case .broadcast:
|
||||||
text = .text(strings.Channel_Status, .secondary)
|
text = .text(strings.Channel_Status, .secondary)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, context: arguments.context, peer: EnginePeer(peer.peer), presence: nil, text: text, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: {
|
}
|
||||||
arguments.openPeer(EnginePeer(peer.peer))
|
return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, context: arguments.context, peer: EnginePeer(peer.peer), presence: nil, text: text, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: {
|
||||||
}, setPeerIdWithRevealedOptions: { previousId, id in
|
arguments.openPeer(EnginePeer(peer.peer))
|
||||||
arguments.setPeerIdWithRevealedOptions(previousId, id)
|
}, setPeerIdWithRevealedOptions: { previousId, id in
|
||||||
}, removePeer: { peerId in
|
arguments.setPeerIdWithRevealedOptions(previousId, id)
|
||||||
arguments.removePeer(peerId)
|
}, removePeer: { peerId in
|
||||||
})
|
arguments.removePeer(peerId)
|
||||||
case let .addItem(theme, text, editing):
|
})
|
||||||
return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.plusIconImage(theme), title: text, sectionId: self.section, editing: editing, action: {
|
case let .addItem(theme, text, editing):
|
||||||
|
return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.plusIconImage(theme), title: text, sectionId: self.section, height: .compactPeerList, editing: editing, action: {
|
||||||
arguments.addPeer()
|
arguments.addPeer()
|
||||||
})
|
})
|
||||||
|
case let .headerItem(_, text):
|
||||||
|
return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section)
|
||||||
|
case let .deleteItem(_, text):
|
||||||
|
return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: {
|
||||||
|
arguments.deleteAll()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -191,6 +227,13 @@ private struct SelectivePrivacyPeersControllerState: Equatable {
|
|||||||
private func selectivePrivacyPeersControllerEntries(presentationData: PresentationData, state: SelectivePrivacyPeersControllerState, peers: [SelectivePrivacyPeer]) -> [SelectivePrivacyPeersEntry] {
|
private func selectivePrivacyPeersControllerEntries(presentationData: PresentationData, state: SelectivePrivacyPeersControllerState, peers: [SelectivePrivacyPeer]) -> [SelectivePrivacyPeersEntry] {
|
||||||
var entries: [SelectivePrivacyPeersEntry] = []
|
var entries: [SelectivePrivacyPeersEntry] = []
|
||||||
|
|
||||||
|
let title: String
|
||||||
|
if peers.isEmpty {
|
||||||
|
title = presentationData.strings.Privacy_Exceptions
|
||||||
|
} else {
|
||||||
|
title = presentationData.strings.Privacy_ExceptionsCount(Int32(peers.count))
|
||||||
|
}
|
||||||
|
entries.append(.headerItem(presentationData.theme, title))
|
||||||
entries.append(.addItem(presentationData.theme, presentationData.strings.Privacy_AddNewPeer, state.editing))
|
entries.append(.addItem(presentationData.theme, presentationData.strings.Privacy_AddNewPeer, state.editing))
|
||||||
|
|
||||||
var index: Int32 = 0
|
var index: Int32 = 0
|
||||||
@ -199,6 +242,10 @@ private func selectivePrivacyPeersControllerEntries(presentationData: Presentati
|
|||||||
index += 1
|
index += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !peers.isEmpty {
|
||||||
|
entries.append(.deleteItem(presentationData.theme, presentationData.strings.Privacy_Exceptions_DeleteAllExceptions))
|
||||||
|
}
|
||||||
|
|
||||||
return entries
|
return entries
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,6 +375,34 @@ public func selectivePrivacyPeersController(context: AccountContext, title: Stri
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
pushControllerImpl?(controller)
|
pushControllerImpl?(controller)
|
||||||
|
}, deleteAll: {
|
||||||
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
|
let actionSheet = ActionSheetController(presentationData: presentationData)
|
||||||
|
actionSheet.setItemGroups([ActionSheetItemGroup(items: [
|
||||||
|
ActionSheetTextItem(title: presentationData.strings.Privacy_Exceptions_DeleteAllConfirmation),
|
||||||
|
ActionSheetButtonItem(title: presentationData.strings.Privacy_Exceptions_DeleteAll, color: .destructive, action: { [weak actionSheet] in
|
||||||
|
actionSheet?.dismissAnimated()
|
||||||
|
|
||||||
|
let applyPeers: Signal<Void, NoError> = peersPromise.get()
|
||||||
|
|> take(1)
|
||||||
|
|> deliverOnMainQueue
|
||||||
|
|> mapToSignal { _ -> Signal<Void, NoError> in
|
||||||
|
peersPromise.set(.single([]))
|
||||||
|
updated([:])
|
||||||
|
|
||||||
|
dismissImpl?()
|
||||||
|
|
||||||
|
return .complete()
|
||||||
|
}
|
||||||
|
|
||||||
|
removePeerDisposable.set(applyPeers.start())
|
||||||
|
})
|
||||||
|
]), ActionSheetItemGroup(items: [
|
||||||
|
ActionSheetButtonItem(title: presentationData.strings.Common_Cancel, color: .accent, font: .bold, action: { [weak actionSheet] in
|
||||||
|
actionSheet?.dismissAnimated()
|
||||||
|
})
|
||||||
|
])])
|
||||||
|
presentControllerImpl?(actionSheet, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
var previousPeers: [SelectivePrivacyPeer]?
|
var previousPeers: [SelectivePrivacyPeer]?
|
||||||
|
|||||||
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "arrowTip.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 361 B |
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "blurTip.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 2.0 KiB |
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "xmarkTip.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 400 B |
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "roundTip.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 428 B |
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "EraserRemove.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 776 B |
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"filename" : "Pencil.png",
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 1.0 KiB |
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "lasso.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 10 KiB |
@ -6804,7 +6804,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
}
|
}
|
||||||
|
|
||||||
var dismissStatus: (() -> Void)?
|
var dismissStatus: (() -> Void)?
|
||||||
if [.suggest, .fallback].contains(mode) {
|
if [.suggest, .fallback, .accept].contains(mode) {
|
||||||
let statusController = OverlayStatusController(theme: self.presentationData.theme, type: .loading(cancelled: { [weak self] in
|
let statusController = OverlayStatusController(theme: self.presentationData.theme, type: .loading(cancelled: { [weak self] in
|
||||||
self?.updateAvatarDisposable.set(nil)
|
self?.updateAvatarDisposable.set(nil)
|
||||||
dismissStatus?()
|
dismissStatus?()
|
||||||
@ -6851,7 +6851,12 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
case .accept:
|
case .accept:
|
||||||
(strongSelf.controller?.parentController?.topViewController as? ViewController)?.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .image(image: image, title: nil, text: strongSelf.presentationData.strings.Conversation_SuggestedPhotoSuccess, round: true, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { _ in return false }), in: .current)
|
(strongSelf.controller?.parentController?.topViewController as? ViewController)?.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .image(image: image, title: strongSelf.presentationData.strings.Conversation_SuggestedPhotoSuccess, text: strongSelf.presentationData.strings.Conversation_SuggestedPhotoSuccessText, round: true, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { [weak self] action in
|
||||||
|
if case .info = action {
|
||||||
|
self?.controller?.parentController?.openSettings()
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}), in: .current)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -6974,7 +6979,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
}
|
}
|
||||||
|
|
||||||
var dismissStatus: (() -> Void)?
|
var dismissStatus: (() -> Void)?
|
||||||
if [.suggest, .fallback].contains(mode) {
|
if [.suggest, .fallback, .accept].contains(mode) {
|
||||||
let statusController = OverlayStatusController(theme: self.presentationData.theme, type: .loading(cancelled: { [weak self] in
|
let statusController = OverlayStatusController(theme: self.presentationData.theme, type: .loading(cancelled: { [weak self] in
|
||||||
self?.updateAvatarDisposable.set(nil)
|
self?.updateAvatarDisposable.set(nil)
|
||||||
dismissStatus?()
|
dismissStatus?()
|
||||||
@ -7048,7 +7053,12 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
case .accept:
|
case .accept:
|
||||||
(strongSelf.controller?.parentController?.topViewController as? ViewController)?.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .image(image: image, title: nil, text: strongSelf.presentationData.strings.Conversation_SuggestedVideoSuccess, round: true, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { _ in return false }), in: .current)
|
(strongSelf.controller?.parentController?.topViewController as? ViewController)?.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .image(image: image, title: strongSelf.presentationData.strings.Conversation_SuggestedVideoSuccess, text: strongSelf.presentationData.strings.Conversation_SuggestedVideoSuccessText, round: true, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { [weak self] action in
|
||||||
|
if case .info = action {
|
||||||
|
self?.controller?.parentController?.openSettings()
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}), in: .current)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -7158,7 +7168,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let controller = WebSearchController(context: strongSelf.context, updatedPresentationData: strongSelf.controller?.updatedPresentationData, peer: peer, chatLocation: nil, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: strongSelf.isSettings ? nil : peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder), completion: { [weak self] result in
|
let controller = WebSearchController(context: strongSelf.context, updatedPresentationData: strongSelf.controller?.updatedPresentationData, peer: peer, chatLocation: nil, configuration: searchBotsConfiguration, mode: .avatar(initialQuery: strongSelf.isSettings ? nil : peer.compactDisplayTitle, completion: { [weak self] result in
|
||||||
assetsController?.dismiss()
|
assetsController?.dismiss()
|
||||||
self?.updateProfilePhoto(result, mode: mode)
|
self?.updateProfilePhoto(result, mode: mode)
|
||||||
}))
|
}))
|
||||||
|
|||||||
@ -188,4 +188,16 @@ public final class TelegramRootController: NavigationController {
|
|||||||
controller.view.endEditing(true)
|
controller.view.endEditing(true)
|
||||||
presentedLegacyShortcutCamera(context: self.context, saveCapturedMedia: false, saveEditedPhotos: false, mediaGrouping: true, parentController: controller)
|
presentedLegacyShortcutCamera(context: self.context, saveCapturedMedia: false, saveEditedPhotos: false, mediaGrouping: true, parentController: controller)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func openSettings() {
|
||||||
|
guard let rootTabController = self.rootTabController else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
self.popToRoot(animated: false)
|
||||||
|
|
||||||
|
if let index = rootTabController.controllers.firstIndex(where: { $0 is PeerInfoScreenImpl }) {
|
||||||
|
rootTabController.selectedIndex = index
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||