Skip to content

Commit 50658f8

Browse files
committed
Release 2.2.3 (546)
1 parent e680e08 commit 50658f8

File tree

421 files changed

+26470
-11006
lines changed

Some content is hidden

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

421 files changed

+26470
-11006
lines changed

.claude/settings.local.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(swift build)",
5+
"Bash(.build/debug/makeproject:*)",
6+
"Bash(mkdir:*)",
7+
"Bash(find:*)",
8+
"Bash(grep:*)"
9+
],
10+
"deny": []
11+
}
12+
}

MODULE.bazel

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ local_path_override(
6565
# Nicegram, rules_swift_package_manager
6666
bazel_dep(
6767
name = "rules_swift_package_manager",
68-
version = "0.39.0",
68+
version = "1.4.0",
69+
)
70+
git_override(
71+
module_name = "rules_swift_package_manager",
72+
remote = "https://github.com/denis15yo/rules_swift_package_manager",
73+
commit = "32ead4e042afc5e7dded0e1a357b4ff077a09a5f",
6974
)
7075

7176
swift_deps = use_extension(

MODULE.bazel.lock

Lines changed: 432 additions & 192 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Nicegram/NGCallRecorder/Sources/CallRecorder+sendAudioToSavedMessages.swift

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ extension CallRecorder {
1010
deleteFile(path: audio.path)
1111
}
1212

13+
if call == nil {
14+
log("sendAudioToSavedMessages call=nil")
15+
}
16+
1317
let context = try call.unwrap().accountContext
1418

1519
let text = try await makeText(
@@ -32,11 +36,15 @@ extension CallRecorder {
3236
)
3337

3438
let account = context.account
35-
_ = try await enqueueMessages(
36-
account: account,
37-
peerId: account.peerId,
38-
messages: [message]
39-
).awaitForFirstValue()
39+
do {
40+
_ = try await enqueueMessages(
41+
account: account,
42+
peerId: account.peerId,
43+
messages: [message]
44+
).awaitForFirstValue()
45+
} catch {
46+
log("enqueueMessages error: \(error)")
47+
}
4048
}
4149
}
4250

Nicegram/NGCallRecorder/Sources/CallRecorder.swift

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import CasePaths
22
import Combine
33
import Foundation
4+
import NGCore
45
import NGData
56

67
@preconcurrency @MainActor
@@ -27,6 +28,8 @@ public class CallRecorder: ObservableObject {
2728
var partNumber = 1
2829
var partsTimer: AnyCancellable?
2930

31+
let log = Log(category: "call-recorder")
32+
3033
// MARK: - Lifecycle
3134

3235
public init() {}
@@ -102,8 +105,15 @@ extension CallRecorder {
102105

103106
private extension CallRecorder {
104107
func startRecordAudioDevice() {
105-
call?.audioDevice?.startNicegramRecording(
108+
guard let audioDevice = call?.audioDevice else {
109+
log("audio device not found (start)")
110+
return
111+
}
112+
113+
log("start recording audio device")
114+
audioDevice.startNicegramRecording(
106115
callback: { [self] path, duration, size in
116+
log("audio device success")
107117
processRecordedAudio(
108118
RecordedAudio(
109119
path: path,
@@ -112,14 +122,21 @@ private extension CallRecorder {
112122
)
113123
)
114124
},
115-
errorCallback: { _ in
125+
errorCallback: { [self] _ in
126+
log("audio device error")
116127
trackCallRecorderEvent(.error)
117128
}
118129
)
119130
}
120131

121132
func stopRecordAudioDevice() {
122-
call?.audioDevice?.stopNicegramRecording()
133+
guard let audioDevice = call?.audioDevice else {
134+
log("audio device not found (stop)")
135+
return
136+
}
137+
138+
log("stop recording audio device")
139+
audioDevice.stopNicegramRecording()
123140
}
124141

125142
func processRecordedAudio(_ audio: RecordedAudio) {
@@ -132,6 +149,7 @@ private extension CallRecorder {
132149
partNumber: partNumber
133150
)
134151
showRecordSavedToast()
152+
log("record saved")
135153
}
136154
}
137155

Nicegram/NGDataSharing/Sources/GetAndParseChannels/Wrappers/ApiChatFullWrapped.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public enum ApiChatFullWrapped {
5454
public let botVerification: Api.BotVerification?
5555
public let stargiftsCount: Int32?
5656
public let sendPaidMessagesStars: Int64?
57+
public let mainTab: Api.ProfileTab?
5758
}
5859

5960
public struct ChatFull {
@@ -79,7 +80,7 @@ public enum ApiChatFullWrapped {
7980

8081
public init(_ apiChatFull: Api.ChatFull) {
8182
switch apiChatFull {
82-
case let .channelFull(flags, flags2, id, about, participantsCount, adminsCount, kickedCount, bannedCount, onlineCount, readInboxMaxId, readOutboxMaxId, unreadCount, chatPhoto, notifySettings, exportedInvite, botInfo, migratedFromChatId, migratedFromMaxId, pinnedMsgId, stickerset, availableMinId, folderId, linkedChatId, location, slowmodeSeconds, slowmodeNextSendDate, statsDc, pts, call, ttlPeriod, pendingSuggestions, groupcallDefaultJoinAs, themeEmoticon, requestsPending, recentRequesters, defaultSendAs, availableReactions, reactionsLimit, stories, wallpaper, boostsApplied, boostsUnrestrict, emojiset, botVerification, stargiftsCount, sendPaidMessagesStars):
83+
case let .channelFull(flags, flags2, id, about, participantsCount, adminsCount, kickedCount, bannedCount, onlineCount, readInboxMaxId, readOutboxMaxId, unreadCount, chatPhoto, notifySettings, exportedInvite, botInfo, migratedFromChatId, migratedFromMaxId, pinnedMsgId, stickerset, availableMinId, folderId, linkedChatId, location, slowmodeSeconds, slowmodeNextSendDate, statsDc, pts, call, ttlPeriod, pendingSuggestions, groupcallDefaultJoinAs, themeEmoticon, requestsPending, recentRequesters, defaultSendAs, availableReactions, reactionsLimit, stories, wallpaper, boostsApplied, boostsUnrestrict, emojiset, botVerification, stargiftsCount, sendPaidMessagesStars, mainTab):
8384
self = .channelFull(ChannelFull(
8485
flags: flags,
8586
flags2: flags2,
@@ -126,7 +127,8 @@ public enum ApiChatFullWrapped {
126127
emojiset: emojiset,
127128
botVerification: botVerification,
128129
stargiftsCount: stargiftsCount,
129-
sendPaidMessagesStars: sendPaidMessagesStars
130+
sendPaidMessagesStars: sendPaidMessagesStars,
131+
mainTab: mainTab
130132
))
131133
case let .chatFull(flags, id, about, participants, chatPhoto, notifySettings, exportedInvite, botInfo, pinnedMsgId, folderId, call, ttlPeriod, groupcallDefaultJoinAs, themeEmoticon, requestsPending, recentRequesters, availableReactions, reactionsLimit):
132134
self = .chatFull(ChatFull(

Nicegram/NGSpeechToText/Sources/TelegramHelpers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private func updateAudioTranscriptionMessageAttribute(message: Message, text: St
6161

6262
attributes.append(updatedAttribute)
6363

64-
return .update(StoreMessage(id: currentMessage.id, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: currentMessage.tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: currentMessage.media))
64+
return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: currentMessage.tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: currentMessage.media))
6565
})
6666
}).start()
6767
}

Package.resolved

Lines changed: 38 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageDescription
55
let package = Package(
66
name: "nicegram-package",
77
dependencies: [
8-
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "11.0.0"),
8+
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "12.0.0"),
99
.package(url: "[email protected]:mobyrix/nicegram-assistant-ios.git", branch: "develop"),
1010
.package(url: "[email protected]:mobyrix/nicegram-wallet-ios.git", branch: "develop"),
1111
]

0 commit comments

Comments
 (0)