Skip to content

Commit

Permalink
Merge pull request #530 from tchapgouv/phlpro/528-fix-unexpected-logout
Browse files Browse the repository at this point in the history
Fix unexpected logout (#528)
  • Loading branch information
Phl-Pro authored May 16, 2022
2 parents 7e04779 + f58d17f commit 3a65e5b
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 218 deletions.
8 changes: 3 additions & 5 deletions Btchap/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ targets:

sources:
- path: ../Btchap/Config
- path: ../Config/AppConfiguration.swift
- path: ../Config/Project.xcconfig
- path: ../Config/Project-Warnings.xcconfig
- path: ../Config/AppIdentifiers.xcconfig
- path: ../Config/CommonConfiguration.swift
- path: ../Config/Configurable.swift
- path: .
excludes:
- "**/*.strings" # Exclude all strings files
Expand Down Expand Up @@ -258,11 +261,6 @@ targets:
- path: ../RiotShareExtension/Sources/ShareItemProtocol.swift
- path: ../RiotShareExtension/Sources/ShareItemSender.h
- path: ../RiotShareExtension/Sources/ShareItemSender.m

# Tchap
- path: ../Tchap/Config/AppConfiguration.swift
- path: ../Tchap/Config/CommonConfiguration.swift
- path: ../Tchap/Config/Configurable.swift

# Resources
- path: ../Riot/Assets/en.lproj/InfoPlist.strings
Expand Down
13 changes: 11 additions & 2 deletions Config/AppConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ class AppConfiguration: CommonConfiguration {
}

private func setupAppSettings() {
// Enable CallKit for app
MXKAppSettings.standard()?.isCallKitEnabled = true
// Tchap: Disable CallKit.
MXKAppSettings.standard()?.isCallKitEnabled = false

// Get modular widget events in rooms histories
MXKAppSettings.standard()?.addSupportedEventTypes([kWidgetMatrixEventTypeString,
kWidgetModularEventTypeString])

// Tchap: remove some state events from the rooms histories: creation, the history access, encryption, join rules
MXKAppSettings.standard()?.removeSupportedEventTypes([kMXEventTypeStringRoomCreate,
kMXEventTypeStringRoomHistoryVisibility,
kMXEventTypeStringRoomEncryption,
kMXEventTypeStringRoomGuestAccess,
kMXEventTypeStringRoomJoinRules])

// Hide undecryptable messages that were sent while the user was not in the room
MXKAppSettings.standard()?.hidePreJoinedUndecryptableEvents = true

Expand All @@ -46,8 +53,10 @@ class AppConfiguration: CommonConfiguration {
// Use UIKit BackgroundTask for handling background tasks in the SDK
MXSDKOptions.sharedInstance().backgroundModeHandler = MXUIKitBackgroundModeHandler()

#if SUPPORT_KEYS_BACKUP
// Enable key backup on app
MXSDKOptions.sharedInstance().enableKeyBackupWhenStartingMXCrypto = true
#endif
}


Expand Down
4 changes: 4 additions & 0 deletions Config/CommonConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ class CommonConfiguration: NSObject, Configurable {

// Enable e2e encryption for newly created MXSession
sdkOptions.enableCryptoWhenStartingMXSession = true
sdkOptions.computeE2ERoomSummaryTrust = false

// Disable identicon use
sdkOptions.disableIdenticonUseForUserAvatar = true

// Use UIKit BackgroundTask for handling background tasks in the SDK
sdkOptions.backgroundModeHandler = MXUIKitBackgroundModeHandler()

// Pass httpAdditionalHeaders to the SDK
sdkOptions.httpAdditionalHeaders = BuildSettings.httpAdditionalHeaders

Expand Down
4 changes: 2 additions & 2 deletions RiotShareExtension/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ targets:
excludes:
- "Shared/View/ShareRoomsRoomCell.*"
- "Shared/View/ShareRoomsDiscussionCell.*"
- path: ../Config/CommonConfiguration.swift
- path: ../Config/Configurable.swift
- path: ../Riot/Categories/Bundle.swift
- path: ../Riot/Categories/Character.swift
- path: ../Riot/Categories/MXKImageView.swift
Expand Down Expand Up @@ -86,8 +88,6 @@ targets:

# Tchap
- path: ../RiotShareExtension/BuildSettings.swift
- path: ../Tchap/Config/CommonConfiguration.swift
- path: ../Tchap/Config/Configurable.swift
- path: ../Tchap/Extensions
- path: ../Tchap/Generated/Images_Riot.swift
- path: ../Tchap/Generated/InfoPlist.swift
Expand Down
75 changes: 0 additions & 75 deletions Tchap/Config/AppConfiguration.swift

This file was deleted.

102 changes: 0 additions & 102 deletions Tchap/Config/CommonConfiguration.swift

This file was deleted.

29 changes: 0 additions & 29 deletions Tchap/Config/Configurable.swift

This file was deleted.

3 changes: 3 additions & 0 deletions Tchap/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ targets:

sources:
- path: ../Tchap/Config
- path: ../Config/AppConfiguration.swift
- path: ../Config/Project.xcconfig
- path: ../Config/Project-Warnings.xcconfig
- path: ../Config/AppIdentifiers.xcconfig
- path: ../Config/CommonConfiguration.swift
- path: ../Config/Configurable.swift
- path: .
excludes:
- "Tools"
Expand Down
6 changes: 3 additions & 3 deletions TchapTests/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ targets:

sources:
- path: .
- path: ../Config/AppConfiguration.swift
- path: ../Config/CommonConfiguration.swift
- path: ../Config/Configurable.swift

# Tchap
- path: ../Tchap/Config/Configurable.swift
- path: ../Tchap/Config/BuildSettings.swift
- path: ../Tchap/Config/AppConfiguration.swift
- path: ../Tchap/Config/CommonConfiguration.swift

# Riot
- path: ../Riot/Categories/Bundle.swift
Expand Down
1 change: 1 addition & 0 deletions changelog.d/528.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unexpected logout

0 comments on commit 3a65e5b

Please sign in to comment.