Skip to content

Commit 9a2215d

Browse files
author
Isaac
committed
Conference
1 parent c7269fa commit 9a2215d

File tree

11 files changed

+23
-22
lines changed

11 files changed

+23
-22
lines changed

Telegram/Telegram-iOS/en.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14187,3 +14187,4 @@ Sorry for the inconvenience.";
1418714187
"SendInviteLink.TextCallsRestrictedOneUser" = "%@ does not accept calls.";
1418814188
"SendInviteLink.TextCallsRestrictedMultipleUsers_1" = "{user_list}, and **%d** more person do not accept calls.";
1418914189
"SendInviteLink.TextCallsRestrictedMultipleUsers_any" = "{user_list}, and **%d** more people do not accept calls.";
14190+
"SendInviteLink.TextCallsRestrictedSendInviteLink" = "You can try to send an invite link instead.";

submodules/TelegramCallsUI/Sources/PresentationGroupCall.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ private final class ConferenceCallE2EContextStateImpl: ConferenceCallE2EContextS
356356
return self.call.takeOutgoingBroadcastBlocks()
357357
}
358358

359-
func encrypt(message: Data, channelId: Int32) -> Data? {
360-
return self.call.encrypt(message, channelId: channelId)
359+
func encrypt(message: Data, channelId: Int32, plaintextPrefixLength: Int) -> Data? {
360+
return self.call.encrypt(message, channelId: channelId, plaintextPrefixLength: plaintextPrefixLength)
361361
}
362362

363363
func decrypt(message: Data, userId: Int64) -> Data? {
@@ -374,9 +374,9 @@ class OngoingGroupCallEncryptionContextImpl: OngoingGroupCallEncryptionContext {
374374
self.channelId = channelId
375375
}
376376

377-
func encrypt(message: Data) -> Data? {
377+
func encrypt(message: Data, plaintextPrefixLength: Int) -> Data? {
378378
let channelId = self.channelId
379-
return self.e2eCall.with({ $0.state?.encrypt(message: message, channelId: channelId) })
379+
return self.e2eCall.with({ $0.state?.encrypt(message: message, channelId: channelId, plaintextPrefixLength: plaintextPrefixLength) })
380380
}
381381

382382
func decrypt(message: Data, userId: Int64) -> Data? {

submodules/TelegramCore/Sources/State/ConferenceCallE2EContext.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public protocol ConferenceCallE2EContextState: AnyObject {
1313

1414
func takeOutgoingBroadcastBlocks() -> [Data]
1515

16-
func encrypt(message: Data, channelId: Int32) -> Data?
16+
func encrypt(message: Data, channelId: Int32, plaintextPrefixLength: Int) -> Data?
1717
func decrypt(message: Data, userId: Int64) -> Data?
1818
}
1919

submodules/TelegramUI/Components/SendInviteLinkScreen/Sources/SendInviteLinkScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ private final class SendInviteLinkScreenComponent: Component {
791791
}
792792
}
793793
case .groupCall:
794-
text = " "
794+
text = environment.strings.SendInviteLink_TextCallsRestrictedSendInviteLink
795795
}
796796

797797
let body = MarkdownAttributeSet(font: Font.regular(15.0), textColor: environment.theme.list.itemPrimaryTextColor)

submodules/TelegramVoip/Sources/GroupCallContext.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ final class OngoingGroupCallBroadcastPartTaskImpl: NSObject, OngoingGroupCallBro
217217
}
218218

219219
public protocol OngoingGroupCallEncryptionContext: AnyObject {
220-
func encrypt(message: Data) -> Data?
220+
func encrypt(message: Data, plaintextPrefixLength: Int) -> Data?
221221
func decrypt(message: Data, userId: Int64) -> Data?
222222
}
223223

@@ -645,9 +645,9 @@ public final class OngoingGroupCallContext {
645645
isConference: isConference,
646646
isActiveByDefault: audioIsActiveByDefault,
647647
encryptDecrypt: encryptionContext.flatMap { encryptionContext in
648-
return { data, userId, isEncrypt in
648+
return { data, userId, isEncrypt, plaintextPrefixLength in
649649
if isEncrypt {
650-
return encryptionContext.encrypt(message: data)
650+
return encryptionContext.encrypt(message: data, plaintextPrefixLength: Int(plaintextPrefixLength))
651651
} else {
652652
return encryptionContext.decrypt(message: data, userId: userId)
653653
}
@@ -755,9 +755,9 @@ public final class OngoingGroupCallContext {
755755
isConference: isConference,
756756
isActiveByDefault: audioIsActiveByDefault,
757757
encryptDecrypt: encryptionContext.flatMap { encryptionContext in
758-
return { data, userId, isEncrypt in
758+
return { data, userId, isEncrypt, plaintextPrefixLength in
759759
if isEncrypt {
760-
return encryptionContext.encrypt(message: data)
760+
return encryptionContext.encrypt(message: data, plaintextPrefixLength: Int(plaintextPrefixLength))
761761
} else {
762762
return encryptionContext.decrypt(message: data, userId: userId)
763763
}

submodules/TgVoipWebrtc/PublicHeaders/TgVoipWebrtc/OngoingCallThreadLocalContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ onMutedSpeechActivityDetected:(void (^ _Nullable)(bool))onMutedSpeechActivityDet
457457
audioDevice:(SharedCallAudioDevice * _Nullable)audioDevice
458458
isConference:(bool)isConference
459459
isActiveByDefault:(bool)isActiveByDefault
460-
encryptDecrypt:(NSData * _Nullable (^ _Nullable)(NSData * _Nonnull, int64_t, bool))encryptDecrypt;
460+
encryptDecrypt:(NSData * _Nullable (^ _Nullable)(NSData * _Nonnull, int64_t, bool, int32_t))encryptDecrypt;
461461

462462
- (void)stop:(void (^ _Nullable)())completion;
463463

submodules/TgVoipWebrtc/Sources/OngoingCallThreadLocalContext.mm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,7 @@ - (instancetype _Nonnull)initWithQueue:(id<OngoingCallThreadLocalContextQueueWeb
23892389
audioDevice:(SharedCallAudioDevice * _Nullable)audioDevice
23902390
isConference:(bool)isConference
23912391
isActiveByDefault:(bool)isActiveByDefault
2392-
encryptDecrypt:(NSData * _Nullable (^ _Nullable)(NSData * _Nonnull, int64_t, bool))encryptDecrypt {
2392+
encryptDecrypt:(NSData * _Nullable (^ _Nullable)(NSData * _Nonnull, int64_t, bool, int32_t))encryptDecrypt {
23932393
self = [super init];
23942394
if (self != nil) {
23952395
_queue = queue;
@@ -2458,12 +2458,12 @@ - (instancetype _Nonnull)initWithQueue:(id<OngoingCallThreadLocalContextQueueWeb
24582458

24592459
std::string statsLogPathValue(statsLogPath.length == 0 ? "" : statsLogPath.UTF8String);
24602460

2461-
std::function<std::vector<uint8_t>(std::vector<uint8_t> const &, int64_t, bool)> mappedEncryptDecrypt;
2461+
std::function<std::vector<uint8_t>(std::vector<uint8_t> const &, int64_t, bool, int32_t)> mappedEncryptDecrypt;
24622462
if (encryptDecrypt) {
2463-
NSData * _Nullable (^encryptDecryptBlock)(NSData * _Nonnull, int64_t, bool) = [encryptDecrypt copy];
2464-
mappedEncryptDecrypt = [encryptDecryptBlock](std::vector<uint8_t> const &message, int64_t userId, bool isEncrypt) -> std::vector<uint8_t> {
2463+
NSData * _Nullable (^encryptDecryptBlock)(NSData * _Nonnull, int64_t, bool, int32_t) = [encryptDecrypt copy];
2464+
mappedEncryptDecrypt = [encryptDecryptBlock](std::vector<uint8_t> const &message, int64_t userId, bool isEncrypt, int32_t plaintextPrefixLength) -> std::vector<uint8_t> {
24652465
NSData *mappedMessage = [[NSData alloc] initWithBytes:message.data() length:message.size()];
2466-
NSData *result = encryptDecryptBlock(mappedMessage, userId, isEncrypt);
2466+
NSData *result = encryptDecryptBlock(mappedMessage, userId, isEncrypt, plaintextPrefixLength);
24672467
if (!result) {
24682468
return std::vector<uint8_t>();
24692469
}

third-party/td/TdBinding/Public/TdBinding/TdBinding.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
4242

4343
- (nullable NSData *)generateRemoveParticipantsBlock:(NSArray<NSNumber *> *)participantIds;
4444

45-
- (nullable NSData *)encrypt:(NSData *)message channelId:(int32_t)channelId;
45+
- (nullable NSData *)encrypt:(NSData *)message channelId:(int32_t)channelId plaintextPrefixLength:(NSInteger)plaintextPrefixLength;
4646
- (nullable NSData *)decrypt:(NSData *)message userId:(int64_t)userId;
4747

4848
@end

third-party/td/TdBinding/Sources/TdBinding.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ - (nullable NSData *)generateRemoveParticipantsBlock:(NSArray<NSNumber *> *)part
287287
return [[NSData alloc] initWithBytes:result.value().data() length:result.value().size()];
288288
}
289289

290-
- (nullable NSData *)encrypt:(NSData *)message channelId:(int32_t)channelId {
290+
- (nullable NSData *)encrypt:(NSData *)message channelId:(int32_t)channelId plaintextPrefixLength:(NSInteger)plaintextPrefixLength {
291291
std::string mappedMessage((uint8_t *)message.bytes, ((uint8_t *)message.bytes) + message.length);
292-
auto result = tde2e_api::call_encrypt(_callId, channelId, mappedMessage);
292+
auto result = tde2e_api::call_encrypt(_callId, channelId, mappedMessage, (size_t)plaintextPrefixLength);
293293
if (!result.is_ok()) {
294294
return nil;
295295
}

0 commit comments

Comments
 (0)