diff --git a/CHANGES.rst b/CHANGES.rst index 389cf8503..99aa02d3e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,9 @@ +Changes in 0.3.6 (2016-12-23) +=============================================== + +Improvements: + * Add descriptions for access permissions to Camera, Microphone, Photo Gallery and Contacts. + Changes in 0.3.5 (2016-12-19) =============================================== diff --git a/Podfile b/Podfile index 899d07026..08419c646 100644 --- a/Podfile +++ b/Podfile @@ -8,7 +8,7 @@ target "Vector" do # Different flavours of pods to MatrixKit # The tagged version on which this version of Vector has been built -pod 'MatrixKit', '0.4.3' +pod 'MatrixKit', '0.4.4' # The lastest release available on the CocoaPods repository #pod 'MatrixKit' diff --git a/Podfile.lock b/Podfile.lock index f4dc90ec6..345db3240 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -31,59 +31,54 @@ PODS: - DTFoundation/Core - DTFoundation/UIKit (1.7.11): - DTFoundation/Core - - GBDeviceInfo (4.1.0): - - GBDeviceInfo/Core (= 4.1.0) - - GBDeviceInfo/Core (4.1.0) + - GBDeviceInfo (4.2.2): + - GBDeviceInfo/Core (= 4.2.2) + - GBDeviceInfo/Core (4.2.2) - GHMarkdownParser (0.1.2) - GoogleAnalytics (3.17.0) - HPGrowingTextView (1.1) - libPhoneNumber-iOS (0.8.17) - - MatrixKit (0.4.3): + - MatrixKit (0.4.4): - DTCoreText (~> 1.6.17) - GHMarkdownParser (~> 0.1.2) - HPGrowingTextView (~> 1.1) - libPhoneNumber-iOS (~> 0.8.14) - - MatrixSDK (= 0.7.3) - - MatrixSDK (0.7.3): + - MatrixSDK (= 0.7.4) + - MatrixSDK (0.7.4): - AFNetworking (~> 3.1.0) - - OLMKit (2.0.1): - - OLMKit/olmc (= 2.0.1) - - OLMKit/olmcpp (= 2.0.1) - - OLMKit/olmc (2.0.1) - - OLMKit/olmcpp (2.0.1) + - OLMKit (2.1.0): + - OLMKit/olmc (= 2.1.0) + - OLMKit/olmcpp (= 2.1.0) + - OLMKit/olmc (2.1.0) + - OLMKit/olmcpp (2.1.0) + - Realm (2.1.2): + - Realm/Headers (= 2.1.2) + - Realm/Headers (2.1.2) - WebRTC (54.6.13869) DEPENDENCIES: - - GBDeviceInfo (~> 4.1.0) + - GBDeviceInfo (~> 4.2.2) - GoogleAnalytics - - MatrixKit (= 0.4.3) - - OLMKit (from `https://matrix.org/git/olm.git`, branch `olmkit`) + - MatrixKit (= 0.4.4) + - OLMKit + - Realm (~> 2.1.1) - WebRTC (= 54.6.13869) -EXTERNAL SOURCES: - OLMKit: - :branch: olmkit - :git: https://matrix.org/git/olm.git - -CHECKOUT OPTIONS: - OLMKit: - :commit: 0b1ecbff2d31b94046834358b851c369ad36ee88 - :git: https://matrix.org/git/olm.git - SPEC CHECKSUMS: AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 DTCoreText: 184cc2f460c2177108e8700dfb0eb1b1cb72c99d DTFoundation: 0ef29c70a9814e15518694862bd739347abe2a50 - GBDeviceInfo: e50df975a95e21faec93e2bf98376846fe17d307 + GBDeviceInfo: 0a6e2fc04989ce248572bb988f1a764102eb0e5d GHMarkdownParser: 14cbf59d0ab9450017d843dffd4a3ef691e5bd77 GoogleAnalytics: f42cc53a87a51fe94334821868d9c8481ff47a7b HPGrowingTextView: 88a716d97fb853bcb08a4a08e4727da17efc9b19 libPhoneNumber-iOS: 9f083847f8cb9b81064cff2ed2c98cbf18d9f9f2 - MatrixKit: c3b7c5457dcb8cdf83320de1b46ef095ea2379ae - MatrixSDK: 6d4dae31b820fd19b0ed5fb8b6dec907e65d3fba - OLMKit: ce34b0192fba8006f122f926b4a669697746772b + MatrixKit: b1f92b21d36761ab605f1c917aad3f10a3f3f110 + MatrixSDK: 976151c80f9eab8e6fd17ebdd7b453f2525c3db1 + OLMKit: ad0807fc53e7ec6eb83651112e277f8221ce783a + Realm: efe855f4d977c8ce5a82d3116d9f1ff155a6550c WebRTC: 9f23349248fd2e94a14cb4552bae6e591bb2fe28 -PODFILE CHECKSUM: 5a8f8c17e49cb8b3464ecd7e71ff1d31fdd39e1d +PODFILE CHECKSUM: c1efd5373652b682890a25ad741d7ab65db9e761 COCOAPODS: 1.1.1 diff --git a/Vector.xcodeproj/project.pbxproj b/Vector.xcodeproj/project.pbxproj index 5a6ffd236..18ab0c7f2 100644 --- a/Vector.xcodeproj/project.pbxproj +++ b/Vector.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 322574E51D86E0C1009181D3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 322574E41D86E0C1009181D3 /* InfoPlist.strings */; }; 3235CD851C341FAA0084EA40 /* HomeMessagesSearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3235CD841C341FAA0084EA40 /* HomeMessagesSearchViewController.m */; }; 323A520B1C3183CC00010773 /* UIViewController+VectorSearch.m in Sources */ = {isa = PBXBuildFile; fileRef = 323A520A1C3183CC00010773 /* UIViewController+VectorSearch.m */; }; 32492DB21C293C8900035C79 /* PublicRoomTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 32492DB11C293C8900035C79 /* PublicRoomTableViewCell.m */; }; @@ -25,6 +24,7 @@ 32C52BF91CBFF50C00863B33 /* RoomPreviewData.m in Sources */ = {isa = PBXBuildFile; fileRef = 32C52BF81CBFF50C00863B33 /* RoomPreviewData.m */; }; 32D200881C16C2B100A4E396 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D200871C16C2B100A4E396 /* HomeViewController.m */; }; 32F2E61B1C230D4D003BDEA5 /* PublicRoomsDirectoryDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 32F2E61A1C230D4D003BDEA5 /* PublicRoomsDirectoryDataSource.m */; }; + 55A8E59C1E23D01000B59231 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 55A8E59E1E23D01000B59231 /* InfoPlist.strings */; }; 71046D5E1C0C639300DCA984 /* RoomTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71046D5D1C0C639300DCA984 /* RoomTitleView.m */; }; 71046D601C0C86C600DCA984 /* RoomTitleView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 71046D5F1C0C86C600DCA984 /* RoomTitleView.xib */; }; 71352D591C10569F001D50B0 /* AvatarGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 71352D581C10569F001D50B0 /* AvatarGenerator.m */; }; @@ -210,6 +210,9 @@ F047DBB51C576F2200952DA2 /* AuthenticationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F047DBB41C576F2200952DA2 /* AuthenticationViewController.xib */; }; F047DBB91C576F6600952DA2 /* AuthInputsView.m in Sources */ = {isa = PBXBuildFile; fileRef = F047DBB71C576F6600952DA2 /* AuthInputsView.m */; }; F047DBBA1C576F6600952DA2 /* AuthInputsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F047DBB81C576F6600952DA2 /* AuthInputsView.xib */; }; + F04ACE031E154C540000B970 /* riot_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = F04ACE001E154C540000B970 /* riot_icon.png */; }; + F04ACE041E154C540000B970 /* riot_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F04ACE011E154C540000B970 /* riot_icon@2x.png */; }; + F04ACE051E154C540000B970 /* riot_icon@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F04ACE021E154C540000B970 /* riot_icon@3x.png */; }; F056417B1C7C9FD7002276ED /* TableViewCellWithButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F05641791C7C9FD7002276ED /* TableViewCellWithButton.m */; }; F056417C1C7C9FD7002276ED /* TableViewCellWithButton.xib in Resources */ = {isa = PBXBuildFile; fileRef = F056417A1C7C9FD7002276ED /* TableViewCellWithButton.xib */; }; F05895001B8B7E6600B73E85 /* RoomBubbleCellData.m in Sources */ = {isa = PBXBuildFile; fileRef = F05894FF1B8B7E6600B73E85 /* RoomBubbleCellData.m */; }; @@ -401,7 +404,6 @@ /* Begin PBXFileReference section */ 11865E69C29698A4179E1F3F /* Pods-Vector.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Vector.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Vector/Pods-Vector.debug.xcconfig"; sourceTree = ""; }; - 322574E41D86E0C1009181D3 /* InfoPlist.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = InfoPlist.strings; sourceTree = ""; }; 3235CD831C341FAA0084EA40 /* HomeMessagesSearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeMessagesSearchViewController.h; sourceTree = ""; }; 3235CD841C341FAA0084EA40 /* HomeMessagesSearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeMessagesSearchViewController.m; sourceTree = ""; }; 323A52091C3183CC00010773 /* UIViewController+VectorSearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+VectorSearch.h"; sourceTree = ""; }; @@ -434,6 +436,7 @@ 32F2E6191C230D4D003BDEA5 /* PublicRoomsDirectoryDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PublicRoomsDirectoryDataSource.h; sourceTree = ""; }; 32F2E61A1C230D4D003BDEA5 /* PublicRoomsDirectoryDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PublicRoomsDirectoryDataSource.m; sourceTree = ""; }; 435C7E1A9BC3DE28D526540F /* Pods-Vector.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Vector.release.xcconfig"; path = "Pods/Target Support Files/Pods-Vector/Pods-Vector.release.xcconfig"; sourceTree = ""; }; + 55A8E5A11E23D84C00B59231 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 71046D5C1C0C639300DCA984 /* RoomTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RoomTitleView.h; path = RoomTitle/RoomTitleView.h; sourceTree = ""; }; 71046D5D1C0C639300DCA984 /* RoomTitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RoomTitleView.m; path = RoomTitle/RoomTitleView.m; sourceTree = ""; }; 71046D5F1C0C86C600DCA984 /* RoomTitleView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = RoomTitleView.xib; path = RoomTitle/RoomTitleView.xib; sourceTree = ""; }; @@ -642,6 +645,9 @@ F047DBB61C576F6600952DA2 /* AuthInputsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthInputsView.h; sourceTree = ""; }; F047DBB71C576F6600952DA2 /* AuthInputsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthInputsView.m; sourceTree = ""; }; F047DBB81C576F6600952DA2 /* AuthInputsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AuthInputsView.xib; sourceTree = ""; }; + F04ACE001E154C540000B970 /* riot_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = riot_icon.png; sourceTree = ""; }; + F04ACE011E154C540000B970 /* riot_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "riot_icon@2x.png"; sourceTree = ""; }; + F04ACE021E154C540000B970 /* riot_icon@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "riot_icon@3x.png"; sourceTree = ""; }; F05641781C7C9FD7002276ED /* TableViewCellWithButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TableViewCellWithButton.h; path = TableViewCell/TableViewCellWithButton.h; sourceTree = ""; }; F05641791C7C9FD7002276ED /* TableViewCellWithButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TableViewCellWithButton.m; path = TableViewCell/TableViewCellWithButton.m; sourceTree = ""; }; F056417A1C7C9FD7002276ED /* TableViewCellWithButton.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = TableViewCellWithButton.xib; path = TableViewCell/TableViewCellWithButton.xib; sourceTree = ""; }; @@ -1138,6 +1144,9 @@ F03BF5B41D8BF5B1002EF6A7 /* Images */ = { isa = PBXGroup; children = ( + F04ACE001E154C540000B970 /* riot_icon.png */, + F04ACE011E154C540000B970 /* riot_icon@2x.png */, + F04ACE021E154C540000B970 /* riot_icon@3x.png */, F0A4B2EB1E0073A30072D355 /* animatedLogo-0.png */, F0A4B2EC1E0073A30072D355 /* animatedLogo-1.png */, F0A4B2ED1E0073A30072D355 /* animatedLogo-2.png */, @@ -1487,7 +1496,7 @@ F0C47EFE1D7766F200A7929E /* Sounds */, F094AA0B1B78E42600B1FBBF /* Localizable.strings */, F094AA0D1B78E42600B1FBBF /* Vector.strings */, - 322574E41D86E0C1009181D3 /* InfoPlist.strings */, + 55A8E59E1E23D01000B59231 /* InfoPlist.strings */, ); path = Assets; sourceTree = ""; @@ -1743,11 +1752,17 @@ TargetAttributes = { F094A9A11B78D8F000B1FBBF = { CreatedOnToolsVersion = 6.2; - ProvisioningStyle = Manual; + DevelopmentTeam = 7J4U792NQT; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Push = { + enabled = 1; + }; + }; }; F094A9BD1B78D8F000B1FBBF = { CreatedOnToolsVersion = 6.2; - DevelopmentTeam = 884E442RN2; + DevelopmentTeam = 7J4U792NQT; TestTargetID = F094A9A11B78D8F000B1FBBF; }; }; @@ -1815,6 +1830,7 @@ F0A4B2F11E0073A30072D355 /* animatedLogo-1.png in Resources */, F03BF6B41D8BF5B1002EF6A7 /* priorityLow@2x.png in Resources */, F08294691DB503FE00CEAB63 /* direct_icon@2x.png in Resources */, + F04ACE041E154C540000B970 /* riot_icon@2x.png in Resources */, F09EAFA01DD2109B009C7EFB /* RoomIncomingEncryptedTextMsgWithoutSenderInfoBubbleCell.xib in Resources */, F09EAF0B1DCCEE1D009C7EFB /* e2e_verified@3x.png in Resources */, F03BF6971D8BF5B1002EF6A7 /* leave@3x.png in Resources */, @@ -1858,7 +1874,7 @@ F023A0111D9034FE00C517FB /* call_audio_mute_on_icon@2x.png in Resources */, F08714D91DC384810075F633 /* start_chat@2x.png in Resources */, F09EAFB01DD2109B009C7EFB /* RoomOutgoingEncryptedTextMsgWithoutSenderInfoBubbleCell.xib in Resources */, - 322574E51D86E0C1009181D3 /* InfoPlist.strings in Resources */, + 55A8E59C1E23D01000B59231 /* InfoPlist.strings in Resources */, F083C4931D9EAFC500E5246C /* file_photo_icon.png in Resources */, F03BF6C51D8BF5B1002EF6A7 /* selection_tick.png in Resources */, F03BF64A1D8BF5B1002EF6A7 /* admin_icon@2x.png in Resources */, @@ -1942,6 +1958,7 @@ F09EAFA61DD2109B009C7EFB /* RoomIncomingEncryptedTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.xib in Resources */, 325F6A431C21D20F00C12F51 /* DirectoryRecentTableViewCell.xib in Resources */, F03BF68C1D8BF5B1002EF6A7 /* favouriteOff.png in Resources */, + F04ACE031E154C540000B970 /* riot_icon.png in Resources */, F003AA7C1C68A1F6008B430C /* ExpandedRoomTitleView.xib in Resources */, F03BF6751D8BF5B1002EF6A7 /* camera_switch@3x.png in Resources */, F03BF6D01D8BF5B1002EF6A7 /* shrink_icon@3x.png in Resources */, @@ -2006,6 +2023,7 @@ F0CC4DCB1C4E594C003BBE45 /* MediaAlbumContentViewController.xib in Resources */, F0C34B721C15CA2E00C36F09 /* RoomOutgoingTextMsgWithPaginationTitleBubbleCell.xib in Resources */, F022285E1C64E356000AF23C /* RoomViewController.xib in Resources */, + F04ACE051E154C540000B970 /* riot_icon@3x.png in Resources */, F03BF6BF1D8BF5B1002EF6A7 /* search_bg.png in Resources */, F03BF69B1D8BF5B1002EF6A7 /* main_alias_icon.png in Resources */, F0A4B2F31E0073A30072D355 /* animatedLogo-3.png in Resources */, @@ -2241,6 +2259,14 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 55A8E59E1E23D01000B59231 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 55A8E5A11E23D84C00B59231 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; F094A9B21B78D8F000B1FBBF /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -2367,7 +2393,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Vector/Vector.entitlements; - DEVELOPMENT_TEAM = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = 7J4U792NQT; ENABLE_BITCODE = NO; INFOPLIST_FILE = Vector/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -2384,8 +2411,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Vector/Vector.entitlements; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 7J4U792NQT; ENABLE_BITCODE = NO; INFOPLIST_FILE = Vector/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -2400,7 +2426,7 @@ isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = 884E442RN2; + DEVELOPMENT_TEAM = 7J4U792NQT; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -2421,7 +2447,7 @@ isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = 884E442RN2; + DEVELOPMENT_TEAM = 7J4U792NQT; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", diff --git a/Vector/AppDelegate.m b/Vector/AppDelegate.m index 163257061..0b813b4aa 100644 --- a/Vector/AppDelegate.m +++ b/Vector/AppDelegate.m @@ -41,9 +41,6 @@ #import "CallViewController.h" -// Uncomment the following line to use local contacts to discover matrix users. -//#define MX_USE_CONTACTS_SERVER_SYNC - //#define MX_CALL_STACK_OPENWEBRTC #ifdef MX_CALL_STACK_OPENWEBRTC #import @@ -322,7 +319,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN [self startGoogleAnalytics]; // Configure local contacts management - [MXKContactManager sharedManager].enableFullMatrixIdSyncOnLocalContactsDidLoad = NO; + [MXKContactManager sharedManager].enableFullMatrixIdSyncOnLocalContactsDidLoad = YES; // Add matrix observers, and initialize matrix sessions if the app is not launched in background. [self initMatrixSessions]; @@ -489,9 +486,35 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN [account resume]; } - // Check if the application is allowed to access the local contacts + // Check whether the application is allowed to access the local contacts. if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized) { + // Check the user permission for syncing local contacts. This permission was handled independently on previous application version. + if (![MXKAppSettings standardAppSettings].syncLocalContacts) + { + // Check whether it was not requested yet. + if (![MXKAppSettings standardAppSettings].syncLocalContactsPermissionRequested) + { + [MXKAppSettings standardAppSettings].syncLocalContactsPermissionRequested = YES; + + UIViewController *viewController = self.window.rootViewController.presentedViewController; + if (!viewController) + { + viewController = self.window.rootViewController; + } + + [MXKContactManager requestUserConfirmationForLocalContactsSyncInViewController:viewController completionHandler:^(BOOL granted) { + + if (granted) + { + // Allow local contacts sync in order to discover matrix users. + [MXKAppSettings standardAppSettings].syncLocalContacts = YES; + } + + }]; + } + } + // Refresh the local contacts list by reloading it [[MXKContactManager sharedManager] loadLocalContacts]; } diff --git a/Vector/Assets/Images/riot_icon.png b/Vector/Assets/Images/riot_icon.png new file mode 100755 index 000000000..373a12638 Binary files /dev/null and b/Vector/Assets/Images/riot_icon.png differ diff --git a/Vector/Assets/Images/riot_icon@2x.png b/Vector/Assets/Images/riot_icon@2x.png new file mode 100755 index 000000000..84691d7b4 Binary files /dev/null and b/Vector/Assets/Images/riot_icon@2x.png differ diff --git a/Vector/Assets/Images/riot_icon@3x.png b/Vector/Assets/Images/riot_icon@3x.png new file mode 100755 index 000000000..d84b0b5f2 Binary files /dev/null and b/Vector/Assets/Images/riot_icon@3x.png differ diff --git a/Vector/Assets/InfoPlist.strings b/Vector/Assets/en.lproj/InfoPlist.strings similarity index 60% rename from Vector/Assets/InfoPlist.strings rename to Vector/Assets/en.lproj/InfoPlist.strings index 9625bbddd..9e2639cea 100644 --- a/Vector/Assets/InfoPlist.strings +++ b/Vector/Assets/en.lproj/InfoPlist.strings @@ -15,11 +15,8 @@ */ // Permissions usage explanations -// The usage of the camera is explicit. No need of explanation. -"NSCameraUsageDescription" = ""; -"NSPhotoLibraryUsageDescription" = ""; -"NSMicrophoneUsageDescription" = ""; - -// We show a popup before accessing Contacts explaining why. No need of more explanation. -"NSContactsUsageDescription" = ""; +"NSCameraUsageDescription" = "The camera is used to take photos and videos, make video calls."; +"NSPhotoLibraryUsageDescription" = "The photo library is used to send photos and videos."; +"NSMicrophoneUsageDescription" = "The microphone is used to take videos, make calls."; +"NSContactsUsageDescription" = "The contact book is used to search for users by email or phone number on Riot."; diff --git a/Vector/Assets/en.lproj/Vector.strings b/Vector/Assets/en.lproj/Vector.strings index f8d18d62c..8e4019ecb 100644 --- a/Vector/Assets/en.lproj/Vector.strings +++ b/Vector/Assets/en.lproj/Vector.strings @@ -134,6 +134,8 @@ "room_participants_invite_malformed_id_title" = "Invite Error"; "room_participants_invite_malformed_id" = "Malformed ID. Should be an email address or a Matrix ID like '@localpart:domain'"; +"room_participants_address_book_section" = "CONTACT BOOK"; +"room_participants_matrix_users_section" = "ROOM CONTACTS"; "room_participants_invited_section" = "INVITED"; "room_participants_online" = "Online"; diff --git a/Vector/Base.lproj/LaunchScreen.xib b/Vector/Base.lproj/LaunchScreen.xib index 0dfa0f760..87d6a5695 100644 --- a/Vector/Base.lproj/LaunchScreen.xib +++ b/Vector/Base.lproj/LaunchScreen.xib @@ -1,9 +1,13 @@ - + + + + - + + @@ -20,7 +24,7 @@ - + diff --git a/Vector/Base.lproj/Main.storyboard b/Vector/Base.lproj/Main.storyboard index ef057b833..4ea93168c 100644 --- a/Vector/Base.lproj/Main.storyboard +++ b/Vector/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -27,9 +31,9 @@ - + - + @@ -54,14 +58,14 @@ - + - + - + @@ -70,19 +74,21 @@ - + - + + + - + @@ -93,9 +99,9 @@ - + - + @@ -122,9 +128,9 @@ - + - + @@ -140,11 +146,11 @@ - + - + @@ -152,7 +158,7 @@ - + @@ -192,14 +198,14 @@ - + - + - + @@ -210,9 +216,9 @@ - + - + @@ -245,9 +251,9 @@ - + - + @@ -296,9 +302,9 @@ - + - + @@ -313,6 +319,7 @@ - + + diff --git a/Vector/Images.xcassets/AppIcon.appiconset/Contents.json b/Vector/Images.xcassets/AppIcon.appiconset/Contents.json index 07f4215a9..dee3b58f5 100644 --- a/Vector/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Vector/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "size" : "29x29", "idiom" : "iphone", @@ -36,6 +46,16 @@ "filename" : "Icon-60@3x.png", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "size" : "29x29", "idiom" : "ipad", diff --git a/Vector/Info.plist b/Vector/Info.plist index 4e1167fee..cac4e73e6 100644 --- a/Vector/Info.plist +++ b/Vector/Info.plist @@ -17,11 +17,15 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.3.4 + 0.3.6 CFBundleSignature ???? CFBundleVersion - 0.3.4 + 0.3.6 + ITSAppUsesNonExemptEncryption + + ITSEncryptionExportComplianceCode + d1dd539c-d21c-43e2-92e2-212c5269565c LSRequiresIPhoneOS NSAppTransportSecurity @@ -37,9 +41,14 @@ - ITSAppUsesNonExemptEncryption - ITSEncryptionExportComplianceCode - d1dd539c-d21c-43e2-92e2-212c5269565c + NSCameraUsageDescription + The camera is used to take photos and videos, make video calls. + NSPhotoLibraryUsageDescription + The photo library is used to send photos and videos. + NSMicrophoneUsageDescription + The microphone is used to take videos, make calls. + NSContactsUsageDescription + The contact book is used to send room invitation to your contacts with their emails. UIBackgroundModes audio diff --git a/Vector/Vector.entitlements b/Vector/Vector.entitlements index 215325514..4cbad96a1 100644 --- a/Vector/Vector.entitlements +++ b/Vector/Vector.entitlements @@ -2,6 +2,8 @@ + aps-environment + development com.apple.developer.associated-domains applinks:www.vector.im diff --git a/Vector/ViewController/AttachmentsViewController.m b/Vector/ViewController/AttachmentsViewController.m index 4a59af3b1..c69d491d5 100644 --- a/Vector/ViewController/AttachmentsViewController.m +++ b/Vector/ViewController/AttachmentsViewController.m @@ -26,10 +26,9 @@ #pragma mark - -- (void)viewDidLoad +- (void)finalizeInit { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. + [super finalizeInit]; // Setup `MXKViewControllerHandling` properties self.defaultBarTintColor = kVectorNavBarTintColor; @@ -37,6 +36,12 @@ self.rageShakeManager = [RageShakeManager sharedManager]; } +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; diff --git a/Vector/ViewController/AuthenticationViewController.m b/Vector/ViewController/AuthenticationViewController.m index 9e69abde1..df18a787b 100644 --- a/Vector/ViewController/AuthenticationViewController.m +++ b/Vector/ViewController/AuthenticationViewController.m @@ -52,14 +52,19 @@ #pragma mark - -- (void)viewDidLoad +- (void)finalizeInit { - [super viewDidLoad]; + [super finalizeInit]; // Setup `MXKViewControllerHandling` properties self.defaultBarTintColor = kVectorNavBarTintColor; self.enableBarTintColorStatusChange = NO; self.rageShakeManager = [RageShakeManager sharedManager]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; self.mainNavigationItem.title = nil; self.rightBarButtonItem.title = NSLocalizedStringFromTable(@"auth_register", @"Vector", nil); diff --git a/Vector/ViewController/AuthenticationViewController.xib b/Vector/ViewController/AuthenticationViewController.xib index 32c78bd84..1fb4c517c 100644 --- a/Vector/ViewController/AuthenticationViewController.xib +++ b/Vector/ViewController/AuthenticationViewController.xib @@ -1,8 +1,12 @@ - + + + + - + + @@ -42,15 +46,15 @@ - + - + - + @@ -62,14 +66,14 @@ - - + + - + @@ -90,7 +94,7 @@ - + @@ -133,7 +137,7 @@ - + @@ -145,15 +149,15 @@ - - + + - + @@ -359,7 +363,7 @@ - + diff --git a/Vector/ViewController/CallViewController.m b/Vector/ViewController/CallViewController.m index e73367cb5..a7ed83d30 100644 --- a/Vector/ViewController/CallViewController.m +++ b/Vector/ViewController/CallViewController.m @@ -18,6 +18,8 @@ #import "AppDelegate.h" +#import "RageShakeManager.h" + #import "AvatarGenerator.h" #import "VectorDesignValues.h" @@ -64,6 +66,16 @@ #pragma mark - +- (void)finalizeInit +{ + [super finalizeInit]; + + // Setup `MXKViewControllerHandling` properties + self.defaultBarTintColor = kVectorNavBarTintColor; + self.enableBarTintColorStatusChange = NO; + self.rageShakeManager = [RageShakeManager sharedManager]; +} + - (void)viewDidLoad { [super viewDidLoad]; diff --git a/Vector/ViewController/CallViewController.xib b/Vector/ViewController/CallViewController.xib index cf1e7031c..6d92f2073 100644 --- a/Vector/ViewController/CallViewController.xib +++ b/Vector/ViewController/CallViewController.xib @@ -1,10 +1,14 @@ - - + + + + + - + + @@ -38,90 +42,94 @@ - + - - + + - - + + - + - + - + @@ -190,22 +198,22 @@ - + - + @@ -218,48 +226,48 @@ - + @@ -274,7 +282,7 @@ - + diff --git a/Vector/ViewController/ContactDetailsViewController.m b/Vector/ViewController/ContactDetailsViewController.m index da45d78a9..2e6b3a5ae 100644 --- a/Vector/ViewController/ContactDetailsViewController.m +++ b/Vector/ViewController/ContactDetailsViewController.m @@ -98,6 +98,16 @@ #pragma mark - +- (void)finalizeInit +{ + [super finalizeInit]; + + // Setup `MXKViewControllerHandling` properties + self.defaultBarTintColor = kVectorNavBarTintColor; + self.enableBarTintColorStatusChange = NO; + self.rageShakeManager = [RageShakeManager sharedManager]; +} + - (void)viewDidLoad { [super viewDidLoad]; @@ -113,11 +123,6 @@ actionsArray = [[NSMutableArray alloc] init]; directChatsArray = [[NSMutableArray alloc] init]; - // Setup `MXKViewControllerHandling` properties - self.defaultBarTintColor = kVectorNavBarTintColor; - self.enableBarTintColorStatusChange = NO; - self.rageShakeManager = [RageShakeManager sharedManager]; - self.headerView.backgroundColor = kVectorColorLightGrey; self.contactNameLabel.textColor = kVectorTextColorBlack; self.contactStatusLabel.textColor = kVectorColorGreen; @@ -557,7 +562,7 @@ directChatsIndex = sectionCount++; } // Else check whether the contact has been instantiated with an email or a matrix id - else if ([MXTools isEmailAddress:_contact.displayName]) + else if ((!_contact.isMatrixContact && _contact.emailAddresses.count) || [MXTools isEmailAddress:_contact.displayName]) { directChatsIndex = sectionCount++; } @@ -873,7 +878,20 @@ // Prepare the invited participant data NSArray *inviteArray; NSArray *invite3PIDArray; - NSString *participantId = _contact.displayName; + NSString *participantId; + + if (_contact.emailAddresses.count) + { + // This is a local contact, consider the first email by default. + // TODO: Prompt the user to select the right email. + MXKEmail *email = _contact.emailAddresses.firstObject; + participantId = email.emailAddress; + } + else + { + // This is the text filled by the user. + participantId = _contact.displayName; + } // Is it an email or a Matrix user ID? if ([MXTools isEmailAddress:participantId]) @@ -903,7 +921,7 @@ invite3PIDArray = @[invite3PID]; } - else + else //if ([MXTools isMatrixUserIdentifier:participantId]) { inviteArray = @[participantId]; } diff --git a/Vector/ViewController/ContactDetailsViewController.xib b/Vector/ViewController/ContactDetailsViewController.xib index c8379f981..66f94574c 100644 --- a/Vector/ViewController/ContactDetailsViewController.xib +++ b/Vector/ViewController/ContactDetailsViewController.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -21,53 +25,53 @@ - + - + - - + + - - + + - - + + - + @@ -90,21 +94,21 @@ - + - - + + - + diff --git a/Vector/ViewController/ContactPickerViewController.m b/Vector/ViewController/ContactPickerViewController.m index c298b8054..e9c54a2eb 100644 --- a/Vector/ViewController/ContactPickerViewController.m +++ b/Vector/ViewController/ContactPickerViewController.m @@ -60,6 +60,16 @@ #pragma mark - +- (void)finalizeInit +{ + [super finalizeInit]; + + // Setup `MXKViewControllerHandling` properties + self.defaultBarTintColor = kVectorNavBarTintColor; + self.enableBarTintColorStatusChange = NO; + self.rageShakeManager = [RageShakeManager sharedManager]; +} + - (void)viewDidLoad { [super viewDidLoad]; @@ -70,11 +80,6 @@ // Instantiate view controller objects [[[self class] nib] instantiateWithOwner:self options:nil]; } - - // Setup `MXKViewControllerHandling` properties - self.defaultBarTintColor = kVectorNavBarTintColor; - self.enableBarTintColorStatusChange = NO; - self.rageShakeManager = [RageShakeManager sharedManager]; [self.contactsTableView registerNib:ContactTableViewCell.nib forCellReuseIdentifier:ContactTableViewCell.defaultReuseIdentifier]; @@ -109,36 +114,14 @@ [self refreshContactsList]; - // Handle here local contacts -#ifdef MX_USE_CONTACTS_SERVER_SYNC - if (![MXKAppSettings standardAppSettings].syncLocalContacts) - { - // If not requested yet, ask user permission to sync their local contacts - if (![MXKAppSettings standardAppSettings].syncLocalContacts && ![MXKAppSettings standardAppSettings].syncLocalContactsPermissionRequested) - { - [MXKAppSettings standardAppSettings].syncLocalContactsPermissionRequested = YES; - - [MXKContactManager requestUserConfirmationForLocalContactsSyncInViewController:self completionHandler:^(BOOL granted) { - if (granted) - { - // Allow local contacts sync in order to add address book emails in search result - [MXKAppSettings standardAppSettings].syncLocalContacts = YES; - } - }]; - } - } -#else - // If not requested yet, ask user permission to access their local contacts + // Check whether the access to the local contacts has not been already asked. if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) { - // Try to load the local contacts list - dispatch_async(dispatch_get_main_queue(), ^{ - - [[MXKContactManager sharedManager] loadLocalContacts]; - - }); + // Allow by default the local contacts sync in order to discover matrix users. + // This setting change will trigger the loading of the local contacts, which will automatically + // ask user permission to access their local contacts. + [MXKAppSettings standardAppSettings].syncLocalContacts = YES; } -#endif } - (void)viewWillDisappear:(BOOL)animated @@ -169,18 +152,18 @@ - (void)refreshContactsList { - // Retrieve all known matrix users + // Retrieve all the known matrix users NSArray *contacts = [NSArray arrayWithArray:[MXKContactManager sharedManager].matrixContacts]; - // Retrieve all known email addresses from local contacts - NSArray *localEmailContacts = [MXKContactManager sharedManager].localEmailContacts; + // Retrieve all the local contacts with methods + NSArray *localContactsWithMethods = [MXKContactManager sharedManager].localContactsWithMethods; - matrixContacts = [NSMutableArray arrayWithCapacity:(contacts.count + localEmailContacts.count)]; + matrixContacts = [NSMutableArray arrayWithCapacity:(contacts.count + localContactsWithMethods.count)]; // Add first email contacts - if (localEmailContacts.count) + if (localContactsWithMethods.count) { - [matrixContacts addObjectsFromArray:localEmailContacts]; + [matrixContacts addObjectsFromArray:localContactsWithMethods]; } if (contacts.count) @@ -347,16 +330,9 @@ } // Disambiguate the display name when it appears several times. - if (contact.displayName && [isMultiUseNameByDisplayName[contact.displayName] isEqualToNumber:@(YES)]) + if (contact.displayName) { - NSArray *identifiers = contact.matrixIdentifiers; - if (identifiers.count) - { - NSString *participantId = identifiers.firstObject; - NSString *displayName = [NSString stringWithFormat:@"%@ (%@)", contact.displayName, participantId]; - - contact = [[MXKContact alloc] initMatrixContactWithDisplayName:displayName andMatrixID:participantId]; - } + participantCell.showMatrixIdInDisplayName = [isMultiUseNameByDisplayName[contact.displayName] isEqualToNumber:@(YES)]; } [participantCell render:contact]; diff --git a/Vector/ViewController/ContactPickerViewController.xib b/Vector/ViewController/ContactPickerViewController.xib index 3bab1dc33..4511cbe15 100644 --- a/Vector/ViewController/ContactPickerViewController.xib +++ b/Vector/ViewController/ContactPickerViewController.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -14,19 +18,19 @@ - + - - + + - + diff --git a/Vector/ViewController/DirectoryViewController.m b/Vector/ViewController/DirectoryViewController.m index 31106617e..9e9ccf413 100644 --- a/Vector/ViewController/DirectoryViewController.m +++ b/Vector/ViewController/DirectoryViewController.m @@ -36,14 +36,19 @@ @implementation DirectoryViewController -- (void)viewDidLoad +- (void)finalizeInit { - [super viewDidLoad]; + [super finalizeInit]; // Setup `MXKViewControllerHandling` properties self.defaultBarTintColor = kVectorNavBarTintColor; self.enableBarTintColorStatusChange = NO; self.rageShakeManager = [RageShakeManager sharedManager]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; self.title = NSLocalizedStringFromTable(@"directory_title", @"Vector", nil); diff --git a/Vector/ViewController/HomeFilesSearchViewController.m b/Vector/ViewController/HomeFilesSearchViewController.m index 2ee22e550..970390a3f 100644 --- a/Vector/ViewController/HomeFilesSearchViewController.m +++ b/Vector/ViewController/HomeFilesSearchViewController.m @@ -31,14 +31,19 @@ @implementation HomeFilesSearchViewController -- (void)viewDidLoad +- (void)finalizeInit { - [super viewDidLoad]; + [super finalizeInit]; // Setup `MXKViewControllerHandling` properties self.defaultBarTintColor = kVectorNavBarTintColor; self.enableBarTintColorStatusChange = NO; self.rageShakeManager = [RageShakeManager sharedManager]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; // Register cell class used to display the files search result [self.searchTableView registerClass:FilesSearchTableViewCell.class forCellReuseIdentifier:FilesSearchTableViewCell.defaultReuseIdentifier]; diff --git a/Vector/ViewController/HomeMessagesSearchViewController.m b/Vector/ViewController/HomeMessagesSearchViewController.m index b279b2a13..69f7bf734 100644 --- a/Vector/ViewController/HomeMessagesSearchViewController.m +++ b/Vector/ViewController/HomeMessagesSearchViewController.m @@ -35,14 +35,19 @@ @implementation HomeMessagesSearchViewController -- (void)viewDidLoad +- (void)finalizeInit { - [super viewDidLoad]; + [super finalizeInit]; // Setup `MXKViewControllerHandling` properties self.defaultBarTintColor = kVectorNavBarTintColor; self.enableBarTintColorStatusChange = NO; self.rageShakeManager = [RageShakeManager sharedManager]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; // Reuse cells from the RoomViewController to display results [self.searchTableView registerClass:MessagesSearchResultTextMsgBubbleCell.class forCellReuseIdentifier:MessagesSearchResultTextMsgBubbleCell.defaultReuseIdentifier]; diff --git a/Vector/ViewController/HomeViewController.m b/Vector/ViewController/HomeViewController.m index 6b71f8d3d..f15b4c5c5 100644 --- a/Vector/ViewController/HomeViewController.m +++ b/Vector/ViewController/HomeViewController.m @@ -80,6 +80,13 @@ @implementation HomeViewController +- (void)finalizeInit +{ + [super finalizeInit]; + + // The navigation bar tint color and the rageShake Manager are handled by super (see SegmentedViewController). +} + - (void)viewDidLoad { // Set up the SegmentedVC tabs before calling [super viewDidLoad] @@ -110,8 +117,6 @@ [super viewDidLoad]; - // The navigation bar tint color and the rageShake Manager are handled by super (see SegmentedViewController) - self.navigationItem.title = NSLocalizedStringFromTable(@"title_recents", @"Vector", nil); // Add the Vector background image when search bar is empty diff --git a/Vector/ViewController/MediaAlbumContentViewController.m b/Vector/ViewController/MediaAlbumContentViewController.m index 6902a65e6..72ac1b180 100644 --- a/Vector/ViewController/MediaAlbumContentViewController.m +++ b/Vector/ViewController/MediaAlbumContentViewController.m @@ -60,15 +60,20 @@ #pragma mark - -- (void)viewDidLoad +- (void)finalizeInit { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. + [super finalizeInit]; // Setup `MXKViewControllerHandling` properties self.defaultBarTintColor = kVectorNavBarTintColor; self.enableBarTintColorStatusChange = NO; self.rageShakeManager = [RageShakeManager sharedManager]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. // Register collection view cell class [self.assetsCollectionView registerClass:MXKMediaCollectionViewCell.class forCellWithReuseIdentifier:[MXKMediaCollectionViewCell defaultReuseIdentifier]]; diff --git a/Vector/ViewController/MediaAlbumContentViewController.xib b/Vector/ViewController/MediaAlbumContentViewController.xib index be40b4b9e..690e22806 100644 --- a/Vector/ViewController/MediaAlbumContentViewController.xib +++ b/Vector/ViewController/MediaAlbumContentViewController.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -13,12 +17,12 @@ - + - - + + @@ -31,7 +35,7 @@ - + diff --git a/Vector/ViewController/MediaPickerViewController.m b/Vector/ViewController/MediaPickerViewController.m index 8dcacbea5..5d821689b 100644 --- a/Vector/ViewController/MediaPickerViewController.m +++ b/Vector/ViewController/MediaPickerViewController.m @@ -102,10 +102,9 @@ static void *RecordingContext = &RecordingContext; #pragma mark - -- (void)viewDidLoad +- (void)finalizeInit { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. + [super finalizeInit]; // Setup `MXKViewControllerHandling` properties self.defaultBarTintColor = kVectorNavBarTintColor; @@ -114,6 +113,12 @@ static void *RecordingContext = &RecordingContext; cameraQueue = dispatch_queue_create("media.picker.vc.camera", NULL); canToggleCamera = YES; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. // Register collection view cell class [self.recentCapturesCollectionView registerClass:MXKMediaCollectionViewCell.class forCellWithReuseIdentifier:[MXKMediaCollectionViewCell defaultReuseIdentifier]]; diff --git a/Vector/ViewController/MediaPickerViewController.xib b/Vector/ViewController/MediaPickerViewController.xib index 41470f846..c77a00f9d 100644 --- a/Vector/ViewController/MediaPickerViewController.xib +++ b/Vector/ViewController/MediaPickerViewController.xib @@ -1,9 +1,13 @@ - - + + + + + - + + @@ -29,35 +33,35 @@ - + - + - + - - + + - + @@ -65,13 +69,13 @@ - + diff --git a/Vector/Views/Contact/ContactTableViewCell.h b/Vector/Views/Contact/ContactTableViewCell.h index 7f5281098..32a7ff69c 100644 --- a/Vector/Views/Contact/ContactTableViewCell.h +++ b/Vector/Views/Contact/ContactTableViewCell.h @@ -14,21 +14,24 @@ limitations under the License. */ -#import - -#import "MXKTableViewCell.h" -#import "MXKCellRendering.h" -#import "MXKImageView.h" +#import /** 'ContactTableCell' extends MXKTableViewCell. */ @interface ContactTableViewCell : MXKTableViewCell +{ +@protected + /** + The current displayed contact. + */ + MXKContact *contact; +} @property (nonatomic) IBOutlet MXKImageView *thumbnailView; @property (nonatomic) IBOutlet UIImageView *thumbnailBadgeView; @property (nonatomic) IBOutlet UILabel *contactDisplayNameLabel; -@property (nonatomic) IBOutlet UILabel *lastPresenceLabel; +@property (nonatomic) IBOutlet UILabel *contactInformationLabel; @property (nonatomic) IBOutlet UIView *customAccessoryView; @property (nonatomic) BOOL showCustomAccessoryView; @@ -36,6 +39,11 @@ @property (weak, nonatomic) IBOutlet NSLayoutConstraint *customAccessViewWidthConstraint; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *customAccessoryViewLeadingConstraint; +/** + Tell whether the matrix id should be added in the contact display name (NO by default) + */ +@property (nonatomic) BOOL showMatrixIdInDisplayName; + // The room where the contact is. // It is used to display the member information (like invitation) // This property is OPTIONAL. diff --git a/Vector/Views/Contact/ContactTableViewCell.m b/Vector/Views/Contact/ContactTableViewCell.m index 8d1dac972..760dcd4b7 100644 --- a/Vector/Views/Contact/ContactTableViewCell.m +++ b/Vector/Views/Contact/ContactTableViewCell.m @@ -23,13 +23,8 @@ #import "AvatarGenerator.h" #import "Tools.h" -#import "MXKContactManager.h" - @interface ContactTableViewCell() { - // The current displayed contact. - MXKContact *contact; - /** The observer of the presence for matrix user. */ @@ -45,7 +40,10 @@ [super awakeFromNib]; // apply the vector colours - self.lastPresenceLabel.textColor = kVectorTextColorGray; + self.contactInformationLabel.textColor = kVectorTextColorGray; + + // Clear the default background color of a MXKImageView instance + self.thumbnailView.backgroundColor = [UIColor clearColor]; } - (void)layoutSubviews @@ -73,6 +71,16 @@ } } +- (void)setShowMatrixIdInDisplayName:(BOOL)showMatrixIdInDisplayName +{ + _showMatrixIdInDisplayName = showMatrixIdInDisplayName; + + if (contact) + { + [self refreshContactDisplayName]; + } +} + #pragma mark - MXKCellRendering // returns the first matrix id of the contact @@ -100,9 +108,6 @@ mxPresenceObserver = nil; } - // Clear the default background color of a MXKImageView instance - self.thumbnailView.backgroundColor = [UIColor clearColor]; - // Sanity check: accept only object of MXKContact classes or sub-classes NSParameterAssert([cellData isKindOfClass:[MXKContact class]]); contact = (MXKContact*)cellData; @@ -113,7 +118,7 @@ { self.thumbnailView.image = nil; self.contactDisplayNameLabel.text = nil; - self.lastPresenceLabel.text = nil; + self.contactInformationLabel.text = nil; return; } @@ -121,26 +126,32 @@ // Be warned when the thumbnail is updated [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onThumbnailUpdate:) name:kMXKContactThumbnailUpdateNotification object:nil]; - // Observe contact presence change - mxPresenceObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKContactManagerMatrixUserPresenceChangeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { - - NSString* matrixId = self.firstMatrixId; - - if (matrixId && [matrixId isEqualToString:notif.object]) - { - [self refreshContactPresence]; - } - }]; + [self refreshContactThumbnail]; - if (!contact.isMatrixContact) + [self refreshContactDisplayName]; + + if (contact.isMatrixContact) + { + // Observe contact presence change + mxPresenceObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKContactManagerMatrixUserPresenceChangeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { + + NSString* matrixId = self.firstMatrixId; + + if (matrixId && [matrixId isEqualToString:notif.object]) + { + [self refreshContactPresence]; + } + }]; + + [self refreshContactPresence]; + } + else { // Refresh matrix info of the contact [[MXKContactManager sharedManager] updateMatrixIDsForLocalContact:contact]; + + [self refreshLocalContactInformation]; } - - [self refreshContactDisplayName]; - [self refreshContactPresence]; - [self refreshContactThumbnail]; } + (CGFloat)heightForCellData:(MXKCellData*)cellData withMaximumWidth:(CGFloat)maxWidth @@ -176,16 +187,20 @@ if (!image) { - NSString* matrixId = self.firstMatrixId; + NSArray *identifiers = contact.matrixIdentifiers; - if (matrixId) + if (identifiers.count) { - image = [AvatarGenerator generateAvatarForMatrixItem:matrixId withDisplayName:contact.displayName]; + image = [AvatarGenerator generateAvatarForMatrixItem:identifiers.firstObject withDisplayName:contact.displayName]; } else if (contact.isThirdPartyInvite) { image = [AvatarGenerator generateAvatarForText:contact.displayName]; } + else if ((!contact.isMatrixContact && contact.phoneNumbers.count && !contact.emailAddresses.count)) + { + image = [AvatarGenerator imageFromText:@"#" withBackgroundColor:kVectorColorGreen]; + } else { image = [AvatarGenerator imageFromText:@"@" withBackgroundColor:kVectorColorGreen]; @@ -198,6 +213,56 @@ - (void)refreshContactDisplayName { self.contactDisplayNameLabel.text = contact.displayName; + + // Check whether the matrix identifier must be displayed. + if (_showMatrixIdInDisplayName) + { + // Append the matrix identifier to the display name. + NSArray *identifiers = contact.matrixIdentifiers; + if (identifiers.count) + { + NSString *userId = identifiers.firstObject; + + // Check whether the display name is not already the matrix id + if (![contact.displayName isEqualToString:userId]) + { + // Update the display name by adding the matrix id + NSMutableAttributedString *displayNameLabelText = [[NSMutableAttributedString alloc] initWithString:contact.displayName]; + NSRange strRange = NSMakeRange(0, displayNameLabelText.length); + [displayNameLabelText addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:17 weight:UIFontWeightMedium] range:strRange]; + + NSMutableAttributedString *userIdStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@" (%@)", userId]]; + strRange = NSMakeRange(0, userIdStr.length); + [userIdStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:17] range:strRange]; + + [displayNameLabelText appendAttributedString:userIdStr]; + self.contactDisplayNameLabel.attributedText = displayNameLabelText; + } + } + } +} + +- (void)refreshLocalContactInformation +{ + NSArray *identifiers = contact.matrixIdentifiers; + if (identifiers.count) + { + self.thumbnailBadgeView.image = [UIImage imageNamed:@"riot_icon"]; + self.thumbnailBadgeView.hidden = NO; + } + else + { + self.thumbnailBadgeView.hidden = YES; + } + + // Display the first contact method in sub label. + NSString *subLabelText = nil; + if (contact.emailAddresses.count) + { + MXKEmail* email = contact.emailAddresses.firstObject; + subLabelText = email.emailAddress; + } + self.contactInformationLabel.text = subLabelText; } - (void)refreshContactPresence @@ -227,7 +292,7 @@ presenceText = NSLocalizedStringFromTable(@"room_participants_offline", @"Vector", nil); } - self.lastPresenceLabel.text = presenceText; + self.contactInformationLabel.text = presenceText; } #pragma mark - events @@ -246,4 +311,4 @@ } } -@end \ No newline at end of file +@end diff --git a/Vector/Views/Contact/ContactTableViewCell.xib b/Vector/Views/Contact/ContactTableViewCell.xib index 01e8229e9..3cb9acae1 100644 --- a/Vector/Views/Contact/ContactTableViewCell.xib +++ b/Vector/Views/Contact/ContactTableViewCell.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -16,7 +20,7 @@ - + @@ -35,21 +39,21 @@ - + - - + @@ -133,7 +137,7 @@ - + diff --git a/Vector/Views/RoomList/DirectoryRecentTableViewCell.xib b/Vector/Views/RoomList/DirectoryRecentTableViewCell.xib index 023c927f2..3683c7741 100644 --- a/Vector/Views/RoomList/DirectoryRecentTableViewCell.xib +++ b/Vector/Views/RoomList/DirectoryRecentTableViewCell.xib @@ -1,10 +1,14 @@ - - + + + + + - + + @@ -29,7 +33,7 @@ - + - + @@ -62,7 +66,7 @@ - + diff --git a/Vector/Views/RoomList/PublicRoomTableViewCell.xib b/Vector/Views/RoomList/PublicRoomTableViewCell.xib index 2be78e52d..19b84d7e5 100644 --- a/Vector/Views/RoomList/PublicRoomTableViewCell.xib +++ b/Vector/Views/RoomList/PublicRoomTableViewCell.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -16,7 +20,7 @@ - + @@ -28,7 +32,7 @@ - + - + - + @@ -63,7 +67,7 @@ - + diff --git a/Vector/Views/RoomList/RoomIdOrAliasTableViewCell.xib b/Vector/Views/RoomList/RoomIdOrAliasTableViewCell.xib index f28a6aab7..384d1dc33 100644 --- a/Vector/Views/RoomList/RoomIdOrAliasTableViewCell.xib +++ b/Vector/Views/RoomList/RoomIdOrAliasTableViewCell.xib @@ -1,10 +1,14 @@ - - + + + + + - + + @@ -29,7 +33,7 @@ - + @@ -41,7 +45,7 @@ - + diff --git a/Vector/Views/RoomMember/RoomMemberTitleView.xib b/Vector/Views/RoomMember/RoomMemberTitleView.xib index e7c11e909..3ae3443ee 100644 --- a/Vector/Views/RoomMember/RoomMemberTitleView.xib +++ b/Vector/Views/RoomMember/RoomMemberTitleView.xib @@ -1,9 +1,13 @@ - - + + + + + - + + @@ -14,7 +18,7 @@ - + @@ -28,7 +32,7 @@ - + diff --git a/Vector/Views/RoomTitle/ExpandedRoomTitleView.xib b/Vector/Views/RoomTitle/ExpandedRoomTitleView.xib index 172301a7b..e1b996d8b 100644 --- a/Vector/Views/RoomTitle/ExpandedRoomTitleView.xib +++ b/Vector/Views/RoomTitle/ExpandedRoomTitleView.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -13,14 +17,14 @@ - + - + @@ -48,21 +52,21 @@ - + - + - + - + diff --git a/Vector/Views/RoomTitle/PreviewRoomTitleView.xib b/Vector/Views/RoomTitle/PreviewRoomTitleView.xib index b9fc209ba..6c610fc37 100644 --- a/Vector/Views/RoomTitle/PreviewRoomTitleView.xib +++ b/Vector/Views/RoomTitle/PreviewRoomTitleView.xib @@ -1,9 +1,13 @@ - - + + + + + - + + @@ -24,7 +28,7 @@ - + @@ -51,7 +55,7 @@ - + @@ -82,18 +86,18 @@ @@ -118,13 +122,13 @@ - + - + diff --git a/Vector/Views/RoomTitle/RoomAvatarTitleView.xib b/Vector/Views/RoomTitle/RoomAvatarTitleView.xib index be0f1b071..ec6de6ec3 100644 --- a/Vector/Views/RoomTitle/RoomAvatarTitleView.xib +++ b/Vector/Views/RoomTitle/RoomAvatarTitleView.xib @@ -1,9 +1,13 @@ - - + + + + + - + + @@ -14,14 +18,14 @@ - + - + diff --git a/Vector/Views/RoomTitle/RoomTitleView.xib b/Vector/Views/RoomTitle/RoomTitleView.xib index eefbb171a..4eb1c0a0c 100644 --- a/Vector/Views/RoomTitle/RoomTitleView.xib +++ b/Vector/Views/RoomTitle/RoomTitleView.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -13,7 +17,7 @@ - + @@ -29,14 +33,14 @@ - + - + - + diff --git a/Vector/Views/RoomTitle/SimpleRoomTitleView.xib b/Vector/Views/RoomTitle/SimpleRoomTitleView.xib index ff133e327..1067381cc 100644 --- a/Vector/Views/RoomTitle/SimpleRoomTitleView.xib +++ b/Vector/Views/RoomTitle/SimpleRoomTitleView.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -13,7 +17,7 @@ - + @@ -21,7 +25,7 @@ - + diff --git a/Vector/Views/Search/FilesSearchTableViewCell.xib b/Vector/Views/Search/FilesSearchTableViewCell.xib index 76c3139a6..e3f7bfec5 100644 --- a/Vector/Views/Search/FilesSearchTableViewCell.xib +++ b/Vector/Views/Search/FilesSearchTableViewCell.xib @@ -1,9 +1,13 @@ - - + + + + + - + + @@ -24,7 +28,7 @@ - + @@ -41,7 +45,7 @@ - + - + @@ -70,7 +74,7 @@ - + diff --git a/Vector/Views/Search/MessagesSearchResultAttachmentBubbleCell.xib b/Vector/Views/Search/MessagesSearchResultAttachmentBubbleCell.xib index 64c7267ce..6b4a24abb 100644 --- a/Vector/Views/Search/MessagesSearchResultAttachmentBubbleCell.xib +++ b/Vector/Views/Search/MessagesSearchResultAttachmentBubbleCell.xib @@ -1,9 +1,13 @@ - - + + + + + - + + @@ -24,11 +28,11 @@ - + - + @@ -38,7 +42,7 @@ - + @@ -46,17 +50,17 @@ - + @@ -78,7 +82,7 @@ - + - + @@ -38,7 +42,7 @@ - + @@ -46,17 +50,17 @@ - + @@ -67,21 +71,21 @@ - + - + @@ -108,7 +112,7 @@ - + diff --git a/Vector/Views/TableViewCell/TableViewCellWithButton.xib b/Vector/Views/TableViewCell/TableViewCellWithButton.xib index 53efde0be..c1b0f5c1a 100644 --- a/Vector/Views/TableViewCell/TableViewCellWithButton.xib +++ b/Vector/Views/TableViewCell/TableViewCellWithButton.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -18,8 +22,8 @@ - - + + diff --git a/Vector/Views/TableViewCell/TableViewCellWithCheckBoxAndLabel.xib b/Vector/Views/TableViewCell/TableViewCellWithCheckBoxAndLabel.xib index a6323f255..2ccb390b7 100644 --- a/Vector/Views/TableViewCell/TableViewCellWithCheckBoxAndLabel.xib +++ b/Vector/Views/TableViewCell/TableViewCellWithCheckBoxAndLabel.xib @@ -1,9 +1,13 @@ - - + + + + + - + + @@ -12,7 +16,7 @@ - + @@ -25,7 +29,7 @@ diff --git a/Vector/Views/TableViewCell/TableViewCellWithCheckBoxes.xib b/Vector/Views/TableViewCell/TableViewCellWithCheckBoxes.xib index c5bb3c969..798adf680 100644 --- a/Vector/Views/TableViewCell/TableViewCellWithCheckBoxes.xib +++ b/Vector/Views/TableViewCell/TableViewCellWithCheckBoxes.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -16,7 +20,7 @@ - + diff --git a/Vector/Views/TableViewCell/TableViewCellWithLabelAndLargeTextView.xib b/Vector/Views/TableViewCell/TableViewCellWithLabelAndLargeTextView.xib index af2fa19dd..0e315d631 100644 --- a/Vector/Views/TableViewCell/TableViewCellWithLabelAndLargeTextView.xib +++ b/Vector/Views/TableViewCell/TableViewCellWithLabelAndLargeTextView.xib @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -16,9 +20,9 @@ diff --git a/buildipa.sh b/buildipa.sh index 4b482bcea..d1427c6be 100755 --- a/buildipa.sh +++ b/buildipa.sh @@ -29,11 +29,24 @@ then fi rm -r "$builddir" "$outdir" || true else + method=$1 if [ ! -d "Vector.xcworkspace" ] then echo "Please run pod install first" exit 1 fi - $basecmd -archivePath "out/Vector.xcarchive" archive GCC_PREPROCESSOR_DEFINITIONS="\$(GCC_PREPROCESSOR_DEFINITIONS) $vars" "$@" - xcrun -sdk $sdk PackageApplication -v $outdir/Vector.xcarchive/Products/Applications/Vector.app -o `pwd`/out/Vector.ipa + $basecmd -archivePath "out/Vector.xcarchive" archive GCC_PREPROCESSOR_DEFINITIONS="\$(GCC_PREPROCESSOR_DEFINITIONS) $vars" + exportOptionsPlist=`mktemp` + cat > $exportOptionsPlist < + + + + method + $method + + +EOD + xcodebuild -exportArchive -archivePath "out/Vector.xcarchive" -exportPath out -exportOptionsPlist "$exportOptionsPlist" + rm "$exportOptionsPlist" fi diff --git a/checkipa.sh b/checkipa.sh index dcd9c924b..71e5f702c 100755 --- a/checkipa.sh +++ b/checkipa.sh @@ -33,23 +33,20 @@ then exit 2 fi -# This checks is currently disabled: as of XCode 8, I don't seem to be -# able to generate a build with the aps-environment entitlement. -# Push still seeems to work with these builds so it appears the absence -# of this entitlement no longer indicates a build with broken push. - # Check the aps-environment embedded in the binary. # If this is incorrect or absent, you have a build with broken push. # Using xcodebuild -exportArchive -exportWithOriginalSigningIdentity is known to # strip the aps-environment string out of the binary's embedded entitlements. -#if [ "$apsenv" == 'production' ] -#then -# echo "$1's aps-environment is $apsenv: looks good" -#elif [ -z "$apsenv" ] -#then -# echo "$1 has no aps-environment: push will not work with this build!" -# exit 1 -#else -# echo "$1's aps-environment is $apsenv. Is that what you wanted?" -# exit 1 -#fi +# Also, make sure ther 'push notifications' switch is on in Xcode's project +# capabilities editor. This became necessary of of Xcode 8. +if [ "$apsenv" == 'production' ] +then + echo "$1's aps-environment is $apsenv: looks good" +elif [ -z "$apsenv" ] +then + echo "$1 has no aps-environment: push will not work with this build!" + exit 1 +else + echo "$1's aps-environment is $apsenv. Is that what you wanted?" + exit 1 +fi