From 7db033723a29baf70f0300b7e21a4b82725543ad Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Mon, 16 Oct 2017 18:55:09 +0200 Subject: [PATCH 01/26] Bug Fix - Share extension: Rooms have no avatars Add a fake matrix session to each room summary to provide it a REST client (used to handle correctly the room avatar). #1570 --- RiotShareExtension/Model/ShareDataSource.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/RiotShareExtension/Model/ShareDataSource.m b/RiotShareExtension/Model/ShareDataSource.m index 1a64991fd..157a85388 100644 --- a/RiotShareExtension/Model/ShareDataSource.m +++ b/RiotShareExtension/Model/ShareDataSource.m @@ -57,12 +57,17 @@ NSMutableArray *cellData = [NSMutableArray array]; + // Add a fake matrix session to each room summary to provide it a REST client (used to handle correctly the room avatar). + MXSession *session = [[MXSession alloc] initWithMatrixRestClient:[[MXRestClient alloc] initWithCredentials:[ShareExtensionManager sharedManager].userAccount.mxCredentials andOnUnrecognizedCertificateBlock:nil]]; + for (MXRoomSummary *roomSummary in roomsSummaries) { - MXKRecentCellData *recentCellData = [[MXKRecentCellData alloc] initWithRoomSummary:roomSummary andRecentListDataSource:nil]; - if ((self.dataSourceMode == DataSourceModeRooms) ^ roomSummary.isDirect) { + [roomSummary setMatrixSession:session]; + + MXKRecentCellData *recentCellData = [[MXKRecentCellData alloc] initWithRoomSummary:roomSummary andRecentListDataSource:nil]; + [cellData addObject:recentCellData]; } } From 23696d16182d8cee5cff1d82040a41523937e9c0 Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 12 Oct 2017 15:53:02 +0200 Subject: [PATCH 02/26] Podfile: Factorise the podfile --- Podfile | 159 +++++++++++++++------------------ Riot.xcodeproj/project.pbxproj | 68 ++++++++------ 2 files changed, 113 insertions(+), 114 deletions(-) diff --git a/Podfile b/Podfile index c818caf91..4ecc59529 100644 --- a/Podfile +++ b/Podfile @@ -3,104 +3,85 @@ platform :ios, "8.0" source 'https://github.com/CocoaPods/Specs.git' -target "Riot" do +abstract_target 'RiotPods' do -# Different flavours of pods to MatrixKit -# The tagged version on which this version of Riot has been built -pod 'MatrixKit', '0.6.3' + pod 'GBDeviceInfo', '~> 4.4.0' -# The lastest release available on the CocoaPods repository -#pod 'MatrixKit' + pod 'GoogleAnalytics' -# The develop branch version -#pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' -#pod 'MatrixKit', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' + # The Google WebRTC stack + pod 'WebRTC', '58.17.16937' -# The one used for developing both MatrixSDK and MatrixKit -# Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder -#pod 'MatrixKit', :path => '../matrix-ios-kit/MatrixKit.podspec' -#pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' + # OLMKit for crypto + pod 'OLMKit' + #pod 'OLMKit', :path => '../olm/OLMKit.podspec' + pod 'Realm', '~> 2.10.2' -pod 'GBDeviceInfo', '~> 4.4.0' + # Remove warnings from "bad" pods + pod 'OLMKit', :inhibit_warnings => true + pod 'cmark', :inhibit_warnings => true + pod 'DTCoreText', :inhibit_warnings => true -pod 'GoogleAnalytics' -# The Google WebRTC stack -pod 'WebRTC', '58.17.16937' + target "Riot" do -# OLMKit for crypto -pod 'OLMKit' -#pod 'OLMKit', :path => '../olm/OLMKit.podspec' -pod 'Realm', '~> 2.10.2' + # Different flavours of pods to MatrixKit + # The tagged version on which this version of Riot has been built + pod 'MatrixKit', '0.6.3' -# Remove warnings from "bad" pods -pod 'OLMKit', :inhibit_warnings => true -pod 'cmark', :inhibit_warnings => true -pod 'DTCoreText', :inhibit_warnings => true + # The lastest release available on the CocoaPods repository + #pod 'MatrixKit' + + # The develop branch version + #pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' + #pod 'MatrixKit', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' + + # The one used for developing both MatrixSDK and MatrixKit + # Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder + #pod 'MatrixKit', :path => '../matrix-ios-kit/MatrixKit.podspec' + #pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' + + end + + + target "RiotShareExtension" do + + # The tagged version on which this version of Riot share extension has been built + pod 'MatrixKit/AppExtension', '0.6.3' + + # The lastest release available on the CocoaPods repository + #pod 'MatrixKit/AppExtension' + + # The develop branch version + #pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' + #pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' + + # The one used for developing both MatrixSDK and MatrixKit + # Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder + #pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' + #pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' + + end + + + target "SiriIntents" do + + # The tagged version on which this version of Riot share extension has been built + #pod 'MatrixKit/AppExtension', '0.6.3' + + # The lastest release available on the CocoaPods repository + #pod 'MatrixKit/AppExtension' + + # The develop branch version + #pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' + #pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' + + # The one used for developing both MatrixSDK and MatrixKit + # Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder + #pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' + #pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' + + end end - -target "RiotShareExtension" do - -pod 'GoogleAnalytics' -# The Google WebRTC stack -pod 'WebRTC', '58.17.16937' -# OLMKit for crypto -pod 'OLMKit' -#pod 'OLMKit', :path => '../olm/OLMKit.podspec' -pod 'Realm', '~> 2.10.2' - -# The tagged version on which this version of Riot share extension has been built -pod 'MatrixKit/AppExtension', '0.6.3' - -# The lastest release available on the CocoaPods repository -#pod 'MatrixKit/AppExtension' - -# The develop branch version -#pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' -#pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' - -# The one used for developing both MatrixSDK and MatrixKit -# Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder -#pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' -#pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' - -# Remove warnings from "bad" pods -pod 'OLMKit', :inhibit_warnings => true -pod 'cmark', :inhibit_warnings => true - -end - - -target "SiriIntents" do - -pod 'GoogleAnalytics' -# The Google WebRTC stack -pod 'WebRTC', '58.17.16937' -# OLMKit for crypto -pod 'OLMKit' -#pod 'OLMKit', :path => '../olm/OLMKit.podspec' -pod 'Realm', '~> 2.10.2' - -# The tagged version on which this version of Riot share extension has been built -pod 'MatrixKit/AppExtension', '0.6.3' - -# The lastest release available on the CocoaPods repository -#pod 'MatrixKit/AppExtension' - -# The develop branch version -#pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' -#pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' - -# The one used for developing both MatrixSDK and MatrixKit -# Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder -#pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' -#pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' - -# Remove warnings from "bad" pods -pod 'OLMKit', :inhibit_warnings => true -pod 'cmark', :inhibit_warnings => true - -end - diff --git a/Riot.xcodeproj/project.pbxproj b/Riot.xcodeproj/project.pbxproj index 49981a658..ca5b9a63d 100755 --- a/Riot.xcodeproj/project.pbxproj +++ b/Riot.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 05D592A32FF1D1877B89F73C /* libPods-Riot.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD9D0BDE9232898950554DD5 /* libPods-Riot.a */; }; 2435179C1F375B9400D0683E /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2466B7551F2F80B800AE27B0 /* Info.plist */; }; 2435179F1F375C0F00D0683E /* Vector.strings in Resources */ = {isa = PBXBuildFile; fileRef = 327382C01F276AED00356143 /* Vector.strings */; }; 2439DD621F6BBE760090F42D /* RecentRoomTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2439DD611F6BBE760090F42D /* RecentRoomTableViewCell.m */; }; @@ -36,6 +35,8 @@ 24EEE5AF1F25F0F500B3C705 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F083BBEF1E7009EC00A9B29C /* Images.xcassets */; }; 24EEE5B41F2607C000B3C705 /* SegmentedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F083BC4E1E7009EC00A9B29C /* SegmentedViewController.m */; }; 24EEE5B51F2607C500B3C705 /* SegmentedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F083BC4F1E7009EC00A9B29C /* SegmentedViewController.xib */; }; + 268F9A229B0162F9C8AEBE34 /* libPods-RiotPods-Riot.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 714B084D44A5553C13D855BA /* libPods-RiotPods-Riot.a */; }; + 319F86690284AA02FC397A15 /* libPods-RiotPods-SiriIntents.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C1A4A3DCE26410A60959E96 /* libPods-RiotPods-SiriIntents.a */; }; 3205ED7D1E976C8A003D65FA /* DirectoryServerPickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3205ED7C1E976C8A003D65FA /* DirectoryServerPickerViewController.m */; }; 3205ED841E97725E003D65FA /* DirectoryServerTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3205ED821E97725E003D65FA /* DirectoryServerTableViewCell.m */; }; 3205ED851E97725E003D65FA /* DirectoryServerTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3205ED831E97725E003D65FA /* DirectoryServerTableViewCell.xib */; }; @@ -84,7 +85,7 @@ 32F3AE1A1F6FF4E600F0F004 /* WidgetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 32F3AE191F6FF4E600F0F004 /* WidgetViewController.m */; }; 32FD0A3D1EB0CD9B0072B066 /* BugReportViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 32FD0A3B1EB0CD9B0072B066 /* BugReportViewController.m */; }; 32FD0A3E1EB0CD9B0072B066 /* BugReportViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 32FD0A3C1EB0CD9B0072B066 /* BugReportViewController.xib */; }; - 714F6391AC0AA86C0AEB3F43 /* libPods-SiriIntents.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5666C1236223F54D4C635C54 /* libPods-SiriIntents.a */; }; + 40D7564A9783FD6C28C157CE /* libPods-RiotPods-RiotShareExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AF0A0746EF74FF15B8B79658 /* libPods-RiotPods-RiotShareExtension.a */; }; 83711A7C1F6F8E7D008F0D4D /* KeyboardGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83711A7B1F6F8E7D008F0D4D /* KeyboardGrowingTextView.m */; }; 92324BE31F4F66D3009DE194 /* IncomingCallView.m in Sources */ = {isa = PBXBuildFile; fileRef = 92324BE21F4F66D3009DE194 /* IncomingCallView.m */; }; 92324BE61F4F6A60009DE194 /* CircleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 92324BE51F4F6A60009DE194 /* CircleButton.m */; }; @@ -92,7 +93,6 @@ 92726A471F58737A004AD26F /* IntentHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 92726A461F58737A004AD26F /* IntentHandler.m */; }; 92726A4B1F58737A004AD26F /* SiriIntents.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 92726A431F58737A004AD26F /* SiriIntents.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 92726A511F587410004AD26F /* Intents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92726A501F587410004AD26F /* Intents.framework */; }; - A27ECCE3FC4971745D2CB78D /* libPods-RiotShareExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7246451C668D6782166E22EC /* libPods-RiotShareExtension.a */; }; F0131DE51F2200D600CBF707 /* RiotSplitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F0131DE41F2200D600CBF707 /* RiotSplitViewController.m */; }; F02C1A861E8EB04C0045A404 /* PeopleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F02C1A841E8EB04C0045A404 /* PeopleViewController.m */; }; F04AF26A1F83A4C100D20F4D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F04AF25F1F83A4C000D20F4D /* InfoPlist.strings */; }; @@ -604,6 +604,7 @@ /* Begin PBXFileReference section */ 12AA0005C8B3D8D8162584C5 /* Pods-RiotShareExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotShareExtension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RiotShareExtension/Pods-RiotShareExtension.debug.xcconfig"; sourceTree = ""; }; + 22D76C11C202B6BC5917A049 /* Pods-RiotPods-RiotShareExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotPods-RiotShareExtension.release.xcconfig"; path = "Pods/Target Support Files/Pods-RiotPods-RiotShareExtension/Pods-RiotPods-RiotShareExtension.release.xcconfig"; sourceTree = ""; }; 2439DD601F6BBE760090F42D /* RecentRoomTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecentRoomTableViewCell.h; sourceTree = ""; }; 2439DD611F6BBE760090F42D /* RecentRoomTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecentRoomTableViewCell.m; sourceTree = ""; }; 2439DD631F6BBEA50090F42D /* RecentRoomTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RecentRoomTableViewCell.xib; sourceTree = ""; }; @@ -691,11 +692,15 @@ 32FD0A3A1EB0CD9B0072B066 /* BugReportViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BugReportViewController.h; sourceTree = ""; }; 32FD0A3B1EB0CD9B0072B066 /* BugReportViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BugReportViewController.m; sourceTree = ""; }; 32FD0A3C1EB0CD9B0072B066 /* BugReportViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BugReportViewController.xib; sourceTree = ""; }; + 33F966BE1A83B32A2DFE24CA /* Pods-RiotPods-SiriIntents.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotPods-SiriIntents.release.xcconfig"; path = "Pods/Target Support Files/Pods-RiotPods-SiriIntents/Pods-RiotPods-SiriIntents.release.xcconfig"; sourceTree = ""; }; 397BCA987893439918EBF330 /* Pods-SiriIntents.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SiriIntents.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SiriIntents/Pods-SiriIntents.debug.xcconfig"; sourceTree = ""; }; 4D1164C2F07EF74950DCDA7A /* Pods-SiriIntents.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SiriIntents.release.xcconfig"; path = "Pods/Target Support Files/Pods-SiriIntents/Pods-SiriIntents.release.xcconfig"; sourceTree = ""; }; 5666C1236223F54D4C635C54 /* libPods-SiriIntents.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SiriIntents.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 61BB7CD1741206BEAAA6D4C7 /* Pods-RiotPods-SiriIntents.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotPods-SiriIntents.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RiotPods-SiriIntents/Pods-RiotPods-SiriIntents.debug.xcconfig"; sourceTree = ""; }; + 714B084D44A5553C13D855BA /* libPods-RiotPods-Riot.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RiotPods-Riot.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 7246451C668D6782166E22EC /* libPods-RiotShareExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RiotShareExtension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 765F5104DB3EC39713DEB3A4 /* Pods-RiotShareExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotShareExtension.release.xcconfig"; path = "Pods/Target Support Files/Pods-RiotShareExtension/Pods-RiotShareExtension.release.xcconfig"; sourceTree = ""; }; + 7C1A4A3DCE26410A60959E96 /* libPods-RiotPods-SiriIntents.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RiotPods-SiriIntents.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 83711A7B1F6F8E7D008F0D4D /* KeyboardGrowingTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KeyboardGrowingTextView.m; sourceTree = ""; }; 839BB91240D350D5607D55BA /* Pods-Riot.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Riot.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Riot/Pods-Riot.debug.xcconfig"; sourceTree = ""; }; 92324BE11F4F66D3009DE194 /* IncomingCallView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IncomingCallView.h; sourceTree = ""; }; @@ -710,7 +715,10 @@ 92726A481F58737A004AD26F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 92726A4F1F587393004AD26F /* SiriIntents.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = SiriIntents.entitlements; sourceTree = ""; }; 92726A501F587410004AD26F /* Intents.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Intents.framework; path = System/Library/Frameworks/Intents.framework; sourceTree = SDKROOT; }; + A5030B7C3C0B6EB83A9257BD /* Pods-RiotPods-Riot.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotPods-Riot.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RiotPods-Riot/Pods-RiotPods-Riot.debug.xcconfig"; sourceTree = ""; }; + AF0A0746EF74FF15B8B79658 /* libPods-RiotPods-RiotShareExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RiotPods-RiotShareExtension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; C195C53961EA28E6900AEB68 /* Pods-Riot.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Riot.release.xcconfig"; path = "Pods/Target Support Files/Pods-Riot/Pods-Riot.release.xcconfig"; sourceTree = ""; }; + C5258DFF261AA3AB228A3F11 /* Pods-RiotPods-RiotShareExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotPods-RiotShareExtension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RiotPods-RiotShareExtension/Pods-RiotPods-RiotShareExtension.debug.xcconfig"; sourceTree = ""; }; F0131DE31F2200D600CBF707 /* RiotSplitViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RiotSplitViewController.h; sourceTree = ""; }; F0131DE41F2200D600CBF707 /* RiotSplitViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RiotSplitViewController.m; sourceTree = ""; }; F02C1A831E8EB04C0045A404 /* PeopleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeopleViewController.h; sourceTree = ""; }; @@ -1292,6 +1300,7 @@ F0E05A2D1EA0F9EB004B83FB /* tab_rooms.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tab_rooms.png; sourceTree = ""; }; F0E05A2E1EA0F9EB004B83FB /* tab_rooms@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_rooms@2x.png"; sourceTree = ""; }; F0E05A2F1EA0F9EB004B83FB /* tab_rooms@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tab_rooms@3x.png"; sourceTree = ""; }; + F546BCBBB9BBEE67DB28878A /* Pods-RiotPods-Riot.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotPods-Riot.release.xcconfig"; path = "Pods/Target Support Files/Pods-RiotPods-Riot/Pods-RiotPods-Riot.release.xcconfig"; sourceTree = ""; }; FD9D0BDE9232898950554DD5 /* libPods-Riot.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Riot.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -1300,7 +1309,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A27ECCE3FC4971745D2CB78D /* libPods-RiotShareExtension.a in Frameworks */, + 40D7564A9783FD6C28C157CE /* libPods-RiotPods-RiotShareExtension.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1309,7 +1318,7 @@ buildActionMask = 2147483647; files = ( 92726A511F587410004AD26F /* Intents.framework in Frameworks */, - 714F6391AC0AA86C0AEB3F43 /* libPods-SiriIntents.a in Frameworks */, + 319F86690284AA02FC397A15 /* libPods-RiotPods-SiriIntents.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1317,8 +1326,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 05D592A32FF1D1877B89F73C /* libPods-Riot.a in Frameworks */, 3233F7461F3497E2006ACA81 /* JitsiMeet.framework in Frameworks */, + 268F9A229B0162F9C8AEBE34 /* libPods-RiotPods-Riot.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1507,6 +1516,9 @@ FD9D0BDE9232898950554DD5 /* libPods-Riot.a */, 7246451C668D6782166E22EC /* libPods-RiotShareExtension.a */, 5666C1236223F54D4C635C54 /* libPods-SiriIntents.a */, + 714B084D44A5553C13D855BA /* libPods-RiotPods-Riot.a */, + AF0A0746EF74FF15B8B79658 /* libPods-RiotPods-RiotShareExtension.a */, + 7C1A4A3DCE26410A60959E96 /* libPods-RiotPods-SiriIntents.a */, ); name = Frameworks; sourceTree = ""; @@ -1520,6 +1532,12 @@ 765F5104DB3EC39713DEB3A4 /* Pods-RiotShareExtension.release.xcconfig */, 397BCA987893439918EBF330 /* Pods-SiriIntents.debug.xcconfig */, 4D1164C2F07EF74950DCDA7A /* Pods-SiriIntents.release.xcconfig */, + A5030B7C3C0B6EB83A9257BD /* Pods-RiotPods-Riot.debug.xcconfig */, + F546BCBBB9BBEE67DB28878A /* Pods-RiotPods-Riot.release.xcconfig */, + C5258DFF261AA3AB228A3F11 /* Pods-RiotPods-RiotShareExtension.debug.xcconfig */, + 22D76C11C202B6BC5917A049 /* Pods-RiotPods-RiotShareExtension.release.xcconfig */, + 61BB7CD1741206BEAAA6D4C7 /* Pods-RiotPods-SiriIntents.debug.xcconfig */, + 33F966BE1A83B32A2DFE24CA /* Pods-RiotPods-SiriIntents.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -1544,8 +1562,8 @@ 92726A481F58737A004AD26F /* Info.plist */, ); path = SiriIntents; - sourceTree = ""; - }; + sourceTree = ""; + }; F04AF25E1F83A4C000D20F4D /* zh_Hans.lproj */ = { isa = PBXGroup; children = ( @@ -3039,7 +3057,7 @@ ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Riot-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-RiotPods-Riot-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -3057,7 +3075,7 @@ ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RiotShareExtension-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-RiotPods-RiotShareExtension-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -3070,7 +3088,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Riot/Pods-Riot-resources.sh", + "${SRCROOT}/Pods/Target Support Files/Pods-RiotPods-Riot/Pods-RiotPods-Riot-resources.sh", "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKAccountDetailsViewController.xib", "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKAttachmentsViewController.xib", "${PODS_ROOT}/MatrixKit/MatrixKit/Controllers/MXKAuthenticationViewController.xib", @@ -3140,7 +3158,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Riot/Pods-Riot-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RiotPods-Riot/Pods-RiotPods-Riot-resources.sh\"\n"; showEnvVarsInLog = 0; }; 6AA0024D4D5FAE30C2E1F311 /* [CP] Check Pods Manifest.lock */ = { @@ -3154,7 +3172,7 @@ ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SiriIntents-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-RiotPods-SiriIntents-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -3167,7 +3185,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Riot/Pods-Riot-frameworks.sh", + "${SRCROOT}/Pods/Target Support Files/Pods-RiotPods-Riot/Pods-RiotPods-Riot-frameworks.sh", "${PODS_ROOT}/WebRTC/WebRTC.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -3176,7 +3194,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Riot/Pods-Riot-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RiotPods-Riot/Pods-RiotPods-Riot-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 807A0ABF153A23C2FC22F977 /* [CP] Copy Pods Resources */ = { @@ -3185,7 +3203,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-SiriIntents/Pods-SiriIntents-resources.sh", + "${SRCROOT}/Pods/Target Support Files/Pods-RiotPods-SiriIntents/Pods-RiotPods-SiriIntents-resources.sh", "${PODS_ROOT}/MatrixSDK/MatrixSDK/Data/Store/MXCoreDataStore/MXCoreDataStore.xcdatamodeld", ); name = "[CP] Copy Pods Resources"; @@ -3194,7 +3212,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SiriIntents/Pods-SiriIntents-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RiotPods-SiriIntents/Pods-RiotPods-SiriIntents-resources.sh\"\n"; showEnvVarsInLog = 0; }; 8EA19F5011654D3BD5EDAC33 /* [CP] Copy Pods Resources */ = { @@ -3203,7 +3221,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-RiotShareExtension/Pods-RiotShareExtension-resources.sh", + "${SRCROOT}/Pods/Target Support Files/Pods-RiotPods-RiotShareExtension/Pods-RiotPods-RiotShareExtension-resources.sh", "${PODS_ROOT}/MatrixSDK/MatrixSDK/Data/Store/MXCoreDataStore/MXCoreDataStore.xcdatamodeld", ); name = "[CP] Copy Pods Resources"; @@ -3212,7 +3230,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RiotShareExtension/Pods-RiotShareExtension-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RiotPods-RiotShareExtension/Pods-RiotPods-RiotShareExtension-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -3603,7 +3621,7 @@ /* Begin XCBuildConfiguration section */ 24CBEC5A1F0EAD310093EABB /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 12AA0005C8B3D8D8162584C5 /* Pods-RiotShareExtension.debug.xcconfig */; + baseConfigurationReference = C5258DFF261AA3AB228A3F11 /* Pods-RiotPods-RiotShareExtension.debug.xcconfig */; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -3625,7 +3643,7 @@ }; 24CBEC5B1F0EAD310093EABB /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 765F5104DB3EC39713DEB3A4 /* Pods-RiotShareExtension.release.xcconfig */; + baseConfigurationReference = 22D76C11C202B6BC5917A049 /* Pods-RiotPods-RiotShareExtension.release.xcconfig */; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -3648,7 +3666,7 @@ }; 92726A4C1F58737A004AD26F /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 397BCA987893439918EBF330 /* Pods-SiriIntents.debug.xcconfig */; + baseConfigurationReference = 61BB7CD1741206BEAAA6D4C7 /* Pods-RiotPods-SiriIntents.debug.xcconfig */; buildSettings = { CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -3668,7 +3686,7 @@ }; 92726A4D1F58737A004AD26F /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4D1164C2F07EF74950DCDA7A /* Pods-SiriIntents.release.xcconfig */; + baseConfigurationReference = 33F966BE1A83B32A2DFE24CA /* Pods-RiotPods-SiriIntents.release.xcconfig */; buildSettings = { CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -3774,7 +3792,7 @@ }; F094A9C91B78D8F000B1FBBF /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 839BB91240D350D5607D55BA /* Pods-Riot.debug.xcconfig */; + baseConfigurationReference = A5030B7C3C0B6EB83A9257BD /* Pods-RiotPods-Riot.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Riot/Riot.entitlements; @@ -3797,7 +3815,7 @@ }; F094A9CA1B78D8F000B1FBBF /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C195C53961EA28E6900AEB68 /* Pods-Riot.release.xcconfig */; + baseConfigurationReference = F546BCBBB9BBEE67DB28878A /* Pods-RiotPods-Riot.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Riot/Riot.entitlements; From a9276b2a38e41be61b9f5ef98d9e82b2c2069ea2 Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 17 Oct 2017 09:02:10 +0200 Subject: [PATCH 03/26] Podfile: "The lastest release available on the CocoaPods repository" is never used --- Podfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Podfile b/Podfile index 4ecc59529..df50c8c0f 100644 --- a/Podfile +++ b/Podfile @@ -29,9 +29,6 @@ abstract_target 'RiotPods' do # The tagged version on which this version of Riot has been built pod 'MatrixKit', '0.6.3' - # The lastest release available on the CocoaPods repository - #pod 'MatrixKit' - # The develop branch version #pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' #pod 'MatrixKit', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' @@ -49,9 +46,6 @@ abstract_target 'RiotPods' do # The tagged version on which this version of Riot share extension has been built pod 'MatrixKit/AppExtension', '0.6.3' - # The lastest release available on the CocoaPods repository - #pod 'MatrixKit/AppExtension' - # The develop branch version #pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' #pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' @@ -69,9 +63,6 @@ abstract_target 'RiotPods' do # The tagged version on which this version of Riot share extension has been built #pod 'MatrixKit/AppExtension', '0.6.3' - # The lastest release available on the CocoaPods repository - #pod 'MatrixKit/AppExtension' - # The develop branch version #pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' #pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' From 8d006ff7e161f99f853e4dace44ac923d5772956 Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 17 Oct 2017 09:44:54 +0200 Subject: [PATCH 04/26] Podfile: Factorise flavors of MatrixKit --- Podfile | 83 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/Podfile b/Podfile index df50c8c0f..451d7ecdf 100644 --- a/Podfile +++ b/Podfile @@ -3,10 +3,23 @@ platform :ios, "8.0" source 'https://github.com/CocoaPods/Specs.git' + +# Different flavours of pods to MatrixKit +# The current MatrixKit pod version +matrixKitPodVersion = '0.6.3' +matrixKitVersion = matrixKitPodVersion + +# The develop branch version +#matrixKitVersion = 'develop' + +# The one used for developing both MatrixSDK and MatrixKit +# Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder +#matrixKitVersion = 'local' + + abstract_target 'RiotPods' do pod 'GBDeviceInfo', '~> 4.4.0' - pod 'GoogleAnalytics' # The Google WebRTC stack @@ -25,53 +38,51 @@ abstract_target 'RiotPods' do target "Riot" do - # Different flavours of pods to MatrixKit - # The tagged version on which this version of Riot has been built - pod 'MatrixKit', '0.6.3' - - # The develop branch version - #pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' - #pod 'MatrixKit', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' - - # The one used for developing both MatrixSDK and MatrixKit - # Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder - #pod 'MatrixKit', :path => '../matrix-ios-kit/MatrixKit.podspec' - #pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' + if matrixKitVersion == matrixKitPodVersion + pod 'MatrixKit', matrixKitVersion + else + if matrixKitVersion == 'local' + pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' + pod 'MatrixKit', :path => '../matrix-ios-kit/MatrixKit.podspec' + else + pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' + pod 'MatrixKit', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' + end + end end target "RiotShareExtension" do - # The tagged version on which this version of Riot share extension has been built - pod 'MatrixKit/AppExtension', '0.6.3' - - # The develop branch version - #pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' - #pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' - - # The one used for developing both MatrixSDK and MatrixKit - # Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder - #pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' - #pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' + if matrixKitVersion == matrixKitPodVersion + pod 'MatrixKit/AppExtension', matrixKitVersion + else + if matrixKitVersion == 'local' + pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' + pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' + else + pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' + pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' + end + end end target "SiriIntents" do - # The tagged version on which this version of Riot share extension has been built - #pod 'MatrixKit/AppExtension', '0.6.3' - - # The develop branch version - #pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' - #pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' - - # The one used for developing both MatrixSDK and MatrixKit - # Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder - #pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' - #pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' - + if matrixKitVersion == matrixKitPodVersion + pod 'MatrixKit/AppExtension', matrixKitVersion + else + if matrixKitVersion == 'local' + pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' + pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' + else + pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' + pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' + end + end end end From 1a61dcb7b7ed5049ad30c35c139c95c4a8312fa6 Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 17 Oct 2017 10:02:58 +0200 Subject: [PATCH 05/26] Podfile: More factorisation --- Podfile | 81 ++++++++++++++++++++++++++------------------------------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/Podfile b/Podfile index 451d7ecdf..f90351c0e 100644 --- a/Podfile +++ b/Podfile @@ -6,15 +6,45 @@ source 'https://github.com/CocoaPods/Specs.git' # Different flavours of pods to MatrixKit # The current MatrixKit pod version -matrixKitPodVersion = '0.6.3' -matrixKitVersion = matrixKitPodVersion +$matrixKitVersion = '0.6.3' # The develop branch version -#matrixKitVersion = 'develop' +#$matrixKitVersion = 'develop' # The one used for developing both MatrixSDK and MatrixKit # Note that MatrixSDK must be cloned into a folder called matrix-ios-sdk next to the MatrixKit folder -#matrixKitVersion = 'local' +#$matrixKitVersion = 'local' + + +# Method to import the right MatrixKit flavour +def import_MatrixKit + if $matrixKitVersion == 'local' + pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' + pod 'MatrixKit', :path => '../matrix-ios-kit/MatrixKit.podspec' + else + if $matrixKitVersion == 'develop' + pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' + pod 'MatrixKit', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' + else + pod 'MatrixKit', $matrixKitVersion + end + end +end + +# Method to import the right MatrixKit/AppExtension flavour +def import_MatrixKitAppExtension + if $matrixKitVersion == 'local' + pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' + pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' + else + if $matrixKitVersion == 'develop' + pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' + pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' + else + pod 'MatrixKit/AppExtension', $matrixKitVersion + end + end +end abstract_target 'RiotPods' do @@ -37,52 +67,15 @@ abstract_target 'RiotPods' do target "Riot" do - - if matrixKitVersion == matrixKitPodVersion - pod 'MatrixKit', matrixKitVersion - else - if matrixKitVersion == 'local' - pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' - pod 'MatrixKit', :path => '../matrix-ios-kit/MatrixKit.podspec' - else - pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' - pod 'MatrixKit', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' - end - end - + import_MatrixKit end - target "RiotShareExtension" do - - if matrixKitVersion == matrixKitPodVersion - pod 'MatrixKit/AppExtension', matrixKitVersion - else - if matrixKitVersion == 'local' - pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' - pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' - else - pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' - pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' - end - end - + import_MatrixKitAppExtension end - target "SiriIntents" do - - if matrixKitVersion == matrixKitPodVersion - pod 'MatrixKit/AppExtension', matrixKitVersion - else - if matrixKitVersion == 'local' - pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' - pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' - else - pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' - pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' - end - end + import_MatrixKitAppExtension end end From d62aad170931b1582395b63cde37985419b28b75 Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 17 Oct 2017 10:20:13 +0200 Subject: [PATCH 06/26] Podfile: Update use-dev-pods.sh --- use-dev-pods.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/use-dev-pods.sh b/use-dev-pods.sh index d210239f0..a2cb7bf51 100755 --- a/use-dev-pods.sh +++ b/use-dev-pods.sh @@ -8,9 +8,5 @@ echo Moving Podfile to develop Matrix pods # Podfile.lock will be obsolete reset it rm -f Podfile.lock -# Disable the active pods -sed -i '' -E "s!^(pod)(.*MatrixSDK)!#\1\2!g" Podfile -sed -i '' -E "s!^(pod)(.*MatrixKit)!#\1\2!g" Podfile -# And enable the develop ones -sed -i '' -E "s!^(#pod)(.*MatrixSDK)(.*develop)!pod\2\3!g" Podfile -sed -i '' -E "s!^(#pod)(.*MatrixKit)(.*develop)!pod\2\3!g" Podfile +# Enable the develop one +sed -i '' -E "s!^(#)(.*'develop')!\2!g" Podfile \ No newline at end of file From 06e2dda35827c173dfe51d424eb7cd4a4df55f7e Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 17 Oct 2017 10:28:59 +0200 Subject: [PATCH 07/26] Search in directory: Fix crash in Simplified Chineese https://github.com/matrix-org/riot-ios-rageshakes/issues/468 --- Riot/Assets/zh_Hans.lproj/Vector.strings | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Riot/Assets/zh_Hans.lproj/Vector.strings b/Riot/Assets/zh_Hans.lproj/Vector.strings index 27f99e6a9..ac76c9678 100644 --- a/Riot/Assets/zh_Hans.lproj/Vector.strings +++ b/Riot/Assets/zh_Hans.lproj/Vector.strings @@ -126,8 +126,8 @@ "directory_cell_title" = "浏览目录"; "directory_cell_description" = "%tu 个聊天室"; "directory_search_results_title" = "浏览目录结果"; -"directory_search_results" = "为 %@ 找到 %tu 个结果"; -"directory_search_results_more_than" = "> 为 %@ 找到 %tu 个结果"; +"directory_search_results" = "为 %2$@ 找到 %1$tu 个结果"; +"directory_search_results_more_than" = "> 为 %2$@ 找到 %1$tu 个结果"; "directory_searching_title" = "正在搜索目录…"; "directory_search_fail" = "获取数据失败"; // Contacts From 3b415a224ff90844eddc728d905de91991f03b23 Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 18 Oct 2017 10:19:05 +0200 Subject: [PATCH 08/26] Call: on incoming call, if CallKit is enabled, do not show the incomingCallVC. It creates a strange screens mix between the system call screen and the incomingCallVC. --- Riot/AppDelegate.m | 104 +++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 75 deletions(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index fece6b6dd..3d8e319e1 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -180,7 +180,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } @property (strong, nonatomic) UIAlertController *mxInAppNotification; -@property (strong, nonatomic) UIAlertController *incomingCallNotification; @property (nonatomic, nullable, copy) void (^registrationForRemoteNotificationsCompletion)(NSError *); @@ -2038,11 +2037,11 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { MXCall *mxCall = (MXCall*)notif.object; - BOOL isCallKitAvailable = [MXCallKitAdapter callKitAvailable] && [MXKAppSettings standardAppSettings].isCallKitEnabled; + BOOL isCallKitEnabled = [MXCallKitAdapter callKitAvailable] && [MXKAppSettings standardAppSettings].isCallKitEnabled; // Prepare the call view controller currentCallViewController = [CallViewController callViewController:nil]; - currentCallViewController.playRingtone = !isCallKitAvailable; + currentCallViewController.playRingtone = !isCallKitEnabled; currentCallViewController.mxCall = mxCall; currentCallViewController.delegate = self; @@ -2075,77 +2074,32 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } }]; } - - if (mxCall.isIncoming && !isCallKitAvailable) - { - // Prompt user before presenting the call view controller - NSString *callPromptFormat = mxCall.isVideoCall ? NSLocalizedStringFromTable(@"call_incoming_video_prompt", @"Vector", nil) : NSLocalizedStringFromTable(@"call_incoming_voice_prompt", @"Vector", nil); - NSString *callerName = currentCallViewController.peer.displayname; - if (!callerName.length) - { - callerName = currentCallViewController.peer.userId; - } - NSString *callPrompt = [NSString stringWithFormat:callPromptFormat, callerName]; - - // Removing existing notification (if any) - [_incomingCallNotification dismissViewControllerAnimated:NO completion:nil]; - - _incomingCallNotification = [UIAlertController alertControllerWithTitle:callPrompt - message:nil - preferredStyle:UIAlertControllerStyleAlert]; - __weak typeof(self) weakSelf = self; - - [_incomingCallNotification addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"decline", @"Vector", nil) - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) { - - if (weakSelf) - { - typeof(self) self = weakSelf; - - // Reject the call. - // Note: Do not reset the incoming call notification before this operation, because it is used to release properly the dismissed call view controller. - if (self->currentCallViewController) - { - [self->currentCallViewController onButtonPressed:self->currentCallViewController.rejectCallButton]; - - currentCallViewController = nil; - } - - self.incomingCallNotification = nil; - - mxCall.delegate = nil; - } - - }]]; - - [_incomingCallNotification addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"accept", @"Vector", nil) - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) { - - if (weakSelf) - { - typeof(self) self = weakSelf; - - self.incomingCallNotification = nil; - - if (self->currentCallViewController) - { - [self->currentCallViewController onButtonPressed:self->currentCallViewController.answerCallButton]; - - [self presentCallViewController:nil]; - } - } - - }]]; - - [_incomingCallNotification mxk_setAccessibilityIdentifier:@"AppDelegateIncomingCallAlert"]; - [self showNotificationAlert:_incomingCallNotification]; + if (mxCall.isIncoming && isCallKitEnabled) + { + // Let's CallKit display the system incoming call screen + // Show the callVC only after the user answered the call + __weak NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + __block id token = [[NSNotificationCenter defaultCenter] addObserverForName:kMXCallStateDidChange + object:mxCall + queue:nil + usingBlock:^(NSNotification * _Nonnull note) { + MXCall *call = (MXCall *)note.object; + + NSLog(@"XXXX call.state: %@", call); + + if (call.state == MXCallStateCreateAnswer) + { + [notificationCenter removeObserver:token]; + + NSLog(@"XXXX presentCallViewController"); + [self presentCallViewController:NO completion:nil]; + } + }]; } else { - [self presentCallViewController:nil]; + [self presentCallViewController:YES completion:nil]; } } }]; @@ -2784,7 +2738,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // Workaround to manage the "back to call" banner: present temporarily the call screen. // This will correctly manage the navigation bar layout. - [self presentCallViewController:^{ + [self presentCallViewController:YES completion:^{ [self dismissCallViewController:currentCallViewController completion:completion]; @@ -2961,7 +2915,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { if (currentCallViewController) { - [self presentCallViewController:nil]; + [self presentCallViewController:YES completion:nil]; } else if (_jitsiViewController) { @@ -2969,7 +2923,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } } -- (void)presentCallViewController:(void (^)())completion +- (void)presentCallViewController:(BOOL)animated completion:(void (^)())completion { [self removeCallStatusBar]; @@ -2977,11 +2931,11 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { if (self.window.rootViewController.presentedViewController) { - [self.window.rootViewController.presentedViewController presentViewController:currentCallViewController animated:YES completion:completion]; + [self.window.rootViewController.presentedViewController presentViewController:currentCallViewController animated:animated completion:completion]; } else { - [self.window.rootViewController presentViewController:currentCallViewController animated:YES completion:completion]; + [self.window.rootViewController presentViewController:currentCallViewController animated:animated completion:completion]; } } } From 18b700c7eb4dc520df574f1e0d4ca5a3ed287829 Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Wed, 18 Oct 2017 11:58:24 +0200 Subject: [PATCH 09/26] Pushkit - Enhancement Handle the received push notifications at the end of the background sync in order to: - ignore redacted events - ignore the events read on another device - improve the call invites handling when callkit is disabled. --- Riot/AppDelegate.m | 269 +++++++++++++++++++++++++-------------------- 1 file changed, 147 insertions(+), 122 deletions(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 3d8e319e1..8f46af456 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -155,13 +155,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN */ NSMutableDictionary *callEventsListeners; - /** - The notification listener blocks. - There is one block per MXSession. - The key is an identifier of the MXSession. The value, the listener block. - */ - NSMutableDictionary *notificationListenerBlocks; - /** Currently displayed "Call not supported" alert. */ @@ -185,7 +178,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN @property (nonatomic, strong) PKPushRegistry *pushRegistry; -@property (nonatomic) BOOL hasPendingLocalNotifications; +@property (nonatomic) NSMutableArray *incomingPushDictionaryPayloads; @end @@ -326,7 +319,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN mxSessionArray = [NSMutableArray array]; callEventsListeners = [NSMutableDictionary dictionary]; - notificationListenerBlocks = [NSMutableDictionary dictionary]; // To simplify navigation into the app, we retrieve here the main navigation controller and the tab bar controller. UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; @@ -367,6 +359,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // Configure Google Analytics here if the option is enabled [self startGoogleAnalytics]; + // Prepare Pushkit handling + _incomingPushDictionaryPayloads = [NSMutableArray array]; + // Add matrix observers, and initialize matrix sessions if the app is not launched in background. [self initMatrixSessions]; @@ -461,6 +456,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { NSLog(@"[AppDelegate] applicationWillEnterForeground"); + // Flush all the pending push notifications. + [self.incomingPushDictionaryPayloads removeAllObjects]; + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. _isAppForeground = YES; @@ -473,8 +471,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { NSLog(@"[AppDelegate] applicationDidBecomeActive"); - _hasPendingLocalNotifications = NO; - // Check if there is crash log to send if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enableCrashReport"]) { @@ -1072,57 +1068,167 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN - (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type { - // Handle the local notifications by triggering a background sync. - [self handleLocalNotifications]; + NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload: %@", payload.dictionaryPayload); + + // Display local notifications only when the app is running in background. + if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) + { + // Store the payload dictionary + [self.incomingPushDictionaryPayloads addObject:payload.dictionaryPayload]; + + // Handle the local notifications by triggering a background sync. + [self handleLocalNotifications]; + } } - (void)handleLocalNotifications { - _hasPendingLocalNotifications = NO; - - // Check whether the application is running in background. - if ([UIApplication sharedApplication].applicationState != UIApplicationStateBackground) - return; - // Launch a background sync for all existing matrix sessions NSArray *mxAccounts = [MXKAccountManager sharedManager].activeAccounts; for (MXKAccount *account in mxAccounts) { // Check the current session state - if (account.mxSession.state != MXSessionStatePaused) + if (account.mxSession.state == MXSessionStatePaused) { - NSLog(@"[AppDelegate] handleLocalNotifications: delay the background sync"); - // Turn on the flag used to trigger a new background sync when a session is paused. - _hasPendingLocalNotifications = YES; + NSLog(@"[AppDelegate] handleLocalNotifications: run a background sync"); + __weak typeof(self) weakSelf = self; + + [account backgroundSync:20000 success:^{ + + // Sanity check + if (!weakSelf) + { + return; + } + typeof(self) self = weakSelf; + + NSLog(@"[AppDelegate] handleLocalNotifications: the background sync succeeds"); + + // The call invite are handled here only when the callkit is not active. + BOOL isCallKitActive = [MXCallKitAdapter callKitAvailable] && [MXKAppSettings standardAppSettings].isCallKitEnabled; + + // Display a local notification for each incoming push when the corresponding event has been retrieved during the bg sync. + for (NSUInteger index = 0; index < self.incomingPushDictionaryPayloads.count; ) + { + NSDictionary *payload = self.incomingPushDictionaryPayloads[index]; + NSString *eventId = payload[@"event_id"]; + NSString *roomId = payload[@"room_id"]; + BOOL checkReadEvent = YES; + MXEvent *event; + + if (eventId && roomId) + { + event = [account.mxSession.store eventWithEventId:eventId inRoom:roomId]; + } + + if (event) + { + // Remove this pending push. + [self.incomingPushDictionaryPayloads removeObjectAtIndex:index]; + + // Ignore redacted event. + if (event.isRedactedEvent) + { + continue; + } + + // Consider here the call invites + if (event.eventType == MXEventTypeCallInvite) + { + // Ignore call invite when callkit is active. + if (isCallKitActive) + { + continue; + } + else + { + // Retrieve the current call state from the call manager + MXCallInviteEventContent *callInviteEventContent = [MXCallInviteEventContent modelFromJSON:event.content]; + MXCall *call = [account.mxSession.callManager callWithCallId:callInviteEventContent.callId]; + + if (call.state <= MXCallStateRinging) + { + // Keep display a local notification even if the event has been read on another device. + checkReadEvent = NO; + } + } + } + + if (checkReadEvent) + { + // Ignore event which has been read on another device. + MXReceiptData *readReceipt = [account.mxSession.store getReceiptInRoom:roomId forUserId:account.mxCredentials.userId]; + if (readReceipt) + { + MXEvent *readReceiptEvent = [account.mxSession.store eventWithEventId:readReceipt.eventId inRoom:roomId]; + if (event.originServerTs <= readReceiptEvent.originServerTs) + { + continue; + } + } + } + + // Prepare the local notification + MXPushRule *rule = [account.mxSession.notificationCenter ruleMatchingEvent:event]; + + NSString *notificationBody = [self notificationBodyForEvent:event pushRule:rule inAccount:account]; + if (notificationBody) + { + UILocalNotification *eventNotification = [[UILocalNotification alloc] init]; + eventNotification.alertBody = notificationBody; + eventNotification.userInfo = @{ @"room_id" : event.roomId }; + + // Set sound name based on the value provided in action of MXPushRule + for (MXPushRuleAction *action in rule.actions) + { + if (action.actionType == MXPushRuleActionTypeSetTweak) + { + if ([action.parameters[@"set_tweak"] isEqualToString:@"sound"]) + { + NSString *soundName = action.parameters[@"value"]; + if ([soundName isEqualToString:@"default"]) + soundName = UILocalNotificationDefaultSoundName; + + eventNotification.soundName = soundName; + } + } + } + + [[UIApplication sharedApplication] scheduleLocalNotification:eventNotification]; + } + } + else + { + // Keep this push payload + index++; + } + } + + // Update icon badge number + [UIApplication sharedApplication].applicationIconBadgeNumber = [account.mxSession riot_missedDiscussionsCount]; + + } failure:^(NSError *error) { + + NSLog(@"[AppDelegate] handleLocalNotifications: the background sync fails"); + + }]; } - - [account backgroundSync:20000 success:^{ - - NSLog(@"[AppDelegate] handleLocalNotifications: the background sync succeeds"); - - // Update icon badge number - [UIApplication sharedApplication].applicationIconBadgeNumber = [account.mxSession riot_missedDiscussionsCount]; - - } failure:^(NSError *error) { - - NSLog(@"[AppDelegate] handleLocalNotifications: the background sync fails"); - - }]; } } -- (nullable NSString *)notificationBodyForEvent:(MXEvent *)event withRoomState:(MXRoomState *)roomState pushRule:(MXPushRule*)rule inAccount:(MXKAccount*)account +- (nullable NSString *)notificationBodyForEvent:(MXEvent *)event pushRule:(MXPushRule*)rule inAccount:(MXKAccount*)account { if (!event.content || !event.content.count) return nil; + MXRoom *room = [account.mxSession roomWithRoomId:event.roomId]; + MXRoomState *roomState = room.state; + NSString *notificationBody; NSString *eventSenderName = [roomState memberName:event.sender]; if (event.eventType == MXEventTypeRoomMessage || event.eventType == MXEventTypeRoomEncrypted) { - MXRoom *room = [account.mxSession roomWithRoomId:event.roomId]; - if (room.isMentionsOnly) { // A local notification will be displayed only for highlighted notification. @@ -1712,9 +1818,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // A new call observer may be added here [self addMatrixCallObserver]; - // Enable local notifications - [self enableLocalNotificationsFromMatrixSession:mxSession]; - // Look for the account related to this session. NSArray *mxAccounts = [MXKAccountManager sharedManager].activeAccounts; for (MXKAccount *account in mxAccounts) @@ -1750,7 +1853,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN else if (mxSession.state == MXSessionStatePaused) { // Check whether some local notifications must be handled by triggering a background sync. - if (_hasPendingLocalNotifications) + if (self.incomingPushDictionaryPayloads.count) { [self handleLocalNotifications]; } @@ -1925,9 +2028,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // If any, disable the no VoIP support workaround [self disableNoVoIPOnMatrixSession:mxSession]; - // Disable local notifications from this session - [self disableLocalNotificationsFromMatrixSession:mxSession]; - [mxSessionArray removeObject:mxSession]; if (!mxSessionArray.count && matrixCallObserver) @@ -1973,6 +2073,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { self.pushRegistry = nil; isPushRegistered = NO; + [self.incomingPushDictionaryPayloads removeAllObjects]; // Clear cache [MXMediaManager clearCache]; @@ -2230,82 +2331,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } } -- (void)enableLocalNotificationsFromMatrixSession:(MXSession*)mxSession -{ - __weak typeof(self) weakSelf = self; - - // Look for the account related to this session. - NSArray *mxAccounts = [MXKAccountManager sharedManager].activeAccounts; - MXKAccount *account; - for (account in mxAccounts) - { - if (account.mxSession == mxSession) - { - break; - } - account = nil; - } - - MXOnNotification notificationListenerBlock = ^(MXEvent *event, MXRoomState *roomState, MXPushRule *rule) { - - // Do not display local notification if the app is not running in background. - if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground) - { - return; - } - - // Do not display local notifications during the initial sync. - if (!account.mxSession.isEventStreamInitialised) - { - return; - } - - // For all type of event show local notifications besides the situation - // when the type of event is call invite and we have CallKit support - BOOL isCallKitActive = [MXCallKitAdapter callKitAvailable] && [MXKAppSettings standardAppSettings].isCallKitEnabled; - if (!(event.eventType == MXEventTypeCallInvite && isCallKitActive)) - { - NSString *notificationBody = [weakSelf notificationBodyForEvent:event withRoomState:roomState pushRule:rule inAccount:account]; - if (notificationBody) - { - UILocalNotification *eventNotification = [[UILocalNotification alloc] init]; - eventNotification.fireDate = [NSDate dateWithTimeIntervalSince1970:event.originServerTs / 1000]; - eventNotification.alertBody = notificationBody; - eventNotification.userInfo = @{ @"room_id" : event.roomId }; - - // Set sound name based on the value provided in action of MXPushRule - for (MXPushRuleAction *action in rule.actions) - { - if (action.actionType == MXPushRuleActionTypeSetTweak) - { - if ([action.parameters[@"set_tweak"] isEqualToString:@"sound"]) - { - NSString *soundName = action.parameters[@"value"]; - if ([soundName isEqualToString:@"default"]) - soundName = UILocalNotificationDefaultSoundName; - - eventNotification.soundName = soundName; - } - } - } - - [[UIApplication sharedApplication] scheduleLocalNotification:eventNotification]; - } - } - }; - - [mxSession.notificationCenter listenToNotifications:notificationListenerBlock]; - notificationListenerBlocks[@(mxSession.hash)] = notificationListenerBlock; -} - -- (void)disableLocalNotificationsFromMatrixSession:(MXSession*)mxSession -{ - // Stop listening to notification of this session - [mxSession.notificationCenter removeListener:notificationListenerBlocks[@(mxSession.hash)]]; - [notificationListenerBlocks removeObjectForKey:@(mxSession.hash)]; -} - - #pragma mark - /** From baf2f6d7d397ecab02023c73b5eebe52759fc141 Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Wed, 18 Oct 2017 14:10:08 +0200 Subject: [PATCH 10/26] Pushkit - Enhancement Add sanity check --- Riot/AppDelegate.m | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 8f46af456..0fff90880 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -1068,16 +1068,25 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN - (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type { - NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload: %@", payload.dictionaryPayload); - // Display local notifications only when the app is running in background. if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) { - // Store the payload dictionary - [self.incomingPushDictionaryPayloads addObject:payload.dictionaryPayload]; + NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload while app is in background"); - // Handle the local notifications by triggering a background sync. - [self handleLocalNotifications]; + // Sanity check: consider only push payload with event id and room id. + NSDictionary *dictionaryPayload = payload.dictionaryPayload; + if (dictionaryPayload[@"event_id"] && dictionaryPayload[@"room_id"]) + { + // Store the payload dictionary + [self.incomingPushDictionaryPayloads addObject:dictionaryPayload]; + + // Handle the local notifications by triggering a background sync. + [self handleLocalNotifications]; + } + else + { + NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload - Unexpected payload %@", dictionaryPayload); + } } } From a13a9499579910818cb431c5c2acb093bb57d655 Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 18 Oct 2017 14:12:09 +0200 Subject: [PATCH 11/26] Podfile: Update WebRTC -> '61.5.19063' --- Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Podfile b/Podfile index f90351c0e..4e326468d 100644 --- a/Podfile +++ b/Podfile @@ -53,7 +53,7 @@ abstract_target 'RiotPods' do pod 'GoogleAnalytics' # The Google WebRTC stack - pod 'WebRTC', '58.17.16937' + pod 'WebRTC', '61.5.19063' # OLMKit for crypto pod 'OLMKit' From 0638758c878c0dd42a549bcda8fa7a5bdd89aa48 Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 18 Oct 2017 14:42:26 +0200 Subject: [PATCH 12/26] Podfile: Update Realm -> '3.0.0' --- Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Podfile b/Podfile index 4e326468d..eadd78bb8 100644 --- a/Podfile +++ b/Podfile @@ -58,7 +58,7 @@ abstract_target 'RiotPods' do # OLMKit for crypto pod 'OLMKit' #pod 'OLMKit', :path => '../olm/OLMKit.podspec' - pod 'Realm', '~> 2.10.2' + pod 'Realm', '~> 3.0.0' # Remove warnings from "bad" pods pod 'OLMKit', :inhibit_warnings => true From fb65be28fc3bab288bad526f9a326d7e8980c474 Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Wed, 18 Oct 2017 19:18:14 +0200 Subject: [PATCH 13/26] PushKit - Enhancement Don't forget notifications lost while the device was offline --- Riot/AppDelegate.m | 118 ++++++++++++++++++++++++++++++++------------- 1 file changed, 85 insertions(+), 33 deletions(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 0fff90880..d91bc48c2 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -155,6 +155,20 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN */ NSMutableDictionary *callEventsListeners; + /** + The notification listener blocks. + There is one block per MXSession. + The key is an identifier of the MXSession. The value, the listener block. + */ + NSMutableDictionary *notificationListenerBlocks; + + /** + The list of the events which need to be notified at the end of the background sync. + There is one list per MXSession. + The key is an identifier of the MXSession. The value, an array of dictionaries (eventId, roomId... for each event). + */ + NSMutableDictionary *> *eventsToNotify; + /** Currently displayed "Call not supported" alert. */ @@ -178,7 +192,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN @property (nonatomic, strong) PKPushRegistry *pushRegistry; -@property (nonatomic) NSMutableArray *incomingPushDictionaryPayloads; +@property (nonatomic) NSMutableArray *incomingPushEventIds; @end @@ -319,6 +333,8 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN mxSessionArray = [NSMutableArray array]; callEventsListeners = [NSMutableDictionary dictionary]; + notificationListenerBlocks = [NSMutableDictionary dictionary]; + eventsToNotify = [NSMutableDictionary dictionary]; // To simplify navigation into the app, we retrieve here the main navigation controller and the tab bar controller. UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; @@ -360,7 +376,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN [self startGoogleAnalytics]; // Prepare Pushkit handling - _incomingPushDictionaryPayloads = [NSMutableArray array]; + _incomingPushEventIds = [NSMutableArray array]; // Add matrix observers, and initialize matrix sessions if the app is not launched in background. [self initMatrixSessions]; @@ -457,7 +473,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN NSLog(@"[AppDelegate] applicationWillEnterForeground"); // Flush all the pending push notifications. - [self.incomingPushDictionaryPayloads removeAllObjects]; + [self.incomingPushEventIds removeAllObjects]; // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. @@ -1073,20 +1089,20 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload while app is in background"); - // Sanity check: consider only push payload with event id and room id. - NSDictionary *dictionaryPayload = payload.dictionaryPayload; - if (dictionaryPayload[@"event_id"] && dictionaryPayload[@"room_id"]) + // Check whether an event id is provided. + NSString *eventId = payload.dictionaryPayload[@"event_id"]; + if (eventId) { - // Store the payload dictionary - [self.incomingPushDictionaryPayloads addObject:dictionaryPayload]; - - // Handle the local notifications by triggering a background sync. - [self handleLocalNotifications]; + // Store the event identifier. + [self.incomingPushEventIds addObject:eventId]; } else { NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload - Unexpected payload %@", dictionaryPayload); } + + // Handle the local notifications by triggering a background sync. + [self handleLocalNotifications]; } } @@ -1116,12 +1132,14 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // The call invite are handled here only when the callkit is not active. BOOL isCallKitActive = [MXCallKitAdapter callKitAvailable] && [MXKAppSettings standardAppSettings].isCallKitEnabled; - // Display a local notification for each incoming push when the corresponding event has been retrieved during the bg sync. - for (NSUInteger index = 0; index < self.incomingPushDictionaryPayloads.count; ) + NSMutableArray *eventsArray = eventsToNotify[@(account.mxSession.hash)]; + + // Display a local notification for each event retrieved by the bg sync. + for (NSUInteger index = 0; index < eventsArray.count; index++) { - NSDictionary *payload = self.incomingPushDictionaryPayloads[index]; - NSString *eventId = payload[@"event_id"]; - NSString *roomId = payload[@"room_id"]; + NSDictionary *eventDict = eventsArray[index]; + NSString *eventId = eventDict[@"event_id"]; + NSString *roomId = eventDict[@"room_id"]; BOOL checkReadEvent = YES; MXEvent *event; @@ -1132,9 +1150,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN if (event) { - // Remove this pending push. - [self.incomingPushDictionaryPayloads removeObjectAtIndex:index]; - // Ignore redacted event. if (event.isRedactedEvent) { @@ -1178,7 +1193,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } // Prepare the local notification - MXPushRule *rule = [account.mxSession.notificationCenter ruleMatchingEvent:event]; + MXPushRule *rule = eventDict[@"push_rule"]; NSString *notificationBody = [self notificationBodyForEvent:event pushRule:rule inAccount:account]; if (notificationBody) @@ -1206,13 +1221,10 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN [[UIApplication sharedApplication] scheduleLocalNotification:eventNotification]; } } - else - { - // Keep this push payload - index++; - } } + [eventsArray removeAllObjects]; + // Update icon badge number [UIApplication sharedApplication].applicationIconBadgeNumber = [account.mxSession riot_missedDiscussionsCount]; @@ -1317,13 +1329,10 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } else if (event.eventType == MXEventTypeRoomMember) { - NSString *roomName = roomState.name; - NSString *roomAlias = roomState.aliases.firstObject; + NSString *roomDisplayName = room.summary.displayname; - if (roomName) - notificationBody = [NSString stringWithFormat:NSLocalizedString(@"USER_INVITE_TO_NAMED_ROOM", nil), eventSenderName, roomName]; - else if (roomAlias) - notificationBody = [NSString stringWithFormat:NSLocalizedString(@"USER_INVITE_TO_NAMED_ROOM", nil), eventSenderName, roomAlias]; + if (roomDisplayName.length && ![roomDisplayName isEqualToString:eventSenderName]) + notificationBody = [NSString stringWithFormat:NSLocalizedString(@"USER_INVITE_TO_NAMED_ROOM", nil), eventSenderName, roomDisplayName]; else notificationBody = [NSString stringWithFormat:NSLocalizedString(@"USER_INVITE_TO_CHAT", nil), eventSenderName]; } @@ -1827,6 +1836,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // A new call observer may be added here [self addMatrixCallObserver]; + // Enable local notifications + [self enableLocalNotificationsFromMatrixSession:mxSession]; + // Look for the account related to this session. NSArray *mxAccounts = [MXKAccountManager sharedManager].activeAccounts; for (MXKAccount *account in mxAccounts) @@ -1862,7 +1874,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN else if (mxSession.state == MXSessionStatePaused) { // Check whether some local notifications must be handled by triggering a background sync. - if (self.incomingPushDictionaryPayloads.count) + if (self.incomingPushEventIds.count) { [self handleLocalNotifications]; } @@ -2037,6 +2049,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // If any, disable the no VoIP support workaround [self disableNoVoIPOnMatrixSession:mxSession]; + // Disable local notifications from this session + [self disableLocalNotificationsFromMatrixSession:mxSession]; + [mxSessionArray removeObject:mxSession]; if (!mxSessionArray.count && matrixCallObserver) @@ -2082,7 +2097,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { self.pushRegistry = nil; isPushRegistered = NO; - [self.incomingPushDictionaryPayloads removeAllObjects]; + [self.incomingPushEventIds removeAllObjects]; // Clear cache [MXMediaManager clearCache]; @@ -2340,6 +2355,43 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } } +- (void)enableLocalNotificationsFromMatrixSession:(MXSession*)mxSession +{ + // Prepare listener block. + MXOnNotification notificationListenerBlock = ^(MXEvent *event, MXRoomState *roomState, MXPushRule *rule) { + + // Ignore this event if the app is not running in background. + if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground) + { + return; + } + + // Check whether this event corresponds to a pending push. + NSUInteger index = [self.incomingPushEventIds indexOfObject:event.eventId]; + if (index != NSNotFound) + { + // Remove it from the pending list. + [self.incomingPushEventIds removeObjectAtIndex:index]; + } + + // Add it to the list of the events to notify. + [eventsToNotify[@(mxSession.hash)] addObject:@{@"event_id": event.eventId, @"room_id": event.roomId, @"push_rule": rule}]; + + }; + + eventsToNotify[@(mxSession.hash)] = [NSMutableArray array]; + [mxSession.notificationCenter listenToNotifications:notificationListenerBlock]; + notificationListenerBlocks[@(mxSession.hash)] = notificationListenerBlock; +} + +- (void)disableLocalNotificationsFromMatrixSession:(MXSession*)mxSession +{ + // Stop listening to notification of this session + [mxSession.notificationCenter removeListener:notificationListenerBlocks[@(mxSession.hash)]]; + [notificationListenerBlocks removeObjectForKey:@(mxSession.hash)]; + [eventsToNotify removeObjectForKey:@(mxSession.hash)]; +} + #pragma mark - /** From 5b93b13190c7feb2b7bd18df827c968e36889b9d Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 19 Oct 2017 10:03:23 +0200 Subject: [PATCH 14/26] Callkit: Show the Riot icon (in B&W) on the system call screen --- Riot.xcodeproj/project.pbxproj | 12 ++++++++++++ Riot/AppDelegate.m | 8 +++++--- Riot/Assets/Images/riot_icon_callkit.png | Bin 0 -> 2145 bytes Riot/Assets/Images/riot_icon_callkit@2.png | Bin 0 -> 5119 bytes Riot/Assets/Images/riot_icon_callkit@3.png | Bin 0 -> 5933 bytes 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 Riot/Assets/Images/riot_icon_callkit.png create mode 100644 Riot/Assets/Images/riot_icon_callkit@2.png create mode 100644 Riot/Assets/Images/riot_icon_callkit@3.png diff --git a/Riot.xcodeproj/project.pbxproj b/Riot.xcodeproj/project.pbxproj index ca5b9a63d..aa0179028 100755 --- a/Riot.xcodeproj/project.pbxproj +++ b/Riot.xcodeproj/project.pbxproj @@ -69,6 +69,9 @@ 32918EAA1F473BDB0076CA16 /* Vector.strings in Resources */ = {isa = PBXBuildFile; fileRef = 32918EA71F473BDB0076CA16 /* Vector.strings */; }; 32935CB11F6056FD006888C8 /* IntegrationManagerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 32935CB01F6056FD006888C8 /* IntegrationManagerViewController.m */; }; 32935CB41F628BCE006888C8 /* IntegrationManager.js in Resources */ = {isa = PBXBuildFile; fileRef = 32935CB31F628BCE006888C8 /* IntegrationManager.js */; }; + 329DCE191F988F8100468420 /* riot_icon_callkit.png in Resources */ = {isa = PBXBuildFile; fileRef = 329DCE161F988F8100468420 /* riot_icon_callkit.png */; }; + 329DCE1A1F988F8100468420 /* riot_icon_callkit@2.png in Resources */ = {isa = PBXBuildFile; fileRef = 329DCE171F988F8100468420 /* riot_icon_callkit@2.png */; }; + 329DCE1B1F988F8100468420 /* riot_icon_callkit@3.png in Resources */ = {isa = PBXBuildFile; fileRef = 329DCE181F988F8100468420 /* riot_icon_callkit@3.png */; }; 32AE61E41F0A971B007255F4 /* RoomMembershipBubbleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 32AE61E21F0A971B007255F4 /* RoomMembershipBubbleCell.m */; }; 32AE61E51F0A971B007255F4 /* RoomMembershipBubbleCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 32AE61E31F0A971B007255F4 /* RoomMembershipBubbleCell.xib */; }; 32AE61E91F0CE099007255F4 /* RoomMembershipWithPaginationTitleBubbleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 32AE61E71F0CE099007255F4 /* RoomMembershipWithPaginationTitleBubbleCell.m */; }; @@ -670,6 +673,9 @@ 32935CAF1F6056FD006888C8 /* IntegrationManagerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntegrationManagerViewController.h; sourceTree = ""; }; 32935CB01F6056FD006888C8 /* IntegrationManagerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IntegrationManagerViewController.m; sourceTree = ""; }; 32935CB31F628BCE006888C8 /* IntegrationManager.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = IntegrationManager.js; sourceTree = ""; }; + 329DCE161F988F8100468420 /* riot_icon_callkit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = riot_icon_callkit.png; sourceTree = ""; }; + 329DCE171F988F8100468420 /* riot_icon_callkit@2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "riot_icon_callkit@2.png"; sourceTree = ""; }; + 329DCE181F988F8100468420 /* riot_icon_callkit@3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "riot_icon_callkit@3.png"; sourceTree = ""; }; 32AE61E11F0A971B007255F4 /* RoomMembershipBubbleCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoomMembershipBubbleCell.h; sourceTree = ""; }; 32AE61E21F0A971B007255F4 /* RoomMembershipBubbleCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoomMembershipBubbleCell.m; sourceTree = ""; }; 32AE61E31F0A971B007255F4 /* RoomMembershipBubbleCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RoomMembershipBubbleCell.xib; sourceTree = ""; }; @@ -1845,6 +1851,9 @@ F083BBAD1E7009EC00A9B29C /* remove_icon_pink.png */, F083BBAE1E7009EC00A9B29C /* remove_icon_pink@2x.png */, F083BBAF1E7009EC00A9B29C /* remove_icon_pink@3x.png */, + 329DCE161F988F8100468420 /* riot_icon_callkit.png */, + 329DCE171F988F8100468420 /* riot_icon_callkit@2.png */, + 329DCE181F988F8100468420 /* riot_icon_callkit@3.png */, F083BBB01E7009EC00A9B29C /* riot_icon.png */, F083BBB11E7009EC00A9B29C /* riot_icon@2x.png */, F083BBB21E7009EC00A9B29C /* riot_icon@3x.png */, @@ -2714,6 +2723,7 @@ F083BD3D1E7009ED00A9B29C /* call_hangup_icon@2x.png in Resources */, F083BE551E7009ED00A9B29C /* RoomOutgoingEncryptedTextMsgWithoutSenderNameBubbleCell.xib in Resources */, 32471CDD1F1373A100BDF50A /* RoomMembershipCollapsedWithPaginationTitleBubbleCell.xib in Resources */, + 329DCE191F988F8100468420 /* riot_icon_callkit.png in Resources */, 3233F7321F31F4BF006ACA81 /* JitsiViewController.xib in Resources */, F083BD301E7009ED00A9B29C /* bubbles_bg_landscape.png in Resources */, F083BDA41E7009ED00A9B29C /* notifications.png in Resources */, @@ -2777,6 +2787,7 @@ F083BE751E7009ED00A9B29C /* RoomOutgoingTextMsgWithoutSenderNameBubbleCell.xib in Resources */, F04AF26A1F83A4C100D20F4D /* InfoPlist.strings in Resources */, F083BD261E7009ED00A9B29C /* admin_icon@2x.png in Resources */, + 329DCE1B1F988F8100468420 /* riot_icon_callkit@3.png in Resources */, 3205ED851E97725E003D65FA /* DirectoryServerTableViewCell.xib in Resources */, F083BD761E7009ED00A9B29C /* e2e_verified@3x.png in Resources */, F083BE181E7009ED00A9B29C /* MediaPickerViewController.xib in Resources */, @@ -2871,6 +2882,7 @@ F083BDB11E7009ED00A9B29C /* priorityHigh@2x.png in Resources */, F0614A0E1EDDCCE700F5DC9A /* jump_to_unread@2x.png in Resources */, F083BDC21E7009ED00A9B29C /* scrollup.png in Resources */, + 329DCE1A1F988F8100468420 /* riot_icon_callkit@2.png in Resources */, F083BD521E7009ED00A9B29C /* camera_stop@2x.png in Resources */, 327382C21F276AED00356143 /* InfoPlist.strings in Resources */, 327382B81F276AD200356143 /* InfoPlist.strings in Resources */, diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index d91bc48c2..b9feae4fe 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -1098,7 +1098,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } else { - NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload - Unexpected payload %@", dictionaryPayload); + NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload - Unexpected payload %@", payload.dictionaryPayload); } // Handle the local notifications by triggering a background sync. @@ -2336,8 +2336,10 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { if (enable) { - // Create adapter with default configuration for a while - MXCallKitAdapter *callKitAdapter = [[MXCallKitAdapter alloc] init]; + // Create adapter for Riot + MXCallKitConfiguration *callKitConfiguration = [[MXCallKitConfiguration alloc] init]; + callKitConfiguration.iconName = @"riot_icon_callkit"; + MXCallKitAdapter *callKitAdapter = [[MXCallKitAdapter alloc] initWithConfiguration:callKitConfiguration]; id audioSessionConfigurator; diff --git a/Riot/Assets/Images/riot_icon_callkit.png b/Riot/Assets/Images/riot_icon_callkit.png new file mode 100644 index 0000000000000000000000000000000000000000..250f0bc6477f968c31911604dafdf260c0f36f58 GIT binary patch literal 2145 zcmV-n2%h(eP)YtKzPc-Qrad^OCezfTWm{_M_Sb36(!Uv9fr2HR1%Q9 z7Iq_$)ES|cRtprufPxG#1glktDJVloj1@|hHwu~z&m_B>-Mjamdw%^R-~c5dBw@yx z`kVRvv*-No{p|Pr&hK~b0lv1cu)T6(ZKt2X?ld9q=@OK#%?AJ!u3M8zsg5LdQm>GG zI7BdHD^b!2WaeDG@t0}aw&C^Z)4LWhclt7T`ny=P-k8ozdWGWB2Lf0h2ek3YVEvtO z0Mtsj#=x2hw3C3B8E_GdSJAkrnMTmYH3m|O2Msex8{+FmO z4s%l-d4gWl*0J?0BQ>kZX6#RGY7@h zo4ZEAMY94!DPkXQb%G>xD;Nf*@tbs%ke6b%^{$g^#{`L2{TZ`QF00y7AfyOLpp+TS zi=`)#v`8HOho0=1f&f5q%5QUA64<^_ZOCDKGh)Zmu6x*u{m8-9asfGrGk&7@(54eU z-L;o9mZUH~4^GeDOGafwc+`$BaSH(rX;XgAV1$f5iMG2aL3QU}_hg5!Nat#I6@1wv zgTJq9Ts?Nxh#X*G59)+e20U6=S)LypJsWxNuj@D<^QjkG-2&IlcF}QR3uci(i`$6W zaS^r6xq|F7+fP?j_jD&_>s*~=gLXqvevzQLCjbZ*RF)6$I-DH`R3@gJYcpEs==GEP zUXnyX03|I>B|2B1PtaV`(h>(IGw`$Zk%q8Ocf~ZO&NHQWi6D17q-fORC^}T$ zu}xA~vuPDoho77L_#i^e6Ju#p$Aw7A0 z{>YguB14X_Y}CWDQE##v^i*#T{eEBXA(Eu`Wax`Ci$+eH$r(FLL`89FWplFCOZ}VcTo|4 zR@m~7#K;`qdnCPA_wl)qWh5wIr3|d7t#_+;*&6K|675=E5)^R!GVS3VH%?quwPk~@ zXmi7sk?-VMdQI%Kk?!tmY&ibT&jAPqK!OMW%l-GiQ1-yM&I1xi+%8KjDe&S)yVem% zr;rWHGUG8RpK5X&{gUANy^~2;9$Nd(|-DTQRSxPU|_-0H|#26V1s%jBn?ovT-hG|%V$I7X9lQAfI=xEc>HxEc>FFor7AnOnJYup~5|x%yY@lChOIrUWu`-Y!1030(?!-2};W zjq{!!)yX_5-moVv=?Emz(# zAp0&JJFhcKY!Zl6t~dxJ!y+1MIl?eE5xC0ueFU;@y33hZfYJ*8J^;_Q6R>}00Bbp8 z1Adh@v0P)S!>u@XE&pKaY7hnu@TBaG33E6DJ9^VnzZpbs)>0_I8URPy0a)9q+pVI? za-ni{hC@~N#w@c;5~*%g|C38`(3N<&MluWzX3Rc&+smh{rTrM_e47d}?pd+BD0#mK57fVdps&{e=YGRVql1Xfz`=1o}fTWA@pC+qA6QtfeTcDE^$lrrz|a zaN`vYFk{8;qUhqEE$f(q1&7KJ%*a7u<;Gzk_5$Z@62Kryeh6TJ%J_ak5`oMdw4xx& zDvFVpRs3CmEe9~++B^RNU`c6(|8QQGAEg!kj+c+Z$_;IOmfkTwH>;?PF+aYx|9kr{ XX|t{Xqzz5#00000NkvXXu0mjfGw1yX literal 0 HcmV?d00001 diff --git a/Riot/Assets/Images/riot_icon_callkit@2.png b/Riot/Assets/Images/riot_icon_callkit@2.png new file mode 100644 index 0000000000000000000000000000000000000000..33ba6e019c2f7bd58c4a7c5bc1ce4b676b721296 GIT binary patch literal 5119 zcmVI?dJdh6O2hj zK~#9!?Ob_y71i1Qy=P|by}36Dfq+Tasj|o}vLxEpVyl(C6hYR2B2=x`wtj>ihXe>q zv3>E=ZT~;>hq2*Zmd;$Pq{<;_1 z$vn@`5MgUVot)=I7uN+oZx8~qW(_4aq~rp&P`LP~lh0JWHskCBtcZT~hfCn>sY{T& zZVqNXyrdnxNPypZgv%^|0e}Gsh*l1WxF%3;bOIrw;#$qYj2sX?B%-YVA2R*Qm&re$ z5CDML`!*nXz~mnWfioUif)&rs!K^8Z7t0d!2^eg@Y^@yZH8s(o{iX%DL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@Z*-?yB^w@WMdj^*I1ORHe49H)FapplDEcwPlT_|fY9JO zpS$>uPLE(05cJ~~F#Ng3V$@eF%XQol9D68ckcF#p{xFkDw-G3MuX;7pHTm$3QK*v}a7P;IAToa+(nCUpHe0B_c8eqvbc5$q!F zdT3)3j9mxU8bBO|U_$3?B)A|r5{{7*+x^*N&9x^TSU#a0uh_GhXu?ykO?a)z5u56N z-A1TQmWwmYJ|~M2^@+ZsDeTixSY;8*u*d3}CqqVP^a(J>D{M?|iE(Tqw(1kdyh*rV zHQWr~FEt1uhG!kYwk#4n_Eygl#I}9_urE7Ad_tXT-Zn6pceW!E8)`dS0itg@WWMK# zPZuR7RX@u`7@TzktCsZ=#`;eJ0Fq-bxhRt*HttLrIqXb!(?B6Xqs8>~-PvJ!E!j=B zV7XiUbxTB(pAfpd62lAACHJOBzw{y_+*oBLernbc99whkD2U2}$0xj?u_M^zc+YO$ zHqetD!QRZ^y@Q1$$oVoyM77|a%EOXdYzr^Okcd4zowEB^;p+tV`bSQHWhm}-yK~oz zmZYCo=1d!dg=CpET~@I;;(YJ@WT^KAu`txiDq9Q*J-Oj7;UifIY}>RxoUs^}Wn9C6 zYE)kQ^6Nj3C1xeTa>#cdfU@QdR~CFKB5 z!{RnL#$KW^HUkqS!+qe8?r|>e0==h+XWe5p|p3 z+gGo9fEa#U4vV;j*Am?{p(z*u2Bp-Na00mmpeHv<4srpDI9={`Gcn2bT~F?`+}~$2 zT;ulmyPwHoj1)P4J;2KE6Eexh>#1Jan;s<5WFPQ=6CqyAocl^*9}VQ=6SE<=-0}9S zw!1CmB84Y{kj4jX&< zLCsDV?g4P!QT;Z<5CgmVw$)cYh8p0;wRbji+4u>uqh9^l1`8kG{6ws~idnMi Date: Thu, 19 Oct 2017 10:08:59 +0200 Subject: [PATCH 15/26] Fix compilation error --- Riot/AppDelegate.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index d91bc48c2..8701f58fb 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -1098,7 +1098,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } else { - NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload - Unexpected payload %@", dictionaryPayload); + NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload - Unexpected payload %@", payload.dictionaryPayload); } // Handle the local notifications by triggering a background sync. From b8cc3324cdbddd20046052170cd6864fe6ba1220 Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Thu, 19 Oct 2017 16:09:50 +0200 Subject: [PATCH 16/26] PushKit - Enhancement -Don't forget the notifications retrieved during an initial sync in background --- Riot/AppDelegate.m | 225 ++++++++++++++++++++++++--------------------- 1 file changed, 120 insertions(+), 105 deletions(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index b9feae4fe..7615b48a3 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -1101,12 +1101,12 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN NSLog(@"[AppDelegate] didReceiveIncomingPushWithPayload - Unexpected payload %@", payload.dictionaryPayload); } - // Handle the local notifications by triggering a background sync. - [self handleLocalNotifications]; + // Trigger a background sync to handle notifications. + [self launchBackgroundSync]; } } -- (void)handleLocalNotifications +- (void)launchBackgroundSync { // Launch a background sync for all existing matrix sessions NSArray *mxAccounts = [MXKAccountManager sharedManager].activeAccounts; @@ -1115,7 +1115,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // Check the current session state if (account.mxSession.state == MXSessionStatePaused) { - NSLog(@"[AppDelegate] handleLocalNotifications: run a background sync"); + NSLog(@"[AppDelegate] launchBackgroundSync"); __weak typeof(self) weakSelf = self; [account backgroundSync:20000 success:^{ @@ -1127,116 +1127,124 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } typeof(self) self = weakSelf; - NSLog(@"[AppDelegate] handleLocalNotifications: the background sync succeeds"); + NSLog(@"[AppDelegate] launchBackgroundSync: the background sync succeeds"); - // The call invite are handled here only when the callkit is not active. - BOOL isCallKitActive = [MXCallKitAdapter callKitAvailable] && [MXKAppSettings standardAppSettings].isCallKitEnabled; + // Trigger local notifcations + [self handleLocalNotificationsForAccount:account]; - NSMutableArray *eventsArray = eventsToNotify[@(account.mxSession.hash)]; - - // Display a local notification for each event retrieved by the bg sync. - for (NSUInteger index = 0; index < eventsArray.count; index++) - { - NSDictionary *eventDict = eventsArray[index]; - NSString *eventId = eventDict[@"event_id"]; - NSString *roomId = eventDict[@"room_id"]; - BOOL checkReadEvent = YES; - MXEvent *event; - - if (eventId && roomId) - { - event = [account.mxSession.store eventWithEventId:eventId inRoom:roomId]; - } - - if (event) - { - // Ignore redacted event. - if (event.isRedactedEvent) - { - continue; - } - - // Consider here the call invites - if (event.eventType == MXEventTypeCallInvite) - { - // Ignore call invite when callkit is active. - if (isCallKitActive) - { - continue; - } - else - { - // Retrieve the current call state from the call manager - MXCallInviteEventContent *callInviteEventContent = [MXCallInviteEventContent modelFromJSON:event.content]; - MXCall *call = [account.mxSession.callManager callWithCallId:callInviteEventContent.callId]; - - if (call.state <= MXCallStateRinging) - { - // Keep display a local notification even if the event has been read on another device. - checkReadEvent = NO; - } - } - } - - if (checkReadEvent) - { - // Ignore event which has been read on another device. - MXReceiptData *readReceipt = [account.mxSession.store getReceiptInRoom:roomId forUserId:account.mxCredentials.userId]; - if (readReceipt) - { - MXEvent *readReceiptEvent = [account.mxSession.store eventWithEventId:readReceipt.eventId inRoom:roomId]; - if (event.originServerTs <= readReceiptEvent.originServerTs) - { - continue; - } - } - } - - // Prepare the local notification - MXPushRule *rule = eventDict[@"push_rule"]; - - NSString *notificationBody = [self notificationBodyForEvent:event pushRule:rule inAccount:account]; - if (notificationBody) - { - UILocalNotification *eventNotification = [[UILocalNotification alloc] init]; - eventNotification.alertBody = notificationBody; - eventNotification.userInfo = @{ @"room_id" : event.roomId }; - - // Set sound name based on the value provided in action of MXPushRule - for (MXPushRuleAction *action in rule.actions) - { - if (action.actionType == MXPushRuleActionTypeSetTweak) - { - if ([action.parameters[@"set_tweak"] isEqualToString:@"sound"]) - { - NSString *soundName = action.parameters[@"value"]; - if ([soundName isEqualToString:@"default"]) - soundName = UILocalNotificationDefaultSoundName; - - eventNotification.soundName = soundName; - } - } - } - - [[UIApplication sharedApplication] scheduleLocalNotification:eventNotification]; - } - } - } - - [eventsArray removeAllObjects]; - - // Update icon badge number - [UIApplication sharedApplication].applicationIconBadgeNumber = [account.mxSession riot_missedDiscussionsCount]; + // Update app icon badge number + [self refreshApplicationIconBadgeNumber]; } failure:^(NSError *error) { - NSLog(@"[AppDelegate] handleLocalNotifications: the background sync fails"); + NSLog(@"[AppDelegate] launchBackgroundSync: the background sync fails"); }]; } } } +- (void)handleLocalNotificationsForAccount:(MXKAccount*)account +{ + NSLog(@"[AppDelegate] handleLocalNotificationsForAccount: %@", account.mxCredentials.userId); + + // The call invite are handled here only when the callkit is not active. + BOOL isCallKitActive = [MXCallKitAdapter callKitAvailable] && [MXKAppSettings standardAppSettings].isCallKitEnabled; + + NSMutableArray *eventsArray = eventsToNotify[@(account.mxSession.hash)]; + + // Display a local notification for each event retrieved by the bg sync. + for (NSUInteger index = 0; index < eventsArray.count; index++) + { + NSDictionary *eventDict = eventsArray[index]; + NSString *eventId = eventDict[@"event_id"]; + NSString *roomId = eventDict[@"room_id"]; + BOOL checkReadEvent = YES; + MXEvent *event; + + if (eventId && roomId) + { + event = [account.mxSession.store eventWithEventId:eventId inRoom:roomId]; + } + + if (event) + { + // Ignore redacted event. + if (event.isRedactedEvent) + { + continue; + } + + // Consider here the call invites + if (event.eventType == MXEventTypeCallInvite) + { + // Ignore call invite when callkit is active. + if (isCallKitActive) + { + continue; + } + else + { + // Retrieve the current call state from the call manager + MXCallInviteEventContent *callInviteEventContent = [MXCallInviteEventContent modelFromJSON:event.content]; + MXCall *call = [account.mxSession.callManager callWithCallId:callInviteEventContent.callId]; + + if (call.state <= MXCallStateRinging) + { + // Keep display a local notification even if the event has been read on another device. + checkReadEvent = NO; + } + } + } + + if (checkReadEvent) + { + // Ignore event which has been read on another device. + MXReceiptData *readReceipt = [account.mxSession.store getReceiptInRoom:roomId forUserId:account.mxCredentials.userId]; + if (readReceipt) + { + MXEvent *readReceiptEvent = [account.mxSession.store eventWithEventId:readReceipt.eventId inRoom:roomId]; + if (event.originServerTs <= readReceiptEvent.originServerTs) + { + continue; + } + } + } + + // Prepare the local notification + MXPushRule *rule = eventDict[@"push_rule"]; + + NSString *notificationBody = [self notificationBodyForEvent:event pushRule:rule inAccount:account]; + if (notificationBody) + { + UILocalNotification *eventNotification = [[UILocalNotification alloc] init]; + eventNotification.alertBody = notificationBody; + eventNotification.userInfo = @{ @"room_id" : event.roomId }; + + // Set sound name based on the value provided in action of MXPushRule + for (MXPushRuleAction *action in rule.actions) + { + if (action.actionType == MXPushRuleActionTypeSetTweak) + { + if ([action.parameters[@"set_tweak"] isEqualToString:@"sound"]) + { + NSString *soundName = action.parameters[@"value"]; + if ([soundName isEqualToString:@"default"]) + soundName = UILocalNotificationDefaultSoundName; + + eventNotification.soundName = soundName; + } + } + } + + [[UIApplication sharedApplication] scheduleLocalNotification:eventNotification]; + } + } + } + + [eventsArray removeAllObjects]; +} + - (nullable NSString *)notificationBodyForEvent:(MXEvent *)event pushRule:(MXPushRule*)rule inAccount:(MXKAccount*)account { if (!event.content || !event.content.count) @@ -1867,16 +1875,23 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN if (account.mxSession == mxSession) { [account pauseInBackgroundTask]; + + // Trigger local notifcations (Indeed the app finishs here an initial sync in background, the user has missed some notifcations) + [self handleLocalNotificationsForAccount:account]; + + // Update app icon badge number + [self refreshApplicationIconBadgeNumber]; + break; } } } else if (mxSession.state == MXSessionStatePaused) { - // Check whether some local notifications must be handled by triggering a background sync. + // Check whether some push notifications are pending. if (self.incomingPushEventIds.count) { - [self handleLocalNotifications]; + [self launchBackgroundSync]; } } } From 29344430347613f7c914f208a8a868a41ad609be Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Thu, 19 Oct 2017 16:25:59 +0200 Subject: [PATCH 17/26] =?UTF-8?q?Buf=20Fix=20-=20Pushkit=20-=20a=20message?= =?UTF-8?q?=20containing=20=E2=80=9C20%ing=E2=80=9D=20into=20=E2=80=9C20ng?= =?UTF-8?q?=E2=80=9D=20in=20the=20notif?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1594 --- Riot/AppDelegate.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 7615b48a3..fe4fdff91 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -1217,6 +1217,10 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN NSString *notificationBody = [self notificationBodyForEvent:event pushRule:rule inAccount:account]; if (notificationBody) { + // Printf style escape characters are stripped from the string prior to display; + // to include a percent symbol (%) in the message, use two percent symbols (%%). + notificationBody = [notificationBody stringByReplacingOccurrencesOfString:@"%" withString:@"%%"]; + UILocalNotification *eventNotification = [[UILocalNotification alloc] init]; eventNotification.alertBody = notificationBody; eventNotification.userInfo = @{ @"room_id" : event.roomId }; From 6e0750a70b9de6ba264d8727efa6a34f82cb1704 Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Fri, 20 Oct 2017 14:23:08 +0200 Subject: [PATCH 18/26] Add logs to investigate crash on bg sync --- Riot/AppDelegate.m | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index fe4fdff91..6cb0682d9 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -2387,17 +2387,24 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN return; } - // Check whether this event corresponds to a pending push. - NSUInteger index = [self.incomingPushEventIds indexOfObject:event.eventId]; - if (index != NSNotFound) + // Sanity check + if (event.eventId && event.roomId && rule) { - // Remove it from the pending list. - [self.incomingPushEventIds removeObjectAtIndex:index]; + // Check whether this event corresponds to a pending push. + NSUInteger index = [self.incomingPushEventIds indexOfObject:event.eventId]; + if (index != NSNotFound) + { + // Remove it from the pending list. + [self.incomingPushEventIds removeObjectAtIndex:index]; + } + + // Add it to the list of the events to notify. + [eventsToNotify[@(mxSession.hash)] addObject:@{@"event_id": event.eventId, @"room_id": event.roomId, @"push_rule": rule}]; + } + else + { + NSLog(@"WARNING: wrong event to notify %@ %@ %@", event, event.roomId, rule); } - - // Add it to the list of the events to notify. - [eventsToNotify[@(mxSession.hash)] addObject:@{@"event_id": event.eventId, @"room_id": event.roomId, @"push_rule": rule}]; - }; eventsToNotify[@(mxSession.hash)] = [NSMutableArray array]; From cd428b83aa43da91cf7d4e2815bc89e7c23d7c91 Mon Sep 17 00:00:00 2001 From: manuroe Date: Fri, 20 Oct 2017 14:57:51 +0200 Subject: [PATCH 19/26] Logs app extensions to console.log --- Riot/AppDelegate.m | 6 ------ Riot/main.m | 4 ++++ RiotShareExtension/Model/ShareExtensionManager.m | 7 ++++++- SiriIntents/IntentHandler.m | 6 ++++++ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 6cb0682d9..980ef5f1e 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -1760,9 +1760,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN MXSDKOptions *sdkOptions = [MXSDKOptions sharedInstance]; - // Set the App Group identifier. - sdkOptions.applicationGroupIdentifier = @"group.im.vector"; - // Define the media cache version sdkOptions.mediaCacheAppVersion = 0; @@ -1781,9 +1778,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // Get modular widget events in rooms histories [[MXKAppSettings standardAppSettings] addSupportedEventTypes:@[kWidgetEventTypeString]]; - // Use shared container to share data with app extensions - sdkOptions.applicationGroupIdentifier = @"group.im.vector"; - // Disable long press on event in bubble cells [MXKRoomBubbleTableViewCell disableLongPressGestureOnEvent:YES]; diff --git a/Riot/main.m b/Riot/main.m index fe14eabea..e2352ac8a 100644 --- a/Riot/main.m +++ b/Riot/main.m @@ -22,6 +22,10 @@ int main(int argc, char * argv[]) { @autoreleasepool { + // Set the App Group identifier. + MXSDKOptions *sdkOptions = [MXSDKOptions sharedInstance]; + sdkOptions.applicationGroupIdentifier = @"group.im.vector"; + // Redirect NSLogs to files only if we are not debugging if (!isatty(STDERR_FILENO)) { [MXLogger redirectNSLogToFiles:YES]; diff --git a/RiotShareExtension/Model/ShareExtensionManager.m b/RiotShareExtension/Model/ShareExtensionManager.m index 8fb75f3c0..cecdf2b7d 100644 --- a/RiotShareExtension/Model/ShareExtensionManager.m +++ b/RiotShareExtension/Model/ShareExtensionManager.m @@ -73,7 +73,12 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) sdkOptions.disableIdenticonUseForUserAvatar = YES; // Enable e2e encryption for newly created MXSession sdkOptions.enableCryptoWhenStartingMXSession = YES; - + + // NSLog -> console.log file when not debugging the app + if (!isatty(STDERR_FILENO)) + { + [MXLogger redirectNSLogToFiles:YES]; + } }); return sharedInstance; } diff --git a/SiriIntents/IntentHandler.m b/SiriIntents/IntentHandler.m index 5031ac70a..6a9c8a190 100644 --- a/SiriIntents/IntentHandler.m +++ b/SiriIntents/IntentHandler.m @@ -33,6 +33,12 @@ if (self) { [MXSDKOptions sharedInstance].applicationGroupIdentifier = @"group.im.vector"; + + // NSLog -> console.log file when not debugging the app + if (!isatty(STDERR_FILENO)) + { + [MXLogger redirectNSLogToFiles:YES]; + } } return self; } From f9cbfa617e75396ebd416e1e53c2f277aaaedf60 Mon Sep 17 00:00:00 2001 From: manuroe Date: Fri, 20 Oct 2017 15:51:10 +0200 Subject: [PATCH 20/26] Bug Report: Add local and UTC times to the report --- Riot/ViewController/BugReportViewController.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Riot/ViewController/BugReportViewController.m b/Riot/ViewController/BugReportViewController.m index f97c1d96d..92b773613 100644 --- a/Riot/ViewController/BugReportViewController.m +++ b/Riot/ViewController/BugReportViewController.m @@ -302,6 +302,15 @@ userInfo[@"default_app_language"] = [[NSBundle mainBundle] preferredLocalizations][0]; // The language chosen by the OS userInfo[@"app_language"] = [NSBundle mxk_language] ? [NSBundle mxk_language] : userInfo[@"default_app_language"]; // The language chosen by the user + NSDate *currentDate = [NSDate date]; + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; + userInfo[@"local_time"] = [dateFormatter stringFromDate:currentDate]; + + [dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]]; + [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; + userInfo[@"utc_time"] = [dateFormatter stringFromDate:currentDate]; + bugReportRestClient.others = userInfo; // Screenshot From ce19fb8179300ed6694c02350d611a335725bd73 Mon Sep 17 00:00:00 2001 From: manuroe Date: Fri, 20 Oct 2017 15:54:31 +0200 Subject: [PATCH 21/26] Bug Report: Add local and UTC times to the report --- Riot/ViewController/BugReportViewController.m | 1 - 1 file changed, 1 deletion(-) diff --git a/Riot/ViewController/BugReportViewController.m b/Riot/ViewController/BugReportViewController.m index 92b773613..752483165 100644 --- a/Riot/ViewController/BugReportViewController.m +++ b/Riot/ViewController/BugReportViewController.m @@ -308,7 +308,6 @@ userInfo[@"local_time"] = [dateFormatter stringFromDate:currentDate]; [dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]]; - [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; userInfo[@"utc_time"] = [dateFormatter stringFromDate:currentDate]; bugReportRestClient.others = userInfo; From 7f23c127fe86e957b67d2f5897952c3c314a4d29 Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Fri, 20 Oct 2017 16:54:48 +0200 Subject: [PATCH 22/26] Bug Fix - Member Info page avatars are systematically cropped (iOS 11) #1590 --- .../ContactDetailsViewController.h | 1 + .../ContactDetailsViewController.m | 38 ++++++++--------- .../ContactDetailsViewController.xib | 21 ++++++++-- .../RoomMemberDetailsViewController.m | 24 +++++------ .../RoomMemberDetailsViewController.xib | 31 ++++++++------ Riot/Views/RoomMember/RoomMemberTitleView.h | 4 +- Riot/Views/RoomMember/RoomMemberTitleView.m | 2 +- Riot/Views/RoomMember/RoomMemberTitleView.xib | 41 +++++++++---------- 8 files changed, 88 insertions(+), 74 deletions(-) diff --git a/Riot/ViewController/ContactDetailsViewController.h b/Riot/ViewController/ContactDetailsViewController.h index 725f86f27..f00dbe3af 100644 --- a/Riot/ViewController/ContactDetailsViewController.h +++ b/Riot/ViewController/ContactDetailsViewController.h @@ -34,6 +34,7 @@ typedef enum : NSUInteger @property (weak, nonatomic) IBOutlet NSLayoutConstraint *contactAvatarHeaderBackgroundHeightConstraint; @property (weak, nonatomic) IBOutlet UIView *headerView; +@property (weak, nonatomic) IBOutlet MXKImageView *contactAvatar; @property (weak, nonatomic) IBOutlet UIView *contactAvatarMask; @property (weak, nonatomic) IBOutlet UILabel *contactNameLabel; @property (weak, nonatomic) IBOutlet UIView *contactNameLabelMask; diff --git a/Riot/ViewController/ContactDetailsViewController.m b/Riot/ViewController/ContactDetailsViewController.m index 1b69d4a10..e5fc06fc9 100644 --- a/Riot/ViewController/ContactDetailsViewController.m +++ b/Riot/ViewController/ContactDetailsViewController.m @@ -38,7 +38,6 @@ @interface ContactDetailsViewController () { RoomMemberTitleView* contactTitleView; - MXKImageView *contactAvatar; // HTTP Request MXHTTPOperation *roomCreationRequest; @@ -134,9 +133,9 @@ contactTitleView = [RoomMemberTitleView roomMemberTitleView]; contactTitleView.delegate = self; - contactAvatar = contactTitleView.memberAvatar; - contactAvatar.contentMode = UIViewContentModeScaleAspectFill; - contactAvatar.defaultBackgroundColor = [UIColor clearColor]; + + self.contactAvatar.contentMode = UIViewContentModeScaleAspectFill; + self.contactAvatar.defaultBackgroundColor = [UIColor clearColor]; if (@available(iOS 11.0, *)) { @@ -194,17 +193,16 @@ [tap setNumberOfTouchesRequired:1]; [tap setNumberOfTapsRequired:1]; [tap setDelegate:self]; - [contactAvatar addGestureRecognizer:tap]; - contactAvatar.userInteractionEnabled = YES; - - // Need to listen tap gesture on the area part of the avatar image that is outside - // of the navigation bar, its parent but smaller view. + [self.contactAvatarMask addGestureRecognizer:tap]; + self.contactAvatarMask.userInteractionEnabled = YES; + + // Need to listen to the tap gesture in the title view too. tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)]; [tap setNumberOfTouchesRequired:1]; [tap setNumberOfTapsRequired:1]; [tap setDelegate:self]; - [self.contactAvatarMask addGestureRecognizer:tap]; - self.contactAvatarMask.userInteractionEnabled = YES; + [contactTitleView.memberAvatarMask addGestureRecognizer:tap]; + contactTitleView.memberAvatarMask.userInteractionEnabled = YES; // Register collection view cell class [self.tableView registerClass:TableViewCellWithButton.class forCellReuseIdentifier:[TableViewCellWithButton defaultReuseIdentifier]]; @@ -368,10 +366,10 @@ { // Adjust the header height by taking into account the actual position of the member avatar in title view // This position depends automatically on the screen orientation. - CGRect memberAvatarFrame = contactTitleView.memberAvatar.frame; - CGPoint memberAvatarActualPosition = [contactTitleView convertPoint:memberAvatarFrame.origin toView:self.view]; + CGPoint memberAvatarOriginInTitleView = contactTitleView.memberAvatarMask.frame.origin; + CGPoint memberAvatarActualPosition = [contactTitleView convertPoint:memberAvatarOriginInTitleView toView:self.view]; - CGFloat avatarHeaderHeight = memberAvatarActualPosition.y + memberAvatarFrame.size.height; + CGFloat avatarHeaderHeight = memberAvatarActualPosition.y + self.contactAvatar.frame.size.height; if (_contactAvatarHeaderBackgroundHeightConstraint.constant != avatarHeaderHeight) { _contactAvatarHeaderBackgroundHeightConstraint.constant = avatarHeaderHeight; @@ -496,7 +494,7 @@ - (void)refreshContactThumbnail { - UIImage* image = [_contact thumbnailWithPreferedSize:contactAvatar.frame.size]; + UIImage* image = [_contact thumbnailWithPreferedSize:self.contactAvatar.frame.size]; if (!image) { @@ -512,9 +510,9 @@ } } - contactAvatar.image = image; - [contactAvatar.layer setCornerRadius:contactAvatar.frame.size.width / 2]; - [contactAvatar setClipsToBounds:YES]; + self.contactAvatar.image = image; + [self.contactAvatar.layer setCornerRadius:self.contactAvatar.frame.size.width / 2]; + [self.contactAvatar setClipsToBounds:YES]; } - (void)refreshContactDisplayName @@ -1148,7 +1146,7 @@ self.contactNameLabel.text = _contact.displayName; } } - else if (view == contactAvatar || view == self.contactAvatarMask) + else if (view == contactTitleView.memberAvatarMask || view == self.contactAvatarMask) { // Show the avatar in full screen __block MXKImageView * avatarFullScreenView = [[MXKImageView alloc] initWithFrame:CGRectZero]; @@ -1177,7 +1175,7 @@ [avatarFullScreenView setImageURL:avatarURL withType:nil andImageOrientation:UIImageOrientationUp - previewImage:contactAvatar.image]; + previewImage:self.contactAvatar.image]; [avatarFullScreenView showFullScreen]; isStatusBarHidden = YES; diff --git a/Riot/ViewController/ContactDetailsViewController.xib b/Riot/ViewController/ContactDetailsViewController.xib index 1cc0340ff..84470cb2e 100644 --- a/Riot/ViewController/ContactDetailsViewController.xib +++ b/Riot/ViewController/ContactDetailsViewController.xib @@ -1,17 +1,19 @@ - - + + - + + + @@ -41,10 +43,23 @@ + + + + + + + + + + + + +