From 43b1a356025ccce786563e7d6427af571a868a6b Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 8 Nov 2024 16:30:07 +0000 Subject: [PATCH] Show Matrix RTC calls as unsupported. --- Podfile.lock | 12 ++++---- Riot/Assets/en.lproj/Localizable.strings | 2 ++ Riot/Assets/en.lproj/Vector.strings | 1 + Riot/Generated/Strings.swift | 4 +++ .../Modules/MatrixKit/Models/MXKAppSettings.m | 2 ++ .../Room/CellData/RoomBubbleCellData.h | 1 + .../Room/CellData/RoomBubbleCellData.m | 19 ++++++++++++ Riot/Modules/Room/RoomViewController.m | 4 +++ .../Call/CallCellContentView.xib | 8 ++--- .../MatrixRTC/RoomMatrixRTCCallCell.swift | 29 +++++++++++++++++++ .../RoomTimelineCellIdentifier.h | 1 + .../Plain/PlainRoomTimelineCellProvider.m | 2 ++ RiotNSE/NotificationService.swift | 9 ++++++ matrix-ios-sdk | 2 +- 14 files changed, 85 insertions(+), 11 deletions(-) create mode 100644 Riot/Modules/Room/TimelineCells/Call/MatrixRTC/RoomMatrixRTCCallCell.swift diff --git a/Podfile.lock b/Podfile.lock index 672f3250b5..63e9f57b55 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -39,16 +39,16 @@ PODS: - LoggerAPI (1.9.200): - Logging (~> 1.1) - Logging (1.4.0) - - MatrixSDK (0.27.13): - - MatrixSDK/Core (= 0.27.13) - - MatrixSDK/Core (0.27.13): + - MatrixSDK (0.27.15): + - MatrixSDK/Core (= 0.27.15) + - MatrixSDK/Core (0.27.15): - AFNetworking (~> 4.0.0) - GZIP (~> 1.3.0) - libbase58 (~> 0.1.4) - MatrixSDKCrypto (= 0.4.3) - Realm (= 10.27.0) - SwiftyBeaver (= 1.9.5) - - MatrixSDK/JingleCallStack (0.27.13): + - MatrixSDK/JingleCallStack (0.27.15): - JitsiMeetSDKLite (= 8.1.2-lite) - MatrixSDK/Core - MatrixSDKCrypto (0.4.3) @@ -179,7 +179,7 @@ SPEC CHECKSUMS: libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75 LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d Logging: beeb016c9c80cf77042d62e83495816847ef108b - MatrixSDK: b5756a518af19296b94e3ad9b6f16648f9eb17c3 + MatrixSDK: 12b379749b84ab5b3662042acb1914b9f9bb692b MatrixSDKCrypto: 27bee960e0e8b3a3039f3f3e93dd2ec88299c77e ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d Realm: 9ca328bd7e700cc19703799785e37f77d1a130f2 @@ -200,4 +200,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 484a1cdf04951cc82156f29de196efd76d3ad893 -COCOAPODS: 1.15.2 +COCOAPODS: 1.14.3 diff --git a/Riot/Assets/en.lproj/Localizable.strings b/Riot/Assets/en.lproj/Localizable.strings index 965fcfd4a4..53a8b63bf5 100644 --- a/Riot/Assets/en.lproj/Localizable.strings +++ b/Riot/Assets/en.lproj/Localizable.strings @@ -182,6 +182,8 @@ /* Group call from user, CallKit caller name */ "GROUP_CALL_FROM_USER" = "%@ (Group call)"; +"UNSUPPORTED_CALL" = "Unsupported call"; + /** Key verification **/ "KEY_VERIFICATION_REQUEST_FROM_USER" = "%@ wants to verify"; diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 00fc9a6d1f..d0030805df 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -1253,6 +1253,7 @@ Tap the + to start adding people."; "call_no_stun_server_error_use_fallback_button" = "Try using %@"; "call_actions_unhold" = "Resume"; +"call_unsupported_matrix_rtc_call" = "Unsupported call. The new Element X app is needed to join this call."; // No VoIP support "no_voip_title" = "Incoming call"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 7826653b20..5b168bcee2 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -1187,6 +1187,10 @@ public class VectorL10n: NSObject { public static var callTransferUsers: String { return VectorL10n.tr("Vector", "call_transfer_users") } + /// Unsupported call. The new Element X app is needed to join this call. + public static var callUnsupportedMatrixRtcCall: String { + return VectorL10n.tr("Vector", "call_unsupported_matrix_rtc_call") + } /// Video call with %@ public static func callVideoWithUser(_ p1: String) -> String { return VectorL10n.tr("Vector", "call_video_with_user", p1) diff --git a/Riot/Modules/MatrixKit/Models/MXKAppSettings.m b/Riot/Modules/MatrixKit/Models/MXKAppSettings.m index aae9ddc4f4..870d9f36e5 100644 --- a/Riot/Modules/MatrixKit/Models/MXKAppSettings.m +++ b/Riot/Modules/MatrixKit/Models/MXKAppSettings.m @@ -169,6 +169,8 @@ -(instancetype)init kMXEventTypeStringCallHangup, kMXEventTypeStringCallReject, kMXEventTypeStringCallNegotiate, + kMXEventTypeStringCallNotify, + kMXEventTypeStringCallNotifyUnstable, kMXEventTypeStringSticker, kMXEventTypeStringKeyVerificationCancel, kMXEventTypeStringKeyVerificationDone, diff --git a/Riot/Modules/Room/CellData/RoomBubbleCellData.h b/Riot/Modules/Room/CellData/RoomBubbleCellData.h index e3e3316109..b7e97a4d67 100644 --- a/Riot/Modules/Room/CellData/RoomBubbleCellData.h +++ b/Riot/Modules/Room/CellData/RoomBubbleCellData.h @@ -25,6 +25,7 @@ typedef NS_ENUM(NSInteger, RoomBubbleCellDataTag) RoomBubbleCellDataTagKeyVerificationConclusion, RoomBubbleCellDataTagCall, RoomBubbleCellDataTagGroupCall, + RoomBubbleCellDataTagRTCCallNotify, RoomBubbleCellDataTagRoomCreationIntro, RoomBubbleCellDataTagPoll, RoomBubbleCellDataTagLocation, diff --git a/Riot/Modules/Room/CellData/RoomBubbleCellData.m b/Riot/Modules/Room/CellData/RoomBubbleCellData.m index 1277d97d35..6e7001ad2a 100644 --- a/Riot/Modules/Room/CellData/RoomBubbleCellData.m +++ b/Riot/Modules/Room/CellData/RoomBubbleCellData.m @@ -142,6 +142,14 @@ - (instancetype)initWithEvent:(MXEvent *)event andRoomState:(MXRoomState *)roomS self.displayTimestampForSelectedComponentOnLeftWhenPossible = NO; break; } + case MXEventTypeCallNotify: + { + self.tag = RoomBubbleCellDataTagRTCCallNotify; + self.collapsable = NO; + self.collapsed = NO; + self.displayTimestampForSelectedComponentOnLeftWhenPossible = NO; + break; + } case MXEventTypePollStart: case MXEventTypePollEnd: { @@ -374,6 +382,11 @@ - (BOOL)hasNoDisplay break; case RoomBubbleCellDataTagVoiceBroadcastNoDisplay: break; + case RoomBubbleCellDataTagRTCCallNotify: + { + hasNoDisplay = NO; + break; + } default: hasNoDisplay = [super hasNoDisplay]; break; @@ -1119,6 +1132,9 @@ - (BOOL)addEvent:(MXEvent*)event andRoomState:(MXRoomState*)roomState case RoomBubbleCellDataTagGroupCall: shouldAddEvent = NO; break; + case RoomBubbleCellDataTagRTCCallNotify: + shouldAddEvent = NO; + break; case RoomBubbleCellDataTagRoomCreateConfiguration: shouldAddEvent = NO; break; @@ -1193,6 +1209,9 @@ - (BOOL)addEvent:(MXEvent*)event andRoomState:(MXRoomState*)roomState case MXEventTypeCallReject: shouldAddEvent = NO; break; + case MXEventTypeCallNotify: + shouldAddEvent = NO; + break; case MXEventTypePollStart: case MXEventTypePollEnd: shouldAddEvent = NO; diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index f0aa55491d..656a413993 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -3220,6 +3220,10 @@ - (RoomTimelineCellIdentifier)cellIdentifierForCellData:(MXKCellData*)cellData a { cellIdentifier = RoomTimelineCellIdentifierGroupCallStatus; } + else if (bubbleData.tag == RoomBubbleCellDataTagRTCCallNotify) + { + cellIdentifier = RoomTimelineCellIdentifierMatrixRTCCall; + } else if (bubbleData.attachment.type == MXKAttachmentTypeVoiceMessage || bubbleData.attachment.type == MXKAttachmentTypeAudio) { if (bubbleData.isIncoming) diff --git a/Riot/Modules/Room/TimelineCells/Call/CallCellContentView.xib b/Riot/Modules/Room/TimelineCells/Call/CallCellContentView.xib index 4f838a8ef7..99aad18246 100644 --- a/Riot/Modules/Room/TimelineCells/Call/CallCellContentView.xib +++ b/Riot/Modules/Room/TimelineCells/Call/CallCellContentView.xib @@ -1,15 +1,15 @@ - + - + - + @@ -87,7 +87,7 @@ -