Skip to content

Commit

Permalink
- bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
overtake committed May 24, 2024
1 parent f5a5da7 commit ef0f84e
Show file tree
Hide file tree
Showing 63 changed files with 1,241 additions and 267 deletions.
4 changes: 2 additions & 2 deletions Telegram-Mac/ApplicationContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,11 @@ final class AuthorizedApplicationContext: NSObject, SplitViewDelegate {

#if DEBUG
self.context.window.set(handler: { _ -> KeyHandlerResult in

// showModal(with: Star_Transaction(context: context, peer: .init(context.myPeer!), transaction: StarsContext.State.Transaction.init(id: "kqwjeflklqwkejflqwkejflqkwejflqkwejf", count: 1000, date: Int32(Date().timeIntervalSince1970), peer: StarsContext.State.Transaction.Peer.appStore)), for: context.window)
// showModal(with: FactCheckController(context: context), for: context.window)
// showModal(with: Star_PurschaseInApp(context: context, peerId: context.peerId), for: context.window)

// context.bindings.rootNavigation().push(HashtagSearchController(context, hashtag: "#test", peerId: context.peerId))
context.bindings.rootNavigation().push(HashtagSearchController(context, hashtag: "#test", peerId: context.peerId))

return .invoked
}, with: self, for: .T, priority: .supreme, modifierFlags: [.command])
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "android_top-up.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "apple_top-up.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "fragment_top-up.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "premiumbot_top-up.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "stars_top-up.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions Telegram-Mac/AutomaticBusinessMessageSetupChatContents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import SwiftSignalKit


final class AutomaticBusinessMessageSetupChatContents: ChatCustomContentsProtocol {


private final class PendingMessageContext {
let disposable = MetaDisposable()
var message: Message?
Expand Down Expand Up @@ -178,6 +180,22 @@ final class AutomaticBusinessMessageSetupChatContents: ChatCustomContentsProtoco
self.context.engine.accountData.editMessageShortcut(id: shortcutId, shortcut: value)
}
}
func messagesAtIds(_ ids: [MessageId], album: Bool) -> Signal<[Message], NoError> {
let messages = self.mergedHistoryView?.entries.map { $0.message } ?? []

var filtered = messages.filter({ ids.contains($0.id) })

if album {
let grouping = filtered.filter{ $0.groupingKey != nil }
for groupMessage in grouping {
let additional = messages.filter { $0.groupingKey == groupMessage.groupingKey && $0.id != groupMessage.id }
filtered.append(contentsOf: additional)
}
}

return .single(filtered)
}

}

var kind: ChatCustomContentsKind
Expand Down Expand Up @@ -209,6 +227,8 @@ final class AutomaticBusinessMessageSetupChatContents: ChatCustomContentsProtoco
initialShortcut = "hello"
case let .quickReplyMessageInput(shortcut):
initialShortcut = shortcut
case .searchHashtag:
fatalError()
}

let queue = Queue()
Expand Down Expand Up @@ -245,5 +265,22 @@ final class AutomaticBusinessMessageSetupChatContents: ChatCustomContentsProtoco
impl.quickReplyUpdateShortcut(value: value)
}
}

func messagesAtIds(_ ids: [MessageId], album: Bool) -> Signal<[Message], NoError> {
return self.impl.signalWith({ impl, subscriber in
return impl.messagesAtIds(ids, album: album).startStandalone(next: { messages in
subscriber.putNext(messages)
subscriber.putCompletion()
})
})
}

func hashtagSearchUpdate(query: String) {

}
func loadMore() {

}
var hashtagSearchResultsUpdate: ((SearchMessagesResult, SearchMessagesState)) -> Void = { _ in }
}

19 changes: 11 additions & 8 deletions Telegram-Mac/ChatAudioContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,22 @@ class ChatAudioContentView: ChatMediaContentView, APDelegate {

func checkState(animated: Bool) {

let presentation: ChatMediaPresentation = parameters?.presentation ?? .Empty
if let parent = parent, let controller = context?.sharedContext.getAudioPlayer(), let song = controller.currentSong {
if song.entry.isEqual(to: parent), case .playing = song.state {
progressView.theme = RadialProgressTheme(backgroundColor: presentation.activityBackground, foregroundColor: presentation.activityForeground, icon: presentation.pauseThumb, iconInset:NSEdgeInsets(left:0), blendMode: presentation.blendingMode)
progressView.state = .Icon(image: presentation.pauseThumb)
if fetchStatus == nil || fetchStatus == .Local {
let presentation: ChatMediaPresentation = parameters?.presentation ?? .Empty
if let parent = parent, let controller = context?.sharedContext.getAudioPlayer(), let song = controller.currentSong {
if song.entry.isEqual(to: parent), case .playing = song.state {
progressView.theme = RadialProgressTheme(backgroundColor: presentation.activityBackground, foregroundColor: presentation.activityForeground, icon: presentation.pauseThumb, iconInset:NSEdgeInsets(left:0), blendMode: presentation.blendingMode)
progressView.state = .Icon(image: presentation.pauseThumb)
} else {
progressView.theme = RadialProgressTheme(backgroundColor: presentation.activityBackground, foregroundColor: presentation.activityForeground, icon: presentation.playThumb, iconInset:NSEdgeInsets(left:1), blendMode: presentation.blendingMode)
progressView.state = .Icon(image: presentation.playThumb)
}
} else {
progressView.theme = RadialProgressTheme(backgroundColor: presentation.activityBackground, foregroundColor: presentation.activityForeground, icon: presentation.playThumb, iconInset:NSEdgeInsets(left:1), blendMode: presentation.blendingMode)
progressView.state = .Icon(image: presentation.playThumb)
}
} else {
progressView.theme = RadialProgressTheme(backgroundColor: presentation.activityBackground, foregroundColor: presentation.activityForeground, icon: presentation.playThumb, iconInset:NSEdgeInsets(left:1), blendMode: presentation.blendingMode)
progressView.state = .Icon(image: presentation.playThumb)
}

}

override func update(with media: Media, size:NSSize, context: AccountContext, parent:Message?, table:TableView?, parameters:ChatMediaLayoutParameters? = nil, animated: Bool = false, positionFlags: LayoutPositionFlags? = nil, approximateSynchronousValue: Bool = false) {
Expand Down
Loading

0 comments on commit ef0f84e

Please sign in to comment.