Skip to content

Commit 1889fa9

Browse files
committed
bugfixes
1 parent e627d2b commit 1889fa9

96 files changed

Lines changed: 1693 additions & 792 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Telegram-Mac/AccountContext.swift‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ final class AccountContext {
212212
#endif
213213
private(set) var timeDifference:TimeInterval = 0
214214
#if !SHARE
215-
216-
var audioPlayer:APController?
217-
215+
218216

219217
let peerChannelMemberCategoriesContextsManager: PeerChannelMemberCategoriesContextsManager
220218
let blockedPeersContext: BlockedPeersContext
@@ -853,8 +851,6 @@ final class AccountContext {
853851
#if !SHARE
854852
// self.walletPasscodeTimeoutContext.clear()
855853
self.networkStatusManager.cleanup()
856-
self.audioPlayer?.cleanup()
857-
self.audioPlayer = nil
858854
self.diceCache.cleanup()
859855
_chatThemes.set(.single([]))
860856
_cloudThemes.set(.single(.init(themes: [], list: [:], default: nil, custom: nil)))

‎Telegram-Mac/AppDelegate.swift‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ class AppDelegate: NSResponder, NSApplicationDelegate, NSUserNotificationCenterD
865865
if let account = account {
866866

867867
let context = AccountContext(sharedContext: sharedApplicationContext.sharedContext, window: window, account: account)
868-
return AuthorizedApplicationContext(window: window, context: context, launchSettings: settings ?? LaunchSettings.defaultSettings, callSession: sharedContext.getCrossAccountCallSession(), groupCallContext: sharedContext.getCrossAccountGroupCall(), folders: folders)
868+
return AuthorizedApplicationContext(window: window, context: context, launchSettings: settings ?? LaunchSettings.defaultSettings, callSession: sharedContext.getCrossAccountCallSession(), groupCallContext: sharedContext.getCrossAccountGroupCall(), inlinePlayerContext: sharedContext.getCrossInlinePlayer(), folders: folders)
869869

870870
} else {
871871
return nil
@@ -1121,11 +1121,14 @@ class AppDelegate: NSResponder, NSApplicationDelegate, NSUserNotificationCenterD
11211121

11221122
func navigateProfile(_ peerId: PeerId, account: Account) {
11231123
if let context = self.contextValue?.context, context.peerId == account.peerId {
1124-
context.bindings.rootNavigation().push(PeerInfoController(context: context, peerId: peerId))
1124+
PeerInfoController.push(navigation: context.bindings.rootNavigation(), context: context, peerId: peerId)
11251125
context.window.makeKeyAndOrderFront(nil)
11261126
context.window.orderFrontRegardless()
11271127
} else {
1128-
sharedApplicationContextValue?.sharedContext.switchToAccount(id: account.id, action: .profile(peerId, necessary: true))
1128+
let signal = account.postbox.loadedPeerWithId(peerId) |> deliverOnMainQueue
1129+
_ = signal.start(next: { peer in
1130+
self.sharedApplicationContextValue?.sharedContext.switchToAccount(id: account.id, action: .profile(EnginePeer(peer), necessary: true))
1131+
})
11291132
}
11301133
}
11311134
func navigateChat(_ peerId: PeerId, account: Account) {

‎Telegram-Mac/Appearance.swift‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2800,7 +2800,9 @@ private func generateIcons(from palette: ColorPalette, bubbled: Bool) -> Telegra
28002800
message_quote_blue: { NSImage(named: "Icon_Quote")!.precomposed(NSColor(0x368AD1)) },
28012801
message_quote_pink: { NSImage(named: "Icon_Quote")!.precomposed(NSColor(0xC7508B)) },
28022802
message_quote_bubble_incoming: { NSImage(named: "Icon_Quote")!.precomposed(palette.chatReplyTitleBubble_incoming) },
2803-
message_quote_bubble_outgoing: { NSImage(named: "Icon_Quote")!.precomposed(palette.chatReplyTitleBubble_outgoing) }
2803+
message_quote_bubble_outgoing: { NSImage(named: "Icon_Quote")!.precomposed(palette.chatReplyTitleBubble_outgoing) },
2804+
channel_stats_likes: { NSImage(named: "Icon_ChannelStats_Likes")!.precomposed(palette.grayIcon) },
2805+
channel_stats_shares: { NSImage(named: "Icon_ChannelStats_Shares")!.precomposed(palette.grayIcon) }
28042806

28052807
)
28062808
}

‎Telegram-Mac/ApplicationContext.swift‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ final class AuthorizedApplicationContext: NSObject, SplitViewDelegate {
189189

190190
private var launchAction: ApplicationContextLaunchAction?
191191

192-
init(window: Window, context: AccountContext, launchSettings: LaunchSettings, callSession: PCallSession?, groupCallContext: GroupCallContext?, folders: ChatListFolders?) {
192+
init(window: Window, context: AccountContext, launchSettings: LaunchSettings, callSession: PCallSession?, groupCallContext: GroupCallContext?, inlinePlayerContext: InlineAudioPlayerView.ContextObject?, folders: ChatListFolders?) {
193193

194194
self.context = context
195195
emptyController = EmptyChatViewController(context)
@@ -596,13 +596,13 @@ final class AuthorizedApplicationContext: NSObject, SplitViewDelegate {
596596
self.launchAction = .preferences
597597
_ready.set(leftController.settings.ready.get())
598598
leftController.tabController.select(index: leftController.settingsIndex)
599-
case let .profile(peerId, necessary):
599+
case let .profile(peer, necessary):
600600

601601
_ready.set(leftController.chatList.ready.get())
602602
self.leftController.tabController.select(index: self.leftController.chatIndex)
603603

604604
if (necessary || context.layout != .single) {
605-
let controller = PeerInfoController(context: context, peerId: peerId)
605+
let controller = PeerInfoController(context: context, peer: peer._asPeer())
606606
controller.navigationController = self.rightController
607607
controller.loadViewIfNeeded(self.rightController.bounds)
608608

@@ -657,16 +657,13 @@ final class AuthorizedApplicationContext: NSObject, SplitViewDelegate {
657657
if let groupCallContext = groupCallContext {
658658
rightController.callHeader?.show(true, contextObject: groupCallContext)
659659
}
660-
660+
if let inlinePlayerContext = inlinePlayerContext {
661+
rightController.header?.show(true, contextObject: inlinePlayerContext)
662+
}
661663
self.updateFoldersDisposable.set(combineLatest(queue: .mainQueue(), chatListFilterPreferences(engine: context.engine), context.layoutValue).start(next: { [weak self] value, layout in
662664
self?.updateLeftSidebar(with: value, layout: layout, animated: true)
663665
}))
664666

665-
666-
if let controller = context.audioPlayer, let _ = self.rightController.header {
667-
self.rightController.header?.show(false, contextObject: InlineAudioPlayerView.ContextObject(controller: controller, context: context, tableView: nil, supportTableView: nil))
668-
}
669-
670667
// _ready.set(.single(true))
671668
}
672669

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Like_14 (1).png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "Like_14@2x (1).png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"author" : "xcode",
20+
"version" : 1
21+
}
22+
}
277 Bytes
Loading
447 Bytes
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Share_14.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "Share_14@2x.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"author" : "xcode",
20+
"version" : 1
21+
}
22+
}
275 Bytes
Loading
386 Bytes
Loading

0 commit comments

Comments
 (0)