mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Restore features
This commit is contained in:
parent
e17b8380a2
commit
495a0f83bb
@ -592,7 +592,7 @@ private func privacyAndSecurityControllerEntries(
|
|||||||
entries.append(.groupPrivacy(presentationData.theme, presentationData.strings.Privacy_GroupsAndChannels, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.groupInvitations)))
|
entries.append(.groupPrivacy(presentationData.theme, presentationData.strings.Privacy_GroupsAndChannels, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.groupInvitations)))
|
||||||
if !isPremiumDisabled {
|
if !isPremiumDisabled {
|
||||||
entries.append(.voiceMessagePrivacy(presentationData.theme, presentationData.strings.Privacy_VoiceMessages, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.voiceMessages), !isPremium))
|
entries.append(.voiceMessagePrivacy(presentationData.theme, presentationData.strings.Privacy_VoiceMessages, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.voiceMessages), !isPremium))
|
||||||
//entries.append(.messagePrivacy(privacySettings.globalSettings.nonContactChatsRequirePremium))
|
entries.append(.messagePrivacy(privacySettings.globalSettings.nonContactChatsRequirePremium))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
entries.append(.phoneNumberPrivacy(presentationData.theme, presentationData.strings.PrivacySettings_PhoneNumber, presentationData.strings.Channel_NotificationLoading))
|
entries.append(.phoneNumberPrivacy(presentationData.theme, presentationData.strings.PrivacySettings_PhoneNumber, presentationData.strings.Channel_NotificationLoading))
|
||||||
|
@ -846,7 +846,7 @@ private func selectivePrivacySettingsControllerEntries(presentationData: Present
|
|||||||
entries.append(.publicPhotoInfo(presentationData.theme, presentationData.strings.Privacy_ProfilePhoto_PublicPhotoInfo))
|
entries.append(.publicPhotoInfo(presentationData.theme, presentationData.strings.Privacy_ProfilePhoto_PublicPhotoInfo))
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if case .presence = kind, let peer {
|
if case .presence = kind, let peer {
|
||||||
entries.append(.hideReadTime(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTime, state.hideReadTimeEnabled == true))
|
entries.append(.hideReadTime(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTime, state.hideReadTimeEnabled == true))
|
||||||
entries.append(.hideReadTimeInfo(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTimeFooter))
|
entries.append(.hideReadTimeInfo(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTimeFooter))
|
||||||
|
|
||||||
@ -854,7 +854,7 @@ private func selectivePrivacySettingsControllerEntries(presentationData: Present
|
|||||||
entries.append(.subscribeToPremium(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTimePremium))
|
entries.append(.subscribeToPremium(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTimePremium))
|
||||||
entries.append(.subscribeToPremiumInfo(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTimePremiumFooter))
|
entries.append(.subscribeToPremiumInfo(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTimePremiumFooter))
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
return entries
|
return entries
|
||||||
}
|
}
|
||||||
|
@ -594,6 +594,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[577659656] = { return Api.NotifyPeer.parse_notifyForumTopic($0) }
|
dict[577659656] = { return Api.NotifyPeer.parse_notifyForumTopic($0) }
|
||||||
dict[-1613493288] = { return Api.NotifyPeer.parse_notifyPeer($0) }
|
dict[-1613493288] = { return Api.NotifyPeer.parse_notifyPeer($0) }
|
||||||
dict[-1261946036] = { return Api.NotifyPeer.parse_notifyUsers($0) }
|
dict[-1261946036] = { return Api.NotifyPeer.parse_notifyUsers($0) }
|
||||||
|
dict[1001931436] = { return Api.OutboxReadDate.parse_outboxReadDate($0) }
|
||||||
dict[-1738178803] = { return Api.Page.parse_page($0) }
|
dict[-1738178803] = { return Api.Page.parse_page($0) }
|
||||||
dict[-837994576] = { return Api.PageBlock.parse_pageBlockAnchor($0) }
|
dict[-837994576] = { return Api.PageBlock.parse_pageBlockAnchor($0) }
|
||||||
dict[-2143067670] = { return Api.PageBlock.parse_pageBlockAudio($0) }
|
dict[-2143067670] = { return Api.PageBlock.parse_pageBlockAudio($0) }
|
||||||
@ -994,11 +995,11 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[-2100168954] = { return Api.UserProfilePhoto.parse_userProfilePhoto($0) }
|
dict[-2100168954] = { return Api.UserProfilePhoto.parse_userProfilePhoto($0) }
|
||||||
dict[1326562017] = { return Api.UserProfilePhoto.parse_userProfilePhotoEmpty($0) }
|
dict[1326562017] = { return Api.UserProfilePhoto.parse_userProfilePhotoEmpty($0) }
|
||||||
dict[164646985] = { return Api.UserStatus.parse_userStatusEmpty($0) }
|
dict[164646985] = { return Api.UserStatus.parse_userStatusEmpty($0) }
|
||||||
dict[2011940674] = { return Api.UserStatus.parse_userStatusLastMonth($0) }
|
dict[1703516023] = { return Api.UserStatus.parse_userStatusLastMonth($0) }
|
||||||
dict[129960444] = { return Api.UserStatus.parse_userStatusLastWeek($0) }
|
dict[1410997530] = { return Api.UserStatus.parse_userStatusLastWeek($0) }
|
||||||
dict[9203775] = { return Api.UserStatus.parse_userStatusOffline($0) }
|
dict[9203775] = { return Api.UserStatus.parse_userStatusOffline($0) }
|
||||||
dict[-306628279] = { return Api.UserStatus.parse_userStatusOnline($0) }
|
dict[-306628279] = { return Api.UserStatus.parse_userStatusOnline($0) }
|
||||||
dict[-496024847] = { return Api.UserStatus.parse_userStatusRecently($0) }
|
dict[2065268168] = { return Api.UserStatus.parse_userStatusRecently($0) }
|
||||||
dict[-1274595769] = { return Api.Username.parse_username($0) }
|
dict[-1274595769] = { return Api.Username.parse_username($0) }
|
||||||
dict[-567037804] = { return Api.VideoSize.parse_videoSize($0) }
|
dict[-567037804] = { return Api.VideoSize.parse_videoSize($0) }
|
||||||
dict[-128171716] = { return Api.VideoSize.parse_videoSizeEmojiMarkup($0) }
|
dict[-128171716] = { return Api.VideoSize.parse_videoSizeEmojiMarkup($0) }
|
||||||
@ -1653,6 +1654,8 @@ public extension Api {
|
|||||||
_1.serialize(buffer, boxed)
|
_1.serialize(buffer, boxed)
|
||||||
case let _1 as Api.NotifyPeer:
|
case let _1 as Api.NotifyPeer:
|
||||||
_1.serialize(buffer, boxed)
|
_1.serialize(buffer, boxed)
|
||||||
|
case let _1 as Api.OutboxReadDate:
|
||||||
|
_1.serialize(buffer, boxed)
|
||||||
case let _1 as Api.Page:
|
case let _1 as Api.Page:
|
||||||
_1.serialize(buffer, boxed)
|
_1.serialize(buffer, boxed)
|
||||||
case let _1 as Api.PageBlock:
|
case let _1 as Api.PageBlock:
|
||||||
|
@ -98,6 +98,42 @@ public extension Api {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public extension Api {
|
||||||
|
enum OutboxReadDate: TypeConstructorDescription {
|
||||||
|
case outboxReadDate(date: Int32)
|
||||||
|
|
||||||
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
|
switch self {
|
||||||
|
case .outboxReadDate(let date):
|
||||||
|
if boxed {
|
||||||
|
buffer.appendInt32(1001931436)
|
||||||
|
}
|
||||||
|
serializeInt32(date, buffer: buffer, boxed: false)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||||
|
switch self {
|
||||||
|
case .outboxReadDate(let date):
|
||||||
|
return ("outboxReadDate", [("date", date as Any)])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static func parse_outboxReadDate(_ reader: BufferReader) -> OutboxReadDate? {
|
||||||
|
var _1: Int32?
|
||||||
|
_1 = reader.readInt32()
|
||||||
|
let _c1 = _1 != nil
|
||||||
|
if _c1 {
|
||||||
|
return Api.OutboxReadDate.outboxReadDate(date: _1!)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
public extension Api {
|
public extension Api {
|
||||||
enum Page: TypeConstructorDescription {
|
enum Page: TypeConstructorDescription {
|
||||||
case page(flags: Int32, url: String, blocks: [Api.PageBlock], photos: [Api.Photo], documents: [Api.Document], views: Int32?)
|
case page(flags: Int32, url: String, blocks: [Api.PageBlock], photos: [Api.Photo], documents: [Api.Document], views: Int32?)
|
||||||
|
@ -801,11 +801,11 @@ public extension Api {
|
|||||||
public extension Api {
|
public extension Api {
|
||||||
enum UserStatus: TypeConstructorDescription {
|
enum UserStatus: TypeConstructorDescription {
|
||||||
case userStatusEmpty
|
case userStatusEmpty
|
||||||
case userStatusLastMonth
|
case userStatusLastMonth(flags: Int32)
|
||||||
case userStatusLastWeek
|
case userStatusLastWeek(flags: Int32)
|
||||||
case userStatusOffline(wasOnline: Int32)
|
case userStatusOffline(wasOnline: Int32)
|
||||||
case userStatusOnline(expires: Int32)
|
case userStatusOnline(expires: Int32)
|
||||||
case userStatusRecently
|
case userStatusRecently(flags: Int32)
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
switch self {
|
switch self {
|
||||||
@ -815,17 +815,17 @@ public extension Api {
|
|||||||
}
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
case .userStatusLastMonth:
|
case .userStatusLastMonth(let flags):
|
||||||
if boxed {
|
if boxed {
|
||||||
buffer.appendInt32(2011940674)
|
buffer.appendInt32(1703516023)
|
||||||
}
|
}
|
||||||
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
break
|
break
|
||||||
case .userStatusLastWeek:
|
case .userStatusLastWeek(let flags):
|
||||||
if boxed {
|
if boxed {
|
||||||
buffer.appendInt32(129960444)
|
buffer.appendInt32(1410997530)
|
||||||
}
|
}
|
||||||
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
break
|
break
|
||||||
case .userStatusOffline(let wasOnline):
|
case .userStatusOffline(let wasOnline):
|
||||||
if boxed {
|
if boxed {
|
||||||
@ -839,11 +839,11 @@ public extension Api {
|
|||||||
}
|
}
|
||||||
serializeInt32(expires, buffer: buffer, boxed: false)
|
serializeInt32(expires, buffer: buffer, boxed: false)
|
||||||
break
|
break
|
||||||
case .userStatusRecently:
|
case .userStatusRecently(let flags):
|
||||||
if boxed {
|
if boxed {
|
||||||
buffer.appendInt32(-496024847)
|
buffer.appendInt32(2065268168)
|
||||||
}
|
}
|
||||||
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -852,16 +852,16 @@ public extension Api {
|
|||||||
switch self {
|
switch self {
|
||||||
case .userStatusEmpty:
|
case .userStatusEmpty:
|
||||||
return ("userStatusEmpty", [])
|
return ("userStatusEmpty", [])
|
||||||
case .userStatusLastMonth:
|
case .userStatusLastMonth(let flags):
|
||||||
return ("userStatusLastMonth", [])
|
return ("userStatusLastMonth", [("flags", flags as Any)])
|
||||||
case .userStatusLastWeek:
|
case .userStatusLastWeek(let flags):
|
||||||
return ("userStatusLastWeek", [])
|
return ("userStatusLastWeek", [("flags", flags as Any)])
|
||||||
case .userStatusOffline(let wasOnline):
|
case .userStatusOffline(let wasOnline):
|
||||||
return ("userStatusOffline", [("wasOnline", wasOnline as Any)])
|
return ("userStatusOffline", [("wasOnline", wasOnline as Any)])
|
||||||
case .userStatusOnline(let expires):
|
case .userStatusOnline(let expires):
|
||||||
return ("userStatusOnline", [("expires", expires as Any)])
|
return ("userStatusOnline", [("expires", expires as Any)])
|
||||||
case .userStatusRecently:
|
case .userStatusRecently(let flags):
|
||||||
return ("userStatusRecently", [])
|
return ("userStatusRecently", [("flags", flags as Any)])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -869,10 +869,26 @@ public extension Api {
|
|||||||
return Api.UserStatus.userStatusEmpty
|
return Api.UserStatus.userStatusEmpty
|
||||||
}
|
}
|
||||||
public static func parse_userStatusLastMonth(_ reader: BufferReader) -> UserStatus? {
|
public static func parse_userStatusLastMonth(_ reader: BufferReader) -> UserStatus? {
|
||||||
return Api.UserStatus.userStatusLastMonth
|
var _1: Int32?
|
||||||
|
_1 = reader.readInt32()
|
||||||
|
let _c1 = _1 != nil
|
||||||
|
if _c1 {
|
||||||
|
return Api.UserStatus.userStatusLastMonth(flags: _1!)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public static func parse_userStatusLastWeek(_ reader: BufferReader) -> UserStatus? {
|
public static func parse_userStatusLastWeek(_ reader: BufferReader) -> UserStatus? {
|
||||||
return Api.UserStatus.userStatusLastWeek
|
var _1: Int32?
|
||||||
|
_1 = reader.readInt32()
|
||||||
|
let _c1 = _1 != nil
|
||||||
|
if _c1 {
|
||||||
|
return Api.UserStatus.userStatusLastWeek(flags: _1!)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public static func parse_userStatusOffline(_ reader: BufferReader) -> UserStatus? {
|
public static func parse_userStatusOffline(_ reader: BufferReader) -> UserStatus? {
|
||||||
var _1: Int32?
|
var _1: Int32?
|
||||||
@ -897,7 +913,15 @@ public extension Api {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static func parse_userStatusRecently(_ reader: BufferReader) -> UserStatus? {
|
public static func parse_userStatusRecently(_ reader: BufferReader) -> UserStatus? {
|
||||||
return Api.UserStatus.userStatusRecently
|
var _1: Int32?
|
||||||
|
_1 = reader.readInt32()
|
||||||
|
let _c1 = _1 != nil
|
||||||
|
if _c1 {
|
||||||
|
return Api.UserStatus.userStatusRecently(flags: _1!)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5655,6 +5655,22 @@ public extension Api.functions.messages {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public extension Api.functions.messages {
|
||||||
|
static func getOutboxReadDate(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.OutboxReadDate>) {
|
||||||
|
let buffer = Buffer()
|
||||||
|
buffer.appendInt32(-1941176739)
|
||||||
|
peer.serialize(buffer, true)
|
||||||
|
serializeInt32(msgId, buffer: buffer, boxed: false)
|
||||||
|
return (FunctionDescription(name: "messages.getOutboxReadDate", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.OutboxReadDate? in
|
||||||
|
let reader = BufferReader(buffer)
|
||||||
|
var result: Api.OutboxReadDate?
|
||||||
|
if let signature = reader.readInt32() {
|
||||||
|
result = Api.parse(reader, signature: signature) as? Api.OutboxReadDate
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
public extension Api.functions.messages {
|
public extension Api.functions.messages {
|
||||||
static func getPeerDialogs(peers: [Api.InputDialogPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.messages.PeerDialogs>) {
|
static func getPeerDialogs(peers: [Api.InputDialogPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.messages.PeerDialogs>) {
|
||||||
let buffer = Buffer()
|
let buffer = Buffer()
|
||||||
@ -9697,6 +9713,25 @@ public extension Api.functions.users {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public extension Api.functions.users {
|
||||||
|
static func getIsPremiumRequiredToContact(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.Bool]>) {
|
||||||
|
let buffer = Buffer()
|
||||||
|
buffer.appendInt32(-1507677680)
|
||||||
|
buffer.appendInt32(481674261)
|
||||||
|
buffer.appendInt32(Int32(id.count))
|
||||||
|
for item in id {
|
||||||
|
item.serialize(buffer, true)
|
||||||
|
}
|
||||||
|
return (FunctionDescription(name: "users.getIsPremiumRequiredToContact", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.Bool]? in
|
||||||
|
let reader = BufferReader(buffer)
|
||||||
|
var result: [Api.Bool]?
|
||||||
|
if let _ = reader.readInt32() {
|
||||||
|
result = Api.parseVector(reader, elementSignature: 0, elementType: Api.Bool.self)
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
public extension Api.functions.users {
|
public extension Api.functions.users {
|
||||||
static func getUsers(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.User]>) {
|
static func getUsers(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.User]>) {
|
||||||
let buffer = Buffer()
|
let buffer = Buffer()
|
||||||
|
@ -12,14 +12,14 @@ extension TelegramUserPresence {
|
|||||||
self.init(status: .present(until: expires), lastActivity: 0)
|
self.init(status: .present(until: expires), lastActivity: 0)
|
||||||
case let .userStatusOffline(wasOnline):
|
case let .userStatusOffline(wasOnline):
|
||||||
self.init(status: .present(until: wasOnline), lastActivity: 0)
|
self.init(status: .present(until: wasOnline), lastActivity: 0)
|
||||||
case .userStatusRecently:
|
case let .userStatusRecently(flags):
|
||||||
let isHidden = false//(flags & (1 << 0)) != 0
|
let isHidden = (flags & (1 << 0)) != 0
|
||||||
self.init(status: .recently(isHidden: isHidden), lastActivity: 0)
|
self.init(status: .recently(isHidden: isHidden), lastActivity: 0)
|
||||||
case .userStatusLastWeek:
|
case let .userStatusLastWeek(flags):
|
||||||
let isHidden = false//(flags & (1 << 0)) != 0
|
let isHidden = (flags & (1 << 0)) != 0
|
||||||
self.init(status: .lastWeek(isHidden: isHidden), lastActivity: 0)
|
self.init(status: .lastWeek(isHidden: isHidden), lastActivity: 0)
|
||||||
case .userStatusLastMonth:
|
case let .userStatusLastMonth(flags):
|
||||||
let isHidden = false//(flags & (1 << 0)) != 0
|
let isHidden = (flags & (1 << 0)) != 0
|
||||||
self.init(status: .lastMonth(isHidden: isHidden), lastActivity: 0)
|
self.init(status: .lastMonth(isHidden: isHidden), lastActivity: 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1388,7 +1388,7 @@ public final class AccountViewTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func internalRefreshCanSendMessagesStatsForPeerIds(peerIds: [PeerId]) {
|
private func internalRefreshCanSendMessagesStatsForPeerIds(peerIds: [PeerId]) {
|
||||||
/*self.queue.async {
|
self.queue.async {
|
||||||
var addedPeerIds: [PeerId] = []
|
var addedPeerIds: [PeerId] = []
|
||||||
let timestamp = Int32(CFAbsoluteTimeGetCurrent())
|
let timestamp = Int32(CFAbsoluteTimeGetCurrent())
|
||||||
for peerId in peerIds {
|
for peerId in peerIds {
|
||||||
@ -1472,7 +1472,7 @@ public final class AccountViewTracker {
|
|||||||
self.updatedUnsupportedMediaDisposables.set(signal.start(), forKey: disposableId)
|
self.updatedUnsupportedMediaDisposables.set(signal.start(), forKey: disposableId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func updateMarkAllMentionsSeen(peerId: PeerId, threadId: Int64?) {
|
public func updateMarkAllMentionsSeen(peerId: PeerId, threadId: Int64?) {
|
||||||
@ -2326,9 +2326,6 @@ public final class AccountViewTracker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var reactionCount: Int32 = 0
|
var reactionCount: Int32 = 0
|
||||||
/*if let view = views.views[pendingReactionsKey] as? PendingMessageActionsSummaryView {
|
|
||||||
reactionCount -= view.count
|
|
||||||
}*/
|
|
||||||
if let view = views.views[summaryReactionsKey] as? MessageHistoryTagSummaryView {
|
if let view = views.views[summaryReactionsKey] as? MessageHistoryTagSummaryView {
|
||||||
if let unseenCount = view.count {
|
if let unseenCount = view.count {
|
||||||
reactionCount += unseenCount
|
reactionCount += unseenCount
|
||||||
|
@ -3,8 +3,7 @@ import Postbox
|
|||||||
import TelegramApi
|
import TelegramApi
|
||||||
|
|
||||||
internal func _internal_updateIsPremiumRequiredToContact(account: Account, peerIds: [EnginePeer.Id]) -> Signal<[EnginePeer.Id], NoError> {
|
internal func _internal_updateIsPremiumRequiredToContact(account: Account, peerIds: [EnginePeer.Id]) -> Signal<[EnginePeer.Id], NoError> {
|
||||||
return .single([])
|
return account.postbox.transaction { transaction -> ([Api.InputUser], [PeerId]) in
|
||||||
/*return account.postbox.transaction { transaction -> ([Api.InputUser], [PeerId]) in
|
|
||||||
var inputUsers: [Api.InputUser] = []
|
var inputUsers: [Api.InputUser] = []
|
||||||
var premiumRequired:[EnginePeer.Id] = []
|
var premiumRequired:[EnginePeer.Id] = []
|
||||||
for id in peerIds {
|
for id in peerIds {
|
||||||
@ -51,7 +50,5 @@ internal func _internal_updateIsPremiumRequiredToContact(account: Account, peerI
|
|||||||
} else {
|
} else {
|
||||||
return .single(premiumRequired)
|
return .single(premiumRequired)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ public class BoxedMessage: NSObject {
|
|||||||
|
|
||||||
public class Serialization: NSObject, MTSerialization {
|
public class Serialization: NSObject, MTSerialization {
|
||||||
public func currentLayer() -> UInt {
|
public func currentLayer() -> UInt {
|
||||||
return 171
|
return 173
|
||||||
}
|
}
|
||||||
|
|
||||||
public func parseMessage(_ data: Data!) -> Any! {
|
public func parseMessage(_ data: Data!) -> Any! {
|
||||||
|
@ -27,8 +27,7 @@ func _internal_messageReadStats(account: Account, id: MessageId) -> Signal<Messa
|
|||||||
}
|
}
|
||||||
|
|
||||||
if id.peerId.namespace == Namespaces.Peer.CloudUser {
|
if id.peerId.namespace == Namespaces.Peer.CloudUser {
|
||||||
return .single(nil)
|
return account.network.request(Api.functions.messages.getOutboxReadDate(peer: inputPeer, msgId: id.id))
|
||||||
/*return account.network.request(Api.functions.messages.getOutboxReadDate(peer: inputPeer, msgId: id.id))
|
|
||||||
|> map(Optional.init)
|
|> map(Optional.init)
|
||||||
|> `catch` { _ -> Signal<Api.OutboxReadDate?, NoError> in
|
|> `catch` { _ -> Signal<Api.OutboxReadDate?, NoError> in
|
||||||
return .single(nil)
|
return .single(nil)
|
||||||
@ -41,7 +40,7 @@ func _internal_messageReadStats(account: Account, id: MessageId) -> Signal<Messa
|
|||||||
case let .outboxReadDate(date):
|
case let .outboxReadDate(date):
|
||||||
return MessageReadStats(reactionCount: 0, peers: [EnginePeer(peer)], readTimestamps: [peer.id: date])
|
return MessageReadStats(reactionCount: 0, peers: [EnginePeer(peer)], readTimestamps: [peer.id: date])
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
} else {
|
} else {
|
||||||
let readPeers: Signal<[(Int64, Int32)]?, NoError> = account.network.request(Api.functions.messages.getMessageReadParticipants(peer: inputPeer, msgId: id.id))
|
let readPeers: Signal<[(Int64, Int32)]?, NoError> = account.network.request(Api.functions.messages.getMessageReadParticipants(peer: inputPeer, msgId: id.id))
|
||||||
|> map { result -> [(Int64, Int32)]? in
|
|> map { result -> [(Int64, Int32)]? in
|
||||||
|
@ -489,16 +489,14 @@ public extension Message {
|
|||||||
|
|
||||||
public extension Message {
|
public extension Message {
|
||||||
func areReactionsTags(accountPeerId: PeerId) -> Bool {
|
func areReactionsTags(accountPeerId: PeerId) -> Bool {
|
||||||
return false
|
if self.id.peerId == accountPeerId {
|
||||||
|
|
||||||
/*if self.id.peerId == accountPeerId {
|
|
||||||
if let reactionsAttribute = self.reactionsAttribute, !reactionsAttribute.reactions.isEmpty {
|
if let reactionsAttribute = self.reactionsAttribute, !reactionsAttribute.reactions.isEmpty {
|
||||||
return reactionsAttribute.isTags
|
return reactionsAttribute.isTags
|
||||||
} else {
|
} else {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false*/
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2656,7 +2656,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
var activate = false
|
var activate = false
|
||||||
if self.searchNavigationNode == nil {
|
if self.searchNavigationNode == nil {
|
||||||
activate = true
|
activate = true
|
||||||
self.searchNavigationNode = ChatSearchNavigationContentNode(context: self.context, theme: self.chatPresentationInterfaceState.theme, strings: self.chatPresentationInterfaceState.strings, chatLocation: self.chatPresentationInterfaceState.chatLocation, interaction: interfaceInteraction)
|
self.searchNavigationNode = ChatSearchNavigationContentNode(context: self.context, theme: self.chatPresentationInterfaceState.theme, strings: self.chatPresentationInterfaceState.strings, chatLocation: self.chatPresentationInterfaceState.chatLocation, interaction: interfaceInteraction, presentationInterfaceState: self.chatPresentationInterfaceState)
|
||||||
}
|
}
|
||||||
self.navigationBar?.setContentNode(self.searchNavigationNode, animated: transitionIsAnimated)
|
self.navigationBar?.setContentNode(self.searchNavigationNode, animated: transitionIsAnimated)
|
||||||
self.searchNavigationNode?.update(presentationInterfaceState: self.chatPresentationInterfaceState)
|
self.searchNavigationNode?.update(presentationInterfaceState: self.chatPresentationInterfaceState)
|
||||||
|
@ -251,9 +251,6 @@ private func canViewReadStats(message: Message, participantCount: Int?, isMessag
|
|||||||
if user.flags.contains(.isSupport) {
|
if user.flags.contains(.isSupport) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if "".isEmpty {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ func titlePanelForChatPresentationInterfaceState(_ chatPresentationInterfaceStat
|
|||||||
if chatPresentationInterfaceState.renderedPeer?.peer?.restrictionText(platform: "ios", contentSettings: context.currentContentSettings.with { $0 }) != nil {
|
if chatPresentationInterfaceState.renderedPeer?.peer?.restrictionText(platform: "ios", contentSettings: context.currentContentSettings.with { $0 }) != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
/*if let search = chatPresentationInterfaceState.search {
|
if let search = chatPresentationInterfaceState.search, chatPresentationInterfaceState.hasSearchTags {
|
||||||
if chatPresentationInterfaceState.chatLocation.peerId == context.account.peerId, case .everything = search.domain {
|
if chatPresentationInterfaceState.chatLocation.peerId == context.account.peerId, case .everything = search.domain {
|
||||||
if let currentPanel = currentPanel as? ChatSearchTitleAccessoryPanelNode {
|
if let currentPanel = currentPanel as? ChatSearchTitleAccessoryPanelNode {
|
||||||
return currentPanel
|
return currentPanel
|
||||||
@ -24,7 +24,7 @@ func titlePanelForChatPresentationInterfaceState(_ chatPresentationInterfaceStat
|
|||||||
} else {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
var inhibitTitlePanelDisplay = false
|
var inhibitTitlePanelDisplay = false
|
||||||
switch chatPresentationInterfaceState.subject {
|
switch chatPresentationInterfaceState.subject {
|
||||||
|
@ -24,7 +24,7 @@ final class ChatSearchNavigationContentNode: NavigationBarContentNode {
|
|||||||
|
|
||||||
private var searchingActivityDisposable: Disposable?
|
private var searchingActivityDisposable: Disposable?
|
||||||
|
|
||||||
init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, chatLocation: ChatLocation, interaction: ChatPanelInterfaceInteraction) {
|
init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, chatLocation: ChatLocation, interaction: ChatPanelInterfaceInteraction, presentationInterfaceState: ChatPresentationInterfaceState) {
|
||||||
self.context = context
|
self.context = context
|
||||||
self.theme = theme
|
self.theme = theme
|
||||||
self.strings = strings
|
self.strings = strings
|
||||||
@ -35,7 +35,7 @@ final class ChatSearchNavigationContentNode: NavigationBarContentNode {
|
|||||||
let placeholderText: String
|
let placeholderText: String
|
||||||
switch chatLocation {
|
switch chatLocation {
|
||||||
case .peer, .replyThread, .feed:
|
case .peer, .replyThread, .feed:
|
||||||
if chatLocation.peerId == context.account.peerId, !"".isEmpty {
|
if chatLocation.peerId == context.account.peerId, presentationInterfaceState.hasSearchTags {
|
||||||
placeholderText = strings.Chat_SearchTagsPlaceholder
|
placeholderText = strings.Chat_SearchTagsPlaceholder
|
||||||
} else {
|
} else {
|
||||||
placeholderText = strings.Conversation_SearchPlaceholder
|
placeholderText = strings.Conversation_SearchPlaceholder
|
||||||
@ -113,7 +113,7 @@ final class ChatSearchNavigationContentNode: NavigationBarContentNode {
|
|||||||
case .peer, .replyThread, .feed:
|
case .peer, .replyThread, .feed:
|
||||||
if presentationInterfaceState.historyFilter != nil {
|
if presentationInterfaceState.historyFilter != nil {
|
||||||
placeholderText = self.strings.Common_Search
|
placeholderText = self.strings.Common_Search
|
||||||
} else if self.chatLocation.peerId == self.context.account.peerId, !"".isEmpty {
|
} else if self.chatLocation.peerId == self.context.account.peerId, presentationInterfaceState.hasSearchTags {
|
||||||
placeholderText = self.strings.Chat_SearchTagsPlaceholder
|
placeholderText = self.strings.Chat_SearchTagsPlaceholder
|
||||||
} else {
|
} else {
|
||||||
placeholderText = self.strings.Conversation_SearchPlaceholder
|
placeholderText = self.strings.Conversation_SearchPlaceholder
|
||||||
|
@ -222,12 +222,14 @@ private final class PeerChannelMemberCategoriesContextsManagerImpl {
|
|||||||
self.profileDataPhotoPreloadContexts[peerId] = context
|
self.profileDataPhotoPreloadContexts[peerId] = context
|
||||||
|
|
||||||
disposable.set(fetch.start(next: { [weak context] value in
|
disposable.set(fetch.start(next: { [weak context] value in
|
||||||
guard let context = context else {
|
Queue.mainQueue().async {
|
||||||
return
|
guard let context = context else {
|
||||||
}
|
return
|
||||||
context.value = value
|
}
|
||||||
for f in context.subscribers.copyItems() {
|
context.value = value
|
||||||
f(value)
|
for f in context.subscribers.copyItems() {
|
||||||
|
f(value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user