Skip to content

Commit

Permalink
Release 1.6.1 (241)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed May 2, 2024
1 parent c9afa25 commit 64a7c46
Show file tree
Hide file tree
Showing 397 changed files with 23,108 additions and 11,519 deletions.
73 changes: 48 additions & 25 deletions Telegram/NotificationService/Sources/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,8 @@ private final class NotificationServiceHandler {
}
strongSelf.stateManager = stateManager

let accountPeerId = stateManager.accountPeerId

let settings = stateManager.postbox.transaction { transaction -> NotificationSoundList? in
return _internal_cachedNotificationSoundList(transaction: transaction)
}
Expand Down Expand Up @@ -981,7 +983,7 @@ private final class NotificationServiceHandler {
enum Action {
case logout
case poll(peerId: PeerId, content: NotificationContent, messageId: MessageId?)
case pollStories(peerId: PeerId, content: NotificationContent, storyId: Int32)
case pollStories(peerId: PeerId, content: NotificationContent, storyId: Int32, isReaction: Bool)
case deleteMessage([MessageId])
case readReactions([MessageId])
case readMessage(MessageId)
Expand Down Expand Up @@ -1049,7 +1051,7 @@ private final class NotificationServiceHandler {
break
}
} else {
if let aps = payloadJson["aps"] as? [String: Any], let peerId = peerId {
if let aps = payloadJson["aps"] as? [String: Any], var peerId = peerId {
var content: NotificationContent = NotificationContent(isLockedMessage: isLockedMessage)
if let alert = aps["alert"] as? [String: Any] {
if let topicTitleValue = payloadJson["topic_title"] as? String {
Expand Down Expand Up @@ -1078,8 +1080,35 @@ private final class NotificationServiceHandler {

messageIdValue = MessageId(peerId: peerId, namespace: Namespaces.Message.Cloud, id: messageId)
}

var isReaction = false
if let category = aps["category"] as? String {
if peerId.isGroupOrChannel && ["r", "m"].contains(category) {
content.category = "g\(category)"
} else {
content.category = category
}

if aps["r"] != nil || aps["react_emoji"] != nil {
isReaction = true
content.category = "t"
} else if payloadJson["r"] != nil || payloadJson["react_emoji"] != nil {
isReaction = true
content.category = "t"
}

if category == "str" {
isReaction = true
}

let _ = messageId
}

if let storyId = storyId {
interactionAuthorId = peerId
if isReaction {
peerId = accountPeerId
}
content.userInfo["story_id"] = "\(storyId)"
}

Expand Down Expand Up @@ -1147,29 +1176,14 @@ private final class NotificationServiceHandler {
content.sound = sound
}

if let category = aps["category"] as? String {
if peerId.isGroupOrChannel && ["r", "m"].contains(category) {
content.category = "g\(category)"
} else {
content.category = category
}

if aps["r"] != nil || aps["react_emoji"] != nil {
content.category = "t"
} else if payloadJson["r"] != nil || payloadJson["react_emoji"] != nil {
content.category = "t"
}

let _ = messageId
}

if let storyId {
if content.category == "t" {
if isReaction {
content.category = "str"
} else {
content.category = "st"
}
action = .pollStories(peerId: peerId, content: content, storyId: storyId)

action = .pollStories(peerId: peerId, content: content, storyId: storyId, isReaction: isReaction)
} else {
action = .poll(peerId: peerId, content: content, messageId: messageIdValue)
}
Expand Down Expand Up @@ -1648,8 +1662,8 @@ private final class NotificationServiceHandler {
} else {
completed()
}
case let .pollStories(peerId, initialContent, storyId):
Logger.shared.log("NotificationService \(episode)", "Will poll stories for \(peerId)")
case let .pollStories(peerId, initialContent, storyId, isReaction):
Logger.shared.log("NotificationService \(episode)", "Will poll stories for \(peerId) isReaction: \(isReaction)")
if let stateManager = strongSelf.stateManager {
let pollCompletion: (NotificationContent) -> Void = { content in
let content = content
Expand Down Expand Up @@ -1677,8 +1691,12 @@ private final class NotificationServiceHandler {
let firstUnseenItem = transaction.getStoryItems(peerId: peerId).first(where: { entry in
return entry.id > state.maxReadId
})
guard let firstUnseenItem, firstUnseenItem.id == storyId else {
if isReaction {
return nil
} else {
guard let firstUnseenItem, firstUnseenItem.id == storyId else {
return nil
}
}
guard let peer = transaction.getPeer(peerId).flatMap(PeerReference.init) else {
return nil
Expand Down Expand Up @@ -1815,8 +1833,13 @@ private final class NotificationServiceHandler {
}
}

let wasDisplayed = stateManager.postbox.transaction { transaction -> Bool in
return _internal_getStoryNotificationWasDisplayed(transaction: transaction, id: StoryId(peerId: peerId, id: storyId))
let wasDisplayed: Signal<Bool, NoError>
if isReaction {
wasDisplayed = .single(false)
} else {
wasDisplayed = stateManager.postbox.transaction { transaction -> Bool in
return _internal_getStoryNotificationWasDisplayed(transaction: transaction, id: StoryId(peerId: peerId, id: storyId))
}
}

Logger.shared.log("NotificationService \(episode)", "Will fetch media")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "tlogo_24.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.

This file was deleted.

Binary file not shown.
6 changes: 3 additions & 3 deletions Telegram/Telegram-iOS/Icons.xcassets/Shortcuts/Contents.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}
}
132 changes: 132 additions & 0 deletions Telegram/Telegram-iOS/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -11896,6 +11896,7 @@ Sorry for the inconvenience.";
"BusinessLink.ErrorExpired" = "Link Expired";

"WebApp.AlertBiometryAccessText" = "Do you want to allow %@ to use Face ID?";
"WebApp.AlertBiometryAccessTouchIDText" = "Do you want to allow %@ to use Touch ID?";

"StoryList.SubtitleArchived_1" = "1 archived post";
"StoryList.SubtitleArchived_any" = "%d archived posts";
Expand Down Expand Up @@ -12050,3 +12051,134 @@ Sorry for the inconvenience.";
"MediaEditor.NewStickerPack.Title" = "New Sticker Set";
"MediaEditor.NewStickerPack.Text" = "Choose a name for your sticker set.";

"Premium.Gift.ContactSelection.SendMessage" = "Send Message";
"Premium.Gift.ContactSelection.OpenProfile" = "Open Profile";

"Login.EnterWordTitle" = "Enter Word";
"Login.EnterWordText" = "We've sent you an SMS with a secret word to your phone **%@**.";
"Login.EnterWordBeginningText" = "We've sent you an SMS with a secret word that starts with **\"%1$@\"** to your phone **%2$@**.";
"Login.EnterWordPlaceholder" = "Enter Word from SMS";

"Login.EnterPhraseTitle" = "Enter Phrase";
"Login.EnterPhraseText" = "We've sent you an SMS with a secret phrase to your phone **%@**.";
"Login.EnterPhraseBeginningText" = "We've sent you an SMS with a secret phrase that starts with **\"%1$@\"** to your phone **%2$@**.";
"Login.EnterPhrasePlaceholder" = "Enter Phrase from SMS";

"Login.EnterPhraseHint" = "You can copy and paste the phrase here.";
"Login.BackToWord" = "Back to entering the word";
"Login.BackToPhrase" = "Back to entering the phrase";
"Login.BackToCode" = "Back to entering the code";

"Login.WrongPhraseError" = "Incorrect, please try again.";
"Login.Paste" = "Paste";

"Login.ReturnToWord" = "Return to entering the word";
"Login.ReturnToPhrase" = "Return to entering the phrase";
"Login.ReturnToCode" = "Return to entering the code";

"Map.LiveLocationPrivateNewDescription" = "Choose for how long **%@** will see your accurate location, including when the app is closed.";
"Map.LiveLocationGroupNewDescription" = "Choose for how long people in this chat will see your accurate location, including when the app is closed.";

"Map.LiveLocationExtendDescription" = "For how long do you want to extend sharing your location?";

"Map.LiveLocationForMinutes_1" = "For %@ minute";
"Map.LiveLocationForMinutes_any" = "For %@ minutes";

"Map.LiveLocationForHours_1" = "For %@ hour";
"Map.LiveLocationForHours_any" = "For %@ hours";

"Map.LiveLocationIndefinite" = "Until I turn it off";

"Map.TapToAddTime" = "tap to add time";
"Map.SharingLocation" = "Sharing Location...";

"Channel.AdminLog.Settings" = "Settings";

"ChannelProfile.AboutActionCopy" = "Copy";
"ChannelProfile.ToastAboutCopied" = "Copied to clipboard.";

"Conversation.ContextMenuBanFull" = "Ban";

"Channel.AdminLog.MessageManyDeleted" = "%1$@ deleted %2$@ from %3$@";
"Channel.AdminLog.MessageManyDeletedMore" = "%1$@ deleted %2$@ from %3$@ %4$@";
"Channel.AdminLog.MessageManyDeleted.Messages_1" = "%@ message";
"Channel.AdminLog.MessageManyDeleted.Messages_any" = "%@ messages";
"Channel.AdminLog.MessageManyDeleted.ShowAll" = "show all";
"Channel.AdminLog.MessageManyDeleted.HideAll" = "hide all";

"Shortcut.AppIcon" = "Edit App Icon";

"ReportPeer.BanAndReport" = "Ban and Report";

"ReportPeer.ReportReaction.Text" = "Are you sure you want to report reactions from this user?";
"ReportPeer.ReportReaction.BanAndReport" = "Ban and Report";
"ReportPeer.ReportReaction.Report" = "Report Reaction";

"StoryFeed.ViewAnonymously" = "View Anonymously";

"Channel.AdminLogFilter.EventsAdminRights" = "New Admin Rights";
"Channel.AdminLogFilter.EventsExceptions" = "New Exceptions";
"Channel.AdminLogFilter.EventsLeavingGroup" = "Members Left the Group";
"Channel.AdminLogFilter.EventsLeavingChannel" = "Subscribers Removed";

"Channel.AdminLogFilter.RecentActionsTitle" = "Recent Actions";
"Channel.AdminLogFilter.FilterActionsTypeTitle" = "FILTER ACTIONS BY TYPE";
"Channel.AdminLogFilter.FilterActionsAdminsTitle" = "FILTER ACTIONS BY ADMINS";
"Channel.AdminLogFilter.ShowAllAdminsActions" = "Show Actions by All Admins";
"Channel.AdminLogFilter.ApplyFilter" = "Apply Filter";

"Channel.AdminLogFilter.Section.MembersGroup" = "Members and Admins";
"Channel.AdminLogFilter.Section.MembersChannel" = "Subscribers and Admins";
"Channel.AdminLogFilter.Section.SettingsGroup" = "Group Settings";
"Channel.AdminLogFilter.Section.SettingsChannel" = "Channel Settings";
"Channel.AdminLogFilter.Section.Messages" = "Messages";

"Premium.Gift.ContactSelection.AddBirthday" = "Add Your Birthday";

"Story.StealthMode.EnableAndOpenAction" = "Enable and Open the Story";

"Channel.AdminLog.ShowMoreMessages_1" = "Show %@ More Message";
"Channel.AdminLog.ShowMoreMessages_any" = "Show %@ More Messages";

"CreatePoll.OptionCountFooterFormat_1" = "You can add {count} more option.";
"CreatePoll.OptionCountFooterFormat_any" = "You can add {count} more options.";

"Chat.AdminActionSheet.DeleteTitle_1" = "Delete 1 Message";
"Chat.AdminActionSheet.DeleteTitle_any" = "Delete %d Messages";
"Chat.AdminActionSheet.ReportSpam" = "Report Spam";
"Chat.AdminActionSheet.DeleteAllSingle" = "Delete All from %@";
"Chat.AdminActionSheet.DeleteAllMultiple" = "Delete All from Users";
"Chat.AdminActionSheet.BanSingle" = "Ban %@";
"Chat.AdminActionSheet.BanMultiple" = "Ban Users";
"Chat.AdminActionSheet.RestrictSingle" = "Ban %@";
"Chat.AdminActionSheet.RestrictMultiple" = "Ban Users";
"Chat.AdminActionSheet.RestrictSectionHeader" = "ADDITIONAL ACTIONS";
"Chat.AdminActionSheet.BanFooterSingle" = "Fully ban this user";
"Chat.AdminActionSheet.RestrictFooterSingle" = "Partially restrict this user";
"Chat.AdminActionSheet.BanFooterMultiple" = "Fully ban users";
"Chat.AdminActionSheet.RestrictFooterMultiple" = "Partially restrict users";
"Chat.AdminActionSheet.PermissionsSectionHeader" = "WHAT CAN THIS USER DO?";
"Chat.AdminActionSheet.ActionButton" = "Proceed";

"Chat.AdminAction.ToastMessagesDeletedTitleSingle" = "Message Deleted";
"Chat.AdminAction.ToastMessagesDeletedTitleMultiple" = "Messages Deleted";
"Chat.AdminAction.ToastMessagesDeletedTextSingle" = "Message Deleted.";
"Chat.AdminAction.ToastMessagesDeletedTextMultiple" = "Messages Deleted.";
"Chat.AdminAction.ToastReportedSpamText_1" = "**1** user reported for spam.";
"Chat.AdminAction.ToastReportedSpamText_any" = "**%d** users reported for spam.";
"Chat.AdminAction.ToastBannedText_1" = "**1** user banned.";
"Chat.AdminAction.ToastBannedText_any" = "**%d** users banned.";
"Chat.AdminAction.ToastRestrictedText_1" = "**1** user restricted.";
"Chat.AdminAction.ToastRestrictedText_any" = "**%d** users restricted.";

"Chat.MessageForwardInfo.StoryHeader" = "Forwarded story from";
"Chat.MessageForwardInfo.ExpiredStoryHeader" = "Expired story from";
"Chat.MessageForwardInfo.UnavailableStoryHeader" = "Expired story from";
"Chat.MessageForwardInfo.MessageHeader" = "Forwarded from";

"Chat.NavigationNoTopics" = "You have no unread topics";

"Chat.NextSuggestedChannelSwipeProgress" = "Swipe up to go to the next channel";
"Chat.NextSuggestedChannelSwipeAction" = "Release to go to the next channel";
"Chat.NextUnreadTopicSwipeProgress" = "Swipe up to go to the next topic";
"Chat.NextUnreadTopicSwipeAction" = "Release to go to the next topic";
4 changes: 2 additions & 2 deletions build-system/Make/Make.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def build(bazel, arguments):
if arguments.outputBuildArtifactsPath is not None:
artifacts_path = os.path.abspath(arguments.outputBuildArtifactsPath)
if os.path.exists(artifacts_path + '/Telegram.ipa'):
os.remove(path)
os.remove(artifacts_path + '/Telegram.ipa')
if os.path.exists(artifacts_path + '/DSYMs'):
shutil.rmtree(artifacts_path + '/DSYMs')
os.makedirs(artifacts_path, exist_ok=True)
Expand All @@ -625,7 +625,7 @@ def build(bazel, arguments):
sys.exit(1)
shutil.copyfile(ipa_paths[0], artifacts_path + '/Telegram.ipa')

dsym_paths = glob.glob('bazel-bin/Telegram/**/*.dSYM')
dsym_paths = glob.glob('bazel-bin/Telegram/*.dSYM')
for dsym_path in dsym_paths:
file_name = os.path.basename(dsym_path)
shutil.copytree(dsym_path, artifacts_path + '/DSYMs/{}'.format(file_name))
Expand Down
7 changes: 5 additions & 2 deletions submodules/AccountContext/Sources/AccountContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,16 @@ public struct ChatAvailableMessageActionOptions: OptionSet {
public struct ChatAvailableMessageActions {
public var options: ChatAvailableMessageActionOptions
public var banAuthor: Peer?
public var banAuthors: [Peer]
public var disableDelete: Bool
public var isCopyProtected: Bool
public var setTag: Bool
public var editTags: Set<MessageReaction.Reaction>

public init(options: ChatAvailableMessageActionOptions, banAuthor: Peer?, disableDelete: Bool, isCopyProtected: Bool, setTag: Bool, editTags: Set<MessageReaction.Reaction>) {
public init(options: ChatAvailableMessageActionOptions, banAuthor: Peer?, banAuthors: [Peer], disableDelete: Bool, isCopyProtected: Bool, setTag: Bool, editTags: Set<MessageReaction.Reaction>) {
self.options = options
self.banAuthor = banAuthor
self.banAuthors = banAuthors
self.disableDelete = disableDelete
self.isCopyProtected = isCopyProtected
self.setTag = setTag
Expand Down Expand Up @@ -637,6 +639,7 @@ public enum ContactListAction: Equatable {
case generic
case voiceCall
case videoCall
case more
}

public enum ContactListPeer: Equatable {
Expand Down Expand Up @@ -1015,7 +1018,7 @@ public protocol SharedAccountContext: AnyObject {
func makeChatQrCodeScreen(context: AccountContext, peer: Peer, threadId: Int64?, temporary: Bool) -> ViewController

func makePremiumIntroController(context: AccountContext, source: PremiumIntroSource, forceDark: Bool, dismissed: (() -> Void)?) -> ViewController
func makePremiumDemoController(context: AccountContext, subject: PremiumDemoSubject, action: @escaping () -> Void) -> ViewController
func makePremiumDemoController(context: AccountContext, subject: PremiumDemoSubject, forceDark: Bool, action: @escaping () -> Void, dismissed: (() -> Void)?) -> ViewController
func makePremiumLimitController(context: AccountContext, subject: PremiumLimitSubject, count: Int32, forceDark: Bool, cancel: @escaping () -> Void, action: @escaping () -> Bool) -> ViewController
func makePremiumGiftController(context: AccountContext, source: PremiumGiftSource, completion: (() -> Void)?) -> ViewController
func makePremiumPrivacyControllerController(context: AccountContext, subject: PremiumPrivacySubject, peerId: EnginePeer.Id) -> ViewController
Expand Down
Loading

0 comments on commit 64a7c46

Please sign in to comment.