Skip to content

Commit

Permalink
"Nicegram plus" release 1.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed Jan 4, 2023
1 parent cb49821 commit b5e85a1
Show file tree
Hide file tree
Showing 738 changed files with 41,292 additions and 17,723 deletions.
3 changes: 3 additions & 0 deletions Nicegram/NGAppCache/Sources/AppCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public final class AppCache {

@UserDefaultsBacked(key: "wasLotteryShown", storage: .standard, defaultValue: false)
public static var wasLotteryShown: Bool

@UserDefaultsBacked(key: "lastSeenBlockedChatId", storage: .standard, defaultValue: nil)
public static var lastSeenBlockedChatId: Int64?

public static var wasLauchedBefore: Bool {
get {
Expand Down

This file was deleted.

5 changes: 2 additions & 3 deletions Nicegram/NGUI/Sources/NicegramSettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,9 @@ private func nicegramSettingsControllerEntries(presentationData: PresentationDat
entries.append(.secretMenu("Secret Menu"))
}

if !hideUnblock,
let url = URL(string: "https://my.nicegram.app") {
if !hideUnblock {
entries.append(.unblockHeader(l("NicegramSettings.Unblock.Header", locale).uppercased()))
entries.append(.unblock(l("NicegramSettings.Unblock.Button", locale), url))
entries.append(.unblock(l("NicegramSettings.Unblock.Button", locale), nicegramUnblockUrl))
}

entries.append(.TabsHeader(l("NicegramSettings.Tabs",
Expand Down
14 changes: 11 additions & 3 deletions Nicegram/NGUtils/Sources/MediaResources.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import SwiftSignalKit
import TelegramCore
import Foundation

public func fetchResource(mediaResourceReference: MediaResourceReference, context: AccountContext) -> Signal<Data?, NoError> {
public func fetchResource(
mediaResourceReference: MediaResourceReference,
userLocation: MediaResourceUserLocation,
userContentType: MediaResourceUserContentType,
context: AccountContext) -> Signal<Data?, NoError> {
let resource = mediaResourceReference.resource
let mediaBox = context.account.postbox.mediaBox

Expand All @@ -29,7 +33,7 @@ public func fetchResource(mediaResourceReference: MediaResourceReference, contex
}, completed: {
subscriber.putCompletion()
})
let fetchedDataDisposable = fetchedMediaResource(mediaBox: mediaBox, reference: mediaResourceReference).start()
let fetchedDataDisposable = fetchedMediaResource(mediaBox: mediaBox, userLocation: userLocation, userContentType: userContentType, reference: mediaResourceReference).start()
return ActionDisposable {
resourceDataDisposable.dispose()
fetchedDataDisposable.dispose()
Expand All @@ -52,5 +56,9 @@ public func fetchAvatarImage(peer: Peer, context: AccountContext) -> Signal<Data
return .single(nil)
}

return fetchResource(mediaResourceReference: .avatar(peer: peerReference, resource: imageRepresentation.resource), context: context)
return fetchResource(
mediaResourceReference: .avatar(peer: peerReference, resource: imageRepresentation.resource),
userLocation: .other,
userContentType: .avatar,
context: context)
}
2 changes: 2 additions & 0 deletions Nicegram/NGWebUtils/Sources/NGWebUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import TelegramCore
import NGData
import NGLogging

public let nicegramUnblockUrl = URL(string: "https://my.nicegram.app")!

fileprivate let LOGTAG = extractNameFromPath(#file)

public func getTgId(_ peer: Peer?) -> Int64 {
Expand Down
2 changes: 1 addition & 1 deletion Random.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c190c625502c4d5a9b1ac0d016da64ce
44eed22b384449bcec8962f2fddbfebd
9 changes: 6 additions & 3 deletions Telegram/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ swift_library(
"//submodules/PasswordSetupUI:PasswordSetupUIResources",
"//submodules/PasswordSetupUI:PasswordSetupUIAssets",
"//submodules/PremiumUI:PremiumUIResources",
"//submodules/DrawingUI:DrawingUIResources",
"//submodules/TelegramUI:TelegramUIResources",
"//submodules/TelegramUI:TelegramUIAssets",
":GeneratedPresentationStrings/Resources/PresentationStrings.data",
Expand Down Expand Up @@ -441,9 +442,9 @@ official_apple_pay_merchants = [
"merchant.org.telegram.Best2pay.test",
"merchant.psbank.test.telegramios",
"merchant.psbank.prod.telegramios",
#"merchant.org.telegram.billinenet.test",
#"merchant.org.telegram.billinenet.prod",
#"merchant.org.telegram.portmone.test",
"merchant.org.telegram.billinenet.test",
"merchant.org.telegram.billinenet.prod",
"merchant.org.telegram.portmone.test",
]

official_bundle_ids = [
Expand Down Expand Up @@ -1862,6 +1863,7 @@ plist_fragment(
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>{telegram_bundle_id}.refresh</string>
<string>{telegram_bundle_id}.cleanup</string>
</array>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
Expand Down Expand Up @@ -1962,6 +1964,7 @@ plist_fragment(
<string>location</string>
<string>remote-notification</string>
<string>voip</string>
<string>processing</string>
</array>
<key>UIDeviceFamily</key>
<array>
Expand Down
15 changes: 15 additions & 0 deletions Telegram/NotificationService/Sources/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1145,14 +1145,20 @@ private final class NotificationServiceHandler {

var fetchMediaSignal: Signal<Data?, NoError> = .single(nil)
if let mediaAttachment = mediaAttachment {
var contentType: MediaResourceUserContentType = .other
var fetchResource: TelegramMultipartFetchableResource?
if let image = mediaAttachment as? TelegramMediaImage, let representation = largestImageRepresentation(image.representations), let resource = representation.resource as? TelegramMultipartFetchableResource {
fetchResource = resource
contentType = .image
} else if let file = mediaAttachment as? TelegramMediaFile {
if file.isSticker {
fetchResource = file.resource as? TelegramMultipartFetchableResource
contentType = .other
} else if file.isVideo {
fetchResource = file.previewRepresentations.first?.resource as? TelegramMultipartFetchableResource
contentType = .video
} else {
contentType = .file
}
}

Expand All @@ -1172,6 +1178,13 @@ private final class NotificationServiceHandler {
parameters: MediaResourceFetchParameters(
tag: nil,
info: resourceFetchInfo(resource: resource),
location: messageId.flatMap { messageId in
return MediaResourceStorageLocation(
peerId: peerId,
messageId: messageId
)
},
contentType: contentType,
isRandomAccessAllowed: true
),
encryptionKey: nil,
Expand Down Expand Up @@ -1223,6 +1236,8 @@ private final class NotificationServiceHandler {
parameters: MediaResourceFetchParameters(
tag: nil,
info: resourceFetchInfo(resource: resource),
location: nil,
contentType: .other,
isRandomAccessAllowed: true
),
encryptionKey: nil,
Expand Down
158 changes: 158 additions & 0 deletions Telegram/Telegram-iOS/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@
"PUSH_CHAT_REACT_INVOICE" = "%2$@|%1$@ %3$@ to your invoice";
"PUSH_CHAT_REACT_GIF" = "%2$@|%1$@ %3$@ to your GIF";

"PUSH_MESSAGE_SUGGEST_USERPIC" = "%1$@ suggested you new profile photo";


"PUSH_REMINDER_TITLE" = "🗓 Reminder";
"PUSH_SENDER_YOU" = "📅 You";

Expand Down Expand Up @@ -7299,6 +7302,7 @@ Sorry for the inconvenience.";
"Contacts.Sort.ByLastSeen" = "by Last Seen";

"ClearCache.Progress" = "Clearing the Cache • %d%";
"ClearCache.NoProgress" = "Clearing the Cache";
"ClearCache.KeepOpenedDescription" = "Please keep this window open until the clearing is completed.";

"Share.ShareAsLink" = "Share as Link";
Expand Down Expand Up @@ -8161,6 +8165,7 @@ Sorry for the inconvenience.";
"EmojiSearch.SearchReactionsEmptyResult" = "No emoji found";
"EmojiSearch.SearchStatusesPlaceholder" = "Search Statuses";
"EmojiSearch.SearchStatusesEmptyResult" = "No emoji found";
"EmojiSearch.SearchEmojiEmptyResult" = "No emoji found";

"ChatList.StartAction" = "Start";
"ChatList.CloseAction" = "Close";
Expand Down Expand Up @@ -8443,3 +8448,156 @@ Sorry for the inconvenience.";
"MessageTimer.LargeShortMonths_any" = "%@m";
"MessageTimer.LargeShortYears_1" = "%@y";
"MessageTimer.LargeShortYears_any" = "%@y";

"Channel.AdminLog.AntiSpamEnabled" = "%1$@ enabled anti-spam";
"Channel.AdminLog.AntiSpamDisabled" = "%1$@ disabled anti-spam";

"UserInfo.SuggestPhoto" = "Suggest Photo for %@";
"UserInfo.SetCustomPhoto" = "Set Photo for %@";
"UserInfo.ChangeCustomPhoto" = "Change Photo for %@";
"UserInfo.ResetCustomPhoto" = "Reset to Original Photo";
"UserInfo.ResetCustomVideo" = "Reset to Original Video";
"UserInfo.RemoveCustomPhoto" = "Remove Photo";
"UserInfo.RemoveCustomVideo" = "Remove Video";
"UserInfo.CustomPhotoInfo" = "You can replace %@’s photo with another photo that only you will see.";

"UserInfo.SuggestPhotoTitle" = "Do you want to suggest a profile picture for %@?";
"UserInfo.SetCustomPhotoTitle" = "Do you want to set a custom profile picture for %@?";

"UserInfo.SuggestPhoto.AlertPhotoText" = "Do you want to suggest %@ to set this photo for his/her profile?";
"UserInfo.SuggestPhoto.AlertVideoText" = "Do you want to suggest %@ to set this video for his/her profile?";
"UserInfo.SuggestPhoto.AlertSuggest" = "Suggest";

"UserInfo.SetCustomPhoto.AlertPhotoText" = "Do you want to set this photo for %@? Only you will see this photo and it will replace any photo %@ sets for themselves.";
"UserInfo.SetCustomPhoto.AlertVideoText" = "Do you want to set this video for %@? Only you will see this video and it will replace any photo %@ sets for themselves.";
"UserInfo.SetCustomPhoto.AlertSet" = "Set";
"UserInfo.SetCustomPhoto.SuccessPhotoText" = "You will now always see this photo for **%@** account.";
"UserInfo.SetCustomPhoto.SuccessVideoText" = "You will now always see this video for **%@** account.";

"UserInfo.CustomPhoto" = "photo set by you";
"UserInfo.CustomVideo" = "video set by you";

"UserInfo.PublicPhoto" = "public photo";
"UserInfo.PublicVideo" = "public video";

"UserInfo.ResetToOriginalAlertText" = "Are you sure you want to reset to %@ original photo?";
"UserInfo.ResetToOriginalAlertReset" = "Reset";

"Conversation.SuggestedPhotoTitle" = "Suggested Photo";
"Conversation.SuggestedPhotoText" = "**%@** suggests you to use this profile photo.";
"Conversation.SuggestedPhotoTextExpanded" = "%@ suggests you to use this profile photo for your Telegram account.";
"Conversation.SuggestedPhotoTextYou" = "You suggested **%@** to use this profile photo.";
"Conversation.SuggestedPhotoView" = "View Photo";
"Conversation.SuggestedPhotoSuccess" = "Photo updated";
"Conversation.SuggestedPhotoSuccessText" = "You can change it in [Settings]().";

"Conversation.SuggestedVideoTitle" = "Suggested Video";
"Conversation.SuggestedVideoText" = "**%@** suggests you to use this profile video.";
"Conversation.SuggestedVideoTextExpanded" = "%@ suggests you to use this profile video for your Telegram account.";
"Conversation.SuggestedVideoTextYou" = "You suggested **%@** to use this profile video.";
"Conversation.SuggestedVideoView" = "View Video";
"Conversation.SuggestedVideoSuccess" = "Video updated";
"Conversation.SuggestedVideoSuccessText" = "You can change it in [Settings]().";

"CacheEvictionMenu.CategoryExceptions_1" = "%@ Exception";
"CacheEvictionMenu.CategoryExceptions_any" = "%@ Exceptions";

"Conversation.Messages_1" = "%@ message";
"Conversation.Messages_any" = "%@ messages";

"Notification.SuggestedProfilePhoto" = "Suggested Profile Photo";
"Notification.SuggestedProfileVideo" = "Suggested Profile Video";

"PhotoEditor.SetAsMyPhoto" = "Set as My Photo";
"PhotoEditor.SetAsMyVideo" = "Set as My Video";

"Notification.BotWriteAllowed" = "You allowed this bot to message you when you added it in the attachment menu.";

"Privacy.ProfilePhoto.SetPublicPhoto" = "Set Public Photo";
"Privacy.ProfilePhoto.UpdatePublicPhoto" = "Update Public Photo";
"Privacy.ProfilePhoto.RemovePublicPhoto" = "Remove Public Photo";
"Privacy.ProfilePhoto.RemovePublicVideo" = "Remove Public Video";
"Privacy.ProfilePhoto.PublicPhotoInfo" = "You can upload a public photo for those who are restricted from viewing your real profile photo.";
"Privacy.ProfilePhoto.PublicPhotoSuccess" = "This photo is now set for those who are restricted from viewing your main photo.";
"Privacy.ProfilePhoto.PublicVideoSuccess" = "This video is now set for those who are restricted from viewing your main photo.";

"Privacy.ProfilePhoto.CustomOverrideInfo" = "You can add users or entire groups which will not see your profile photo.";
"Privacy.ProfilePhoto.CustomOverrideAddInfo" = "Add users or entire groups which will still see your profile photo.";
"Privacy.ProfilePhoto.CustomOverrideBothInfo" = "You can add users or entire groups as exceptions that will override the settings above.";

"WebApp.AddToAttachmentAllowMessages" = "Allow **%@** to send me messages";

"Common.Paste" = "Paste";

"PhotoEditor.SelectCoverFrameSuggestion" = "Choose a cover for this video";

"GroupInfo.TitleMembers_1" = "%@ Member";
"GroupInfo.TitleMembers_any" = "%@ Members";

"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.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?";

"Attachment.EnableSpoiler" = "Hide With Spoiler";
"Attachment.DisableSpoiler" = "Disable Spoiler";

"ProfilePhoto.PublicPhoto" = "public photo";
"ProfilePhoto.PublicVideo" = "public video";

"Paint.Draw" = "Draw";
"Paint.Sticker" = "Sticker";
"Paint.Text" = "Text";
"Paint.ZoomOut" = "Zoom Out";

"Paint.Rectangle" = "Rectangle";
"Paint.Ellipse" = "Ellipse";
"Paint.Bubble" = "Bubble";
"Paint.Star" = "Star";
"Paint.Arrow" = "Arrow";

"Paint.MoveForward" = "Move Forward";

"StorageManagement.Title" = "Storage Usage";
"StorageManagement.TitleCleared" = "Storage Cleared";

"StorageManagement.DescriptionCleared" = "All media can be re-downloaded from the Telegram cloud if you need it again.";
"StorageManagement.DescriptionChatUsage" = "This chat uses %1$@% of your Telegram cache.";
"StorageManagement.DescriptionAppUsage" = "Telegram uses %1$@% of your free disk space.";

"StorageManagement.ClearAll" = "Clear All Cache";
"StorageManagement.ClearSelected" = "Clear Selected";

"StorageManagement.SectionPhotos" = "Photos";
"StorageManagement.SectionVideos" = "Videos";
"StorageManagement.SectionFiles" = "Files";
"StorageManagement.SectionMusic" = "Music";
"StorageManagement.SectionOther" = "Other";
"StorageManagement.SectionStickers" = "Stickers";
"StorageManagement.SectionAvatars" = "Avatars";
"StorageManagement.SectionMiscellaneous" = "Miscellaneous";

"StorageManagement.SectionsDescription" = "All media will stay in the Telegram cloud and can be re-downloaded if you need it again.";

"StorageManagement.AutoremoveHeader" = "AUTO-REMOVE CACHED MEDIA";
"StorageManagement.AutoremoveDescription" = "Photos, videos and other files from cloud chats that you have **not accessed** during this period will be removed from this device to save disk space.";

"StorageManagement.AutoremoveSpaceDescription" = "If your cache size exceeds this limit, the oldest media will be deleted.";

"StorageManagement.TabChats" = "Chats";
"StorageManagement.TabMedia" = "Media";
"StorageManagement.TabFiles" = "Files";
"StorageManagement.TabMusic" = "Music";

"ClearCache.Never" = "Never";

"GroupMembers.HideMembers" = "Hide Members";
"GroupMembers.MembersHiddenOn" = "Switch this off to show the list of members in this group.";
"GroupMembers.MembersHiddenOff" = "Switch this on to hide the list of members in this group. Admins will remain visible.";
11 changes: 10 additions & 1 deletion submodules/AccountContext/Sources/AccountContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,13 @@ public enum ChatListSearchFilter: Equatable {
}
}

public enum InstalledStickerPacksControllerMode {
case general
case modal
case masks
case emoji
}

public let defaultContactLabel: String = "_$!<Mobile>!$_"

public enum CreateGroupMode {
Expand Down Expand Up @@ -815,9 +822,11 @@ public protocol SharedAccountContext: AnyObject {
func makePremiumDemoController(context: AccountContext, subject: PremiumDemoSubject, action: @escaping () -> Void) -> ViewController

func makeStickerPackScreen(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, mainStickerPack: StickerPackReference, stickerPacks: [StickerPackReference], loadedStickerPacks: [LoadedStickerPack], parentNavigationController: NavigationController?, sendSticker: ((FileMediaReference, UIView, CGRect) -> Bool)?) -> ViewController

func makeProxySettingsController(sharedContext: SharedAccountContext, account: UnauthorizedAccount) -> ViewController

func makeInstalledStickerPacksController(context: AccountContext, mode: InstalledStickerPacksControllerMode) -> ViewController

func navigateToCurrentCall()
var hasOngoingCall: ValuePromise<Bool> { get }
var immediateHasOngoingCall: Bool { get }
Expand Down
Loading

0 comments on commit b5e85a1

Please sign in to comment.