mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 15:52:40 +00:00
Merge branch 'ismail/5117_thread_message_actions' into ismail/5092_thread_list
This commit is contained in:
commit
1d76c39f57
38 changed files with 808 additions and 381 deletions
6
.github/ISSUE_TEMPLATE/bug.yml
vendored
6
.github/ISSUE_TEMPLATE/bug.yml
vendored
|
@ -23,12 +23,12 @@ body:
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: result
|
id: result
|
||||||
attributes:
|
attributes:
|
||||||
label: What happened?
|
label: Outcome
|
||||||
placeholder: Tell us what went wrong
|
placeholder: Tell us what went wrong
|
||||||
value: |
|
value: |
|
||||||
### What did you expect?
|
#### What did you expect?
|
||||||
|
|
||||||
### What happened?
|
#### What happened instead?
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
|
|
124
.github/workflows/triage-move-labelled.yml
vendored
Normal file
124
.github/workflows/triage-move-labelled.yml
vendored
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
name: Move labelled issues to correct boards and columns
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [labeled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
move_needs_info_issues:
|
||||||
|
name: Move X-Needs-Info issues to Need info on triage board
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: konradpabjan/move-labeled-or-milestoned-issue@219d384e03fa4b6460cd24f9f37d19eb033a4338
|
||||||
|
with:
|
||||||
|
action-token: "${{ secrets.ELEMENT_BOT_TOKEN }}"
|
||||||
|
project-url: "https://github.com/vector-im/element-android/projects/4"
|
||||||
|
column-name: "Need info"
|
||||||
|
label-name: "X-Needs-Info"
|
||||||
|
|
||||||
|
add_priority_design_issues_to_project:
|
||||||
|
name: Move priority X-Needs-Design issues to Design project board
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
contains(github.event.issue.labels.*.name, 'X-Needs-Design') &&
|
||||||
|
(contains(github.event.issue.labels.*.name, 'O-Frequent') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'O-Occasional')) &&
|
||||||
|
(contains(github.event.issue.labels.*.name, 'S-Critical') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'S-Major') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'S-Minor'))
|
||||||
|
steps:
|
||||||
|
- uses: octokit/graphql-action@v2.x
|
||||||
|
id: add_to_project
|
||||||
|
with:
|
||||||
|
headers: '{"GraphQL-Features": "projects_next_graphql"}'
|
||||||
|
query: |
|
||||||
|
mutation add_to_project($projectid:String!,$contentid:String!) {
|
||||||
|
addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) {
|
||||||
|
projectNextItem {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
projectid: ${{ env.PROJECT_ID }}
|
||||||
|
contentid: ${{ github.event.issue.node_id }}
|
||||||
|
env:
|
||||||
|
PROJECT_ID: "PN_kwDOAM0swc0sUA"
|
||||||
|
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
|
|
||||||
|
move_spaces_issues:
|
||||||
|
name: Move Spaces issues to Delight project board
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
contains(github.event.issue.labels.*.name, 'A-Spaces') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'A-Space-Settings') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'A-Subspaces')
|
||||||
|
steps:
|
||||||
|
- uses: konradpabjan/move-labeled-or-milestoned-issue@219d384e03fa4b6460cd24f9f37d19eb033a4338
|
||||||
|
with:
|
||||||
|
action-token: "${{ secrets.ELEMENT_BOT_TOKEN }}"
|
||||||
|
project-url: "https://github.com/orgs/vector-im/projects/6"
|
||||||
|
column-name: "📥 Inbox"
|
||||||
|
label-name: "A-Spaces"
|
||||||
|
- uses: octokit/graphql-action@v2.x
|
||||||
|
id: add_to_delight2
|
||||||
|
with:
|
||||||
|
headers: '{"GraphQL-Features": "projects_next_graphql"}'
|
||||||
|
query: |
|
||||||
|
mutation add_to_project($projectid:String!,$contentid:String!) {
|
||||||
|
addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) {
|
||||||
|
projectNextItem {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
projectid: ${{ env.PROJECT_ID }}
|
||||||
|
contentid: ${{ github.event.issue.node_id }}
|
||||||
|
env:
|
||||||
|
PROJECT_ID: "PN_kwDOAM0swc1HvQ"
|
||||||
|
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
|
|
||||||
|
move_voice-message_issues:
|
||||||
|
name: Move A-Voice Messages to Voice message board
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
contains(github.event.issue.labels.*.name, 'A-Voice Messages')
|
||||||
|
steps:
|
||||||
|
- uses: octokit/graphql-action@v2.x
|
||||||
|
with:
|
||||||
|
headers: '{"GraphQL-Features": "projects_next_graphql"}'
|
||||||
|
query: |
|
||||||
|
mutation add_to_project($projectid:String!,$contentid:String!) {
|
||||||
|
addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) {
|
||||||
|
projectNextItem {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
projectid: ${{ env.PROJECT_ID }}
|
||||||
|
contentid: ${{ github.event.issue.node_id }}
|
||||||
|
env:
|
||||||
|
PROJECT_ID: "PN_kwDOAM0swc2KCw"
|
||||||
|
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
|
|
||||||
|
move_threads_issues:
|
||||||
|
name: Move A-Threads to Thread board
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
contains(github.event.issue.labels.*.name, 'A-Threads')
|
||||||
|
steps:
|
||||||
|
- uses: octokit/graphql-action@v2.x
|
||||||
|
with:
|
||||||
|
headers: '{"GraphQL-Features": "projects_next_graphql"}'
|
||||||
|
query: |
|
||||||
|
mutation add_to_project($projectid:String!,$contentid:String!) {
|
||||||
|
addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) {
|
||||||
|
projectNextItem {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
projectid: ${{ env.PROJECT_ID }}
|
||||||
|
contentid: ${{ github.event.issue.node_id }}
|
||||||
|
env:
|
||||||
|
PROJECT_ID: "PN_kwDOAM0swc0rRA"
|
||||||
|
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
35
.github/workflows/triage-move-unlabelled.yml
vendored
Normal file
35
.github/workflows/triage-move-unlabelled.yml
vendored
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
name: Move unlabelled from needs info columns to triaged
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [unlabeled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Move_Unabeled_Issue_On_Project_Board:
|
||||||
|
name: Move no longer X-Needs-Info issues to Triaged
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
${{
|
||||||
|
!contains(github.event.issue.labels.*.name, 'X-Needs-Info') }}
|
||||||
|
env:
|
||||||
|
BOARD_NAME: "Issue triage"
|
||||||
|
OWNER: ${{ github.repository_owner }}
|
||||||
|
REPO: ${{ github.event.repository.name }}
|
||||||
|
ISSUE: ${{ github.event.issue.number }}
|
||||||
|
steps:
|
||||||
|
- name: Check if issue is already in "${{ env.BOARD_NAME }}"
|
||||||
|
run: |
|
||||||
|
if curl -i -H 'Content-Type: application/json' -H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" -X POST -d '{"query": "query($issue: Int!, $owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { issue(number: $issue) { projectCards { nodes { project { name } } } } } } ", "variables" : "{ \"issue\": '${ISSUE}', \"owner\": \"'${OWNER}'\", \"repo\": \"'${REPO}'\" }" }' https://api.github.com/graphql | grep "\b$BOARD_NAME\b"; then
|
||||||
|
echo "Issue is already in Project '$BOARD_NAME', proceeding";
|
||||||
|
echo "ALREADY_IN_BOARD=true" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "Issue is not in project '$BOARD_NAME', cancelling this workflow"
|
||||||
|
echo "ALREADY_IN_BOARD=false" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
- name: Move issue
|
||||||
|
uses: alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488
|
||||||
|
if: ${{ env.ALREADY_IN_BOARD == 'true' }}
|
||||||
|
with:
|
||||||
|
project: Issue triage
|
||||||
|
column: Triaged
|
||||||
|
repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
55
.github/workflows/triage-priority-bugs.yml
vendored
Normal file
55
.github/workflows/triage-priority-bugs.yml
vendored
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
name: Move P1 issues into the P1 column for the App Team and Crypto team
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [labeled, unlabeled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
p1_issues_to_team_workboard:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
(!contains(github.event.issue.labels.*.name, 'A-E2EE') &&
|
||||||
|
!contains(github.event.issue.labels.*.name, 'A-E2EE-Cross-Signing') &&
|
||||||
|
!contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') &&
|
||||||
|
!contains(github.event.issue.labels.*.name, 'A-E2EE-Key-Backup') &&
|
||||||
|
!contains(github.event.issue.labels.*.name, 'A-E2EE-SAS-Verification') &&
|
||||||
|
!contains(github.event.issue.labels.*.name, 'A-Spaces') &&
|
||||||
|
!contains(github.event.issue.labels.*.name, 'A-Spaces-Settings') &&
|
||||||
|
!contains(github.event.issue.labels.*.name, 'A-Subspaces')) &&
|
||||||
|
(contains(github.event.issue.labels.*.name, 'T-Defect') &&
|
||||||
|
contains(github.event.issue.labels.*.name, 'S-Critical') &&
|
||||||
|
(contains(github.event.issue.labels.*.name, 'O-Frequent') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'O-Occasional')) ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'S-Major') &&
|
||||||
|
contains(github.event.issue.labels.*.name, 'O-Frequent') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'A11y') &&
|
||||||
|
contains(github.event.issue.labels.*.name, 'O-Frequent'))
|
||||||
|
steps:
|
||||||
|
- uses: alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488
|
||||||
|
with:
|
||||||
|
project: iOS App Team
|
||||||
|
column: P1
|
||||||
|
repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
|
|
||||||
|
P1_issues_to_crypto_team_workboard:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
(contains(github.event.issue.labels.*.name, 'A-E2EE') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'A-E2EE-Cross-Signing') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'A-E2EE-Key-Backup') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'A-E2EE-SAS-Verification')) &&
|
||||||
|
(contains(github.event.issue.labels.*.name, 'T-Defect') &&
|
||||||
|
contains(github.event.issue.labels.*.name, 'S-Critical') &&
|
||||||
|
(contains(github.event.issue.labels.*.name, 'O-Frequent') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'O-Occasional')) ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'S-Major') &&
|
||||||
|
contains(github.event.issue.labels.*.name, 'O-Frequent') ||
|
||||||
|
contains(github.event.issue.labels.*.name, 'A11y') &&
|
||||||
|
contains(github.event.issue.labels.*.name, 'O-Frequent'))
|
||||||
|
steps:
|
||||||
|
- uses: alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488
|
||||||
|
with:
|
||||||
|
project: Crypto Team
|
||||||
|
column: Ready
|
||||||
|
repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
32
CHANGES.md
32
CHANGES.md
|
@ -1,3 +1,35 @@
|
||||||
|
## Changes in 1.6.8 (2021-11-17)
|
||||||
|
|
||||||
|
🙌 Improvements
|
||||||
|
|
||||||
|
- Upgrade MatrixKit version ([v0.16.10](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.16.10)).
|
||||||
|
- Using mutable room list fetch sort options after chaning them to be a structure. ([#4384](https://github.com/vector-im/element-ios/issues/4384))
|
||||||
|
- Share Extension: Remove the image compression prompt when the showMediaSizeSelection setting is disabled. ([#4815](https://github.com/vector-im/element-ios/issues/4815))
|
||||||
|
- Replaced GrowingTextView with simpler, custom implementation. Cleaned up the RoomInputToolbar header. ([#4976](https://github.com/vector-im/element-ios/issues/4976))
|
||||||
|
- Settings: Update about section footer text. ([#5090](https://github.com/vector-im/element-ios/issues/5090))
|
||||||
|
- MXSession: Add logs to track if E2EE is enabled by default on the current HS. ([#5129](https://github.com/vector-im/element-ios/issues/5129))
|
||||||
|
|
||||||
|
🐛 Bugfixes
|
||||||
|
|
||||||
|
- Fixed share extension and message forwarding room list accessory view icon. ([#5041](https://github.com/vector-im/element-ios/issues/5041))
|
||||||
|
- Fixed message composer not following keyboard when swiping to dismiss. ([#5042](https://github.com/vector-im/element-ios/issues/5042))
|
||||||
|
- RoomVC: Fix retain cycles that prevents `RoomViewController` to be deallocated. ([#5055](https://github.com/vector-im/element-ios/issues/5055))
|
||||||
|
- Share Extension: Fix missing avatars and don't list spaces as rooms. ([#5057](https://github.com/vector-im/element-ios/issues/5057))
|
||||||
|
- Fix retain cycles that prevents deallocation in several classes. ([#5058](https://github.com/vector-im/element-ios/issues/5058))
|
||||||
|
- Fixed retain cycles between the user suggestion coordinator and the suggestion service, and in the suggestion service currentTextTrigger subject sink. ([#5063](https://github.com/vector-im/element-ios/issues/5063))
|
||||||
|
- Ensure alerts with weak references are retained until they've been presented. ([#5071](https://github.com/vector-im/element-ios/issues/5071))
|
||||||
|
- Message Composer: Ensure there is no text view when the user isn't allowed to send messages. ([#5079](https://github.com/vector-im/element-ios/issues/5079))
|
||||||
|
- Home: Fix bug where favourited DM would be shown in both Favourites and People section. ([#5081](https://github.com/vector-im/element-ios/issues/5081))
|
||||||
|
- Fix a crash when selected space is not home and a clear cache or logout is performed. ([#5082](https://github.com/vector-im/element-ios/issues/5082))
|
||||||
|
- Room Previews: Fix room previews not loading. ([#5083](https://github.com/vector-im/element-ios/issues/5083))
|
||||||
|
- Do not make the placeholder appearing when leaving a room on iPhone. ([#5084](https://github.com/vector-im/element-ios/issues/5084))
|
||||||
|
- Fix room ordering when switching between Home and People/Rooms/Favourites. ([#5105](https://github.com/vector-im/element-ios/issues/5105))
|
||||||
|
|
||||||
|
Others
|
||||||
|
|
||||||
|
- Improve wording around rageshakes in the defect issue template. ([#4987](https://github.com/vector-im/element-ios/issues/4987))
|
||||||
|
|
||||||
|
|
||||||
## Changes in 1.6.6 (2021-10-21)
|
## Changes in 1.6.6 (2021-10-21)
|
||||||
|
|
||||||
✨ Features
|
✨ Features
|
||||||
|
|
|
@ -15,5 +15,5 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
// Version
|
// Version
|
||||||
MARKETING_VERSION = 1.6.7
|
MARKETING_VERSION = 1.6.9
|
||||||
CURRENT_PROJECT_VERSION = 1.6.7
|
CURRENT_PROJECT_VERSION = 1.6.9
|
||||||
|
|
|
@ -154,7 +154,6 @@ final class BuildSettings: NSObject {
|
||||||
}
|
}
|
||||||
static let stunServerFallbackUrlString: String? = "stun:turn.matrix.org"
|
static let stunServerFallbackUrlString: String? = "stun:turn.matrix.org"
|
||||||
|
|
||||||
|
|
||||||
// MARK: - Public rooms Directory
|
// MARK: - Public rooms Directory
|
||||||
#warning("Unused build setting: should this be implemented in ShowDirectory?")
|
#warning("Unused build setting: should this be implemented in ShowDirectory?")
|
||||||
static let publicRoomsAllowServerChange: Bool = true
|
static let publicRoomsAllowServerChange: Bool = true
|
||||||
|
|
2
Podfile
2
Podfile
|
@ -13,7 +13,7 @@ use_frameworks!
|
||||||
# - `{ {kit spec hash} => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for each repo. Used by Fastfile during CI
|
# - `{ {kit spec hash} => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for each repo. Used by Fastfile during CI
|
||||||
#
|
#
|
||||||
# Warning: our internal tooling depends on the name of this variable name, so be sure not to change it
|
# Warning: our internal tooling depends on the name of this variable name, so be sure not to change it
|
||||||
$matrixKitVersion = '= 0.16.9'
|
$matrixKitVersion = '= 0.16.10'
|
||||||
# $matrixKitVersion = :local
|
# $matrixKitVersion = :local
|
||||||
# $matrixKitVersion = {'develop' => 'develop'}
|
# $matrixKitVersion = {'develop' => 'develop'}
|
||||||
|
|
||||||
|
|
26
Podfile.lock
26
Podfile.lock
|
@ -59,29 +59,29 @@ PODS:
|
||||||
- MatomoTracker (7.4.1):
|
- MatomoTracker (7.4.1):
|
||||||
- MatomoTracker/Core (= 7.4.1)
|
- MatomoTracker/Core (= 7.4.1)
|
||||||
- MatomoTracker/Core (7.4.1)
|
- MatomoTracker/Core (7.4.1)
|
||||||
- MatrixKit (0.16.9):
|
- MatrixKit (0.16.10):
|
||||||
- Down (~> 0.11.0)
|
- Down (~> 0.11.0)
|
||||||
- DTCoreText (~> 1.6.25)
|
- DTCoreText (~> 1.6.25)
|
||||||
- HPGrowingTextView (~> 1.1)
|
- HPGrowingTextView (~> 1.1)
|
||||||
- libPhoneNumber-iOS (~> 0.9.13)
|
- libPhoneNumber-iOS (~> 0.9.13)
|
||||||
- MatrixKit/Core (= 0.16.9)
|
- MatrixKit/Core (= 0.16.10)
|
||||||
- MatrixSDK (= 0.20.9)
|
- MatrixSDK (= 0.20.10)
|
||||||
- MatrixKit/Core (0.16.9):
|
- MatrixKit/Core (0.16.10):
|
||||||
- Down (~> 0.11.0)
|
- Down (~> 0.11.0)
|
||||||
- DTCoreText (~> 1.6.25)
|
- DTCoreText (~> 1.6.25)
|
||||||
- HPGrowingTextView (~> 1.1)
|
- HPGrowingTextView (~> 1.1)
|
||||||
- libPhoneNumber-iOS (~> 0.9.13)
|
- libPhoneNumber-iOS (~> 0.9.13)
|
||||||
- MatrixSDK (= 0.20.9)
|
- MatrixSDK (= 0.20.10)
|
||||||
- MatrixSDK (0.20.9):
|
- MatrixSDK (0.20.10):
|
||||||
- MatrixSDK/Core (= 0.20.9)
|
- MatrixSDK/Core (= 0.20.10)
|
||||||
- MatrixSDK/Core (0.20.9):
|
- MatrixSDK/Core (0.20.10):
|
||||||
- AFNetworking (~> 4.0.0)
|
- AFNetworking (~> 4.0.0)
|
||||||
- GZIP (~> 1.3.0)
|
- GZIP (~> 1.3.0)
|
||||||
- libbase58 (~> 0.1.4)
|
- libbase58 (~> 0.1.4)
|
||||||
- OLMKit (~> 3.2.5)
|
- OLMKit (~> 3.2.5)
|
||||||
- Realm (= 10.16.0)
|
- Realm (= 10.16.0)
|
||||||
- SwiftyBeaver (= 1.9.5)
|
- SwiftyBeaver (= 1.9.5)
|
||||||
- MatrixSDK/JingleCallStack (0.20.9):
|
- MatrixSDK/JingleCallStack (0.20.10):
|
||||||
- JitsiMeetSDK (= 3.10.2)
|
- JitsiMeetSDK (= 3.10.2)
|
||||||
- MatrixSDK/Core
|
- MatrixSDK/Core
|
||||||
- OLMKit (3.2.5):
|
- OLMKit (3.2.5):
|
||||||
|
@ -126,7 +126,7 @@ DEPENDENCIES:
|
||||||
- KeychainAccess (~> 4.2.2)
|
- KeychainAccess (~> 4.2.2)
|
||||||
- KTCenterFlowLayout (~> 1.3.1)
|
- KTCenterFlowLayout (~> 1.3.1)
|
||||||
- MatomoTracker (~> 7.4.1)
|
- MatomoTracker (~> 7.4.1)
|
||||||
- MatrixKit (= 0.16.9)
|
- MatrixKit (= 0.16.10)
|
||||||
- MatrixSDK
|
- MatrixSDK
|
||||||
- MatrixSDK/JingleCallStack
|
- MatrixSDK/JingleCallStack
|
||||||
- OLMKit
|
- OLMKit
|
||||||
|
@ -210,8 +210,8 @@ SPEC CHECKSUMS:
|
||||||
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
|
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
|
||||||
Logging: beeb016c9c80cf77042d62e83495816847ef108b
|
Logging: beeb016c9c80cf77042d62e83495816847ef108b
|
||||||
MatomoTracker: 24a846c9d3aa76933183fe9d47fd62c9efa863fb
|
MatomoTracker: 24a846c9d3aa76933183fe9d47fd62c9efa863fb
|
||||||
MatrixKit: ed209774b5c3408974c52cfe2aaba4d2e8b4b05b
|
MatrixKit: c3f0bb056ceeb015e2f1688543ac4dbcf88bef2f
|
||||||
MatrixSDK: 9e312e3874027bf9eab61be7d0779102f8bd323a
|
MatrixSDK: 0e2ed8fc6f004cac4b4ab46f038a86fe49ce4007
|
||||||
OLMKit: 9fb4799c4a044dd2c06bda31ec31a12191ad30b5
|
OLMKit: 9fb4799c4a044dd2c06bda31ec31a12191ad30b5
|
||||||
ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d
|
ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d
|
||||||
Realm: b6027801398f3743fc222f096faa85281b506e6c
|
Realm: b6027801398f3743fc222f096faa85281b506e6c
|
||||||
|
@ -226,6 +226,6 @@ SPEC CHECKSUMS:
|
||||||
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
|
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
|
||||||
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb
|
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb
|
||||||
|
|
||||||
PODFILE CHECKSUM: 56547a5087a419eb4461b0fb59380381194392dc
|
PODFILE CHECKSUM: 62cc1ccaaa8e126900f2d3a1d9def9ce814a3216
|
||||||
|
|
||||||
COCOAPODS: 1.11.2
|
COCOAPODS: 1.11.2
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
MXLogWarning(@"[MXSession] E2EE is disabled by default on this homeserver.\nWellknown content: %@", self.homeserverWellknown.JSONDictionary);
|
||||||
success(NO);
|
success(NO);
|
||||||
return [MXHTTPOperation new];
|
return [MXHTTPOperation new];
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ final class RiotSettings: NSObject {
|
||||||
@UserDefault(key: "roomsAllowToJoinPublicRooms", defaultValue: BuildSettings.roomsAllowToJoinPublicRooms, storage: defaults)
|
@UserDefault(key: "roomsAllowToJoinPublicRooms", defaultValue: BuildSettings.roomsAllowToJoinPublicRooms, storage: defaults)
|
||||||
var roomsAllowToJoinPublicRooms
|
var roomsAllowToJoinPublicRooms
|
||||||
|
|
||||||
@UserDefault(key: UserDefaultsKeys.showAllRoomsInHomeSpace, defaultValue: false, storage: defaults)
|
@UserDefault(key: UserDefaultsKeys.showAllRoomsInHomeSpace, defaultValue: true, storage: defaults)
|
||||||
var showAllRoomsInHomeSpace
|
var showAllRoomsInHomeSpace
|
||||||
|
|
||||||
// MARK: - Room Screen
|
// MARK: - Room Screen
|
||||||
|
|
|
@ -228,7 +228,7 @@ extension AppCoordinator: LegacyAppDelegateDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func legacyAppDelegateRestoreEmptyDetailsViewController(_ legacyAppDelegate: LegacyAppDelegate!) {
|
func legacyAppDelegateRestoreEmptyDetailsViewController(_ legacyAppDelegate: LegacyAppDelegate!) {
|
||||||
self.splitViewCoordinator?.restorePlaceholderDetails()
|
self.splitViewCoordinator?.resetDetails(animated: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func legacyAppDelegate(_ legacyAppDelegate: LegacyAppDelegate!, didAddMatrixSession session: MXSession!) {
|
func legacyAppDelegate(_ legacyAppDelegate: LegacyAppDelegate!, didAddMatrixSession session: MXSession!) {
|
||||||
|
|
|
@ -539,11 +539,13 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
|
|
||||||
[self->currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[self->currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
|
|
||||||
self->currentAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n roomErrorJoinFailedTitle] message:msg preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n roomErrorJoinFailedTitle]
|
||||||
|
message:msg
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
|
|
||||||
|
@ -553,7 +555,8 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
}
|
}
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self presentViewController:self->currentAlert animated:YES completion:nil];
|
[self presentViewController:errorAlert animated:YES completion:nil];
|
||||||
|
currentAlert = errorAlert;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Sticky Headers
|
#pragma mark - Sticky Headers
|
||||||
|
@ -1202,13 +1205,13 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
}
|
}
|
||||||
|
|
||||||
// confirm leave
|
// confirm leave
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:title
|
UIAlertController *leavePrompt = [UIAlertController alertControllerWithTitle:title
|
||||||
message:message
|
message:message
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
[leavePrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||||
style:UIAlertActionStyleCancel
|
style:UIAlertActionStyleCancel
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -1218,8 +1221,8 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n leave]
|
[leavePrompt addAction:[UIAlertAction actionWithTitle:[VectorL10n leave]
|
||||||
style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -1280,8 +1283,9 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier:@"LeaveEditedRoomAlert"];
|
[leavePrompt mxk_setAccessibilityIdentifier:@"LeaveEditedRoomAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:leavePrompt animated:YES completion:nil];
|
||||||
|
currentAlert = leavePrompt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1836,11 +1840,11 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
|
|
||||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
|
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomRecentsStartChatWith]
|
[actionSheet addAction:[UIAlertAction actionWithTitle:[VectorL10n roomRecentsStartChatWith]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -1852,9 +1856,9 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomRecentsCreateEmptyRoom]
|
[actionSheet addAction:[UIAlertAction actionWithTitle:[VectorL10n roomRecentsCreateEmptyRoom]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -1866,9 +1870,9 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomRecentsJoinRoom]
|
[actionSheet addAction:[UIAlertAction actionWithTitle:[VectorL10n roomRecentsJoinRoom]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -1882,10 +1886,9 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
|
|
||||||
if (self.mainSession.callManager.supportsPSTN)
|
if (self.mainSession.callManager.supportsPSTN)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction
|
[actionSheet addAction:[UIAlertAction actionWithTitle:[VectorL10n roomOpenDialpad]
|
||||||
actionWithTitle:[VectorL10n roomOpenDialpad]
|
style:UIAlertActionStyleDefault
|
||||||
style:UIAlertActionStyleDefault
|
handler:^(UIAlertAction * action) {
|
||||||
handler:^(UIAlertAction * action) {
|
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -1898,9 +1901,9 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
}]];
|
}]];
|
||||||
}
|
}
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
[actionSheet addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||||
style:UIAlertActionStyleCancel
|
style:UIAlertActionStyleCancel
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -1910,11 +1913,12 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert popoverPresentationController].sourceView = plusButtonImageView;
|
[actionSheet popoverPresentationController].sourceView = plusButtonImageView;
|
||||||
[currentAlert popoverPresentationController].sourceRect = plusButtonImageView.bounds;
|
[actionSheet popoverPresentationController].sourceRect = plusButtonImageView.bounds;
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier:@"RecentsVCCreateRoomAlert"];
|
[actionSheet mxk_setAccessibilityIdentifier:@"RecentsVCCreateRoomAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:actionSheet animated:YES completion:nil];
|
||||||
|
currentAlert = actionSheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)openDialpad
|
- (void)openDialpad
|
||||||
|
@ -2008,7 +2012,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether the user has already joined the selected public room
|
// Check whether the user has already joined the selected public room
|
||||||
if ([self.recentsDataSource.publicRoomsDirectoryDataSource.mxSession roomWithRoomId:publicRoom.roomId])
|
if ([self.recentsDataSource.publicRoomsDirectoryDataSource.mxSession isJoinedOnRoom:publicRoom.roomId])
|
||||||
{
|
{
|
||||||
// Open the public room
|
// Open the public room
|
||||||
[self showRoomWithRoomId:publicRoom.roomId
|
[self showRoomWithRoomId:publicRoom.roomId
|
||||||
|
|
|
@ -20,7 +20,12 @@ import Foundation
|
||||||
public class RecentsListService: NSObject, RecentsListServiceProtocol {
|
public class RecentsListService: NSObject, RecentsListServiceProtocol {
|
||||||
|
|
||||||
private weak var session: MXSession?
|
private weak var session: MXSession?
|
||||||
public private(set) var mode: RecentsDataSourceMode
|
public private(set) var mode: RecentsDataSourceMode {
|
||||||
|
didSet {
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public private(set) var query: String?
|
public private(set) var query: String?
|
||||||
public private(set) var space: MXSpace?
|
public private(set) var space: MXSpace?
|
||||||
|
|
||||||
|
@ -427,7 +432,7 @@ public class RecentsListService: NSObject, RecentsListServiceProtocol {
|
||||||
private func updateDirectFetcher(_ fetcher: MXRoomListDataFetcher, for mode: RecentsDataSourceMode) {
|
private func updateDirectFetcher(_ fetcher: MXRoomListDataFetcher, for mode: RecentsDataSourceMode) {
|
||||||
switch mode {
|
switch mode {
|
||||||
case .home:
|
case .home:
|
||||||
fetcher.fetchOptions.filterOptions.notDataTypes = [.invited, .lowPriority]
|
fetcher.fetchOptions.filterOptions.notDataTypes = [.invited, .favorited, .lowPriority]
|
||||||
case .people:
|
case .people:
|
||||||
fetcher.fetchOptions.filterOptions.notDataTypes = [.lowPriority]
|
fetcher.fetchOptions.filterOptions.notDataTypes = [.lowPriority]
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -60,6 +60,18 @@ public class MockRoomSummary: NSObject, MXRoomSummaryProtocol {
|
||||||
|
|
||||||
public var highlightCount: UInt = 0
|
public var highlightCount: UInt = 0
|
||||||
|
|
||||||
|
public var hasAnyUnread: Bool {
|
||||||
|
return localUnreadEventCount > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
public var hasAnyNotification: Bool {
|
||||||
|
return notificationCount > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
public var hasAnyHighlight: Bool {
|
||||||
|
return highlightCount > 0
|
||||||
|
}
|
||||||
|
|
||||||
public var isDirect: Bool {
|
public var isDirect: Bool {
|
||||||
return isTyped(.direct)
|
return isTyped(.direct)
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@
|
||||||
MXPublicRoom *publicRoom = [dataSource roomAtIndexPath:indexPath];
|
MXPublicRoom *publicRoom = [dataSource roomAtIndexPath:indexPath];
|
||||||
|
|
||||||
// Check whether the user has already joined the selected public room
|
// Check whether the user has already joined the selected public room
|
||||||
if ([dataSource.mxSession roomWithRoomId:publicRoom.roomId])
|
if ([dataSource.mxSession isJoinedOnRoom:publicRoom.roomId])
|
||||||
{
|
{
|
||||||
// Open the public room.
|
// Open the public room.
|
||||||
[self showRoomWithId:publicRoom.roomId inMatrixSession:dataSource.mxSession];
|
[self showRoomWithId:publicRoom.roomId inMatrixSession:dataSource.mxSession];
|
||||||
|
|
|
@ -105,7 +105,7 @@ final class EditHistoryViewModel: EditHistoryViewModelType {
|
||||||
|
|
||||||
self.update(viewState: .loading)
|
self.update(viewState: .loading)
|
||||||
|
|
||||||
self.operation = self.aggregations.replaceEvents(forEvent: self.event.eventId, isEncrypted: self.event.isEncrypted, inRoom: self.roomId, from: self.nextBatch, limit: Pagination.count, success: { [weak self] (response) in
|
self.operation = self.aggregations.replaceEvents(forEvent: self.event.eventId, isEncrypted: self.event.isEncrypted, inRoom: self.roomId, from: self.nextBatch, limit: Int(Pagination.count), success: { [weak self] (response) in
|
||||||
guard let sself = self else {
|
guard let sself = self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ final class ReactionHistoryViewModel: ReactionHistoryViewModelType {
|
||||||
|
|
||||||
self.update(viewState: .loading)
|
self.update(viewState: .loading)
|
||||||
|
|
||||||
self.operation = self.aggregations.reactionsEvents(forEvent: self.eventId, inRoom: self.roomId, from: self.nextBatch, limit: Pagination.count, success: { [weak self] (response) in
|
self.operation = self.aggregations.reactionsEvents(forEvent: self.eventId, inRoom: self.roomId, from: self.nextBatch, limit: Int(Pagination.count), success: { [weak self] (response) in
|
||||||
guard let self = self else {
|
guard let self = self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,10 +104,12 @@ final class RoomCoordinator: NSObject, RoomCoordinatorProtocol {
|
||||||
// FIXME: Find a better way to manage modal dismiss. This makes the `roomViewController` to never be released
|
// FIXME: Find a better way to manage modal dismiss. This makes the `roomViewController` to never be released
|
||||||
// self.roomViewController.presentationController?.delegate = self
|
// self.roomViewController.presentationController?.delegate = self
|
||||||
|
|
||||||
if let threadId = self.parameters.threadId {
|
if let previewData = self.parameters.previewData {
|
||||||
|
self.loadRoomPreview(withData: previewData, completion: completion)
|
||||||
|
} else if let threadId = self.parameters.threadId {
|
||||||
self.loadRoom(withId: self.parameters.roomId, andThreadId: threadId, completion: completion)
|
self.loadRoom(withId: self.parameters.roomId, andThreadId: threadId, completion: completion)
|
||||||
} else if let eventId = self.selectedEventId {
|
} else if let eventId = self.selectedEventId {
|
||||||
self.loadRoom(withId: self.parameters.roomId, andEventId: eventId, completion: completion)
|
self.loadRoom(withId: self.parameters.roomId, and: eventId, completion: completion)
|
||||||
} else {
|
} else {
|
||||||
self.loadRoom(withId: self.parameters.roomId, completion: completion)
|
self.loadRoom(withId: self.parameters.roomId, completion: completion)
|
||||||
}
|
}
|
||||||
|
@ -198,35 +200,43 @@ final class RoomCoordinator: NSObject, RoomCoordinatorProtocol {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func loadRoom(withId roomId: String, andThreadId threadId: String, completion: (() -> Void)?) {
|
private func loadRoom(withId roomId: String, andThreadId threadId: String, completion: (() -> Void)?) {
|
||||||
|
|
||||||
// Present activity indicator when retrieving roomDataSource for given room ID
|
// Present activity indicator when retrieving roomDataSource for given room ID
|
||||||
self.activityIndicatorPresenter.presentActivityIndicator(on: roomViewController.view, animated: false)
|
self.activityIndicatorPresenter.presentActivityIndicator(on: roomViewController.view, animated: false)
|
||||||
|
|
||||||
// Open the room on the requested event
|
// Open the room on the requested event
|
||||||
ThreadDataSource.load(withRoomId: roomId,
|
ThreadDataSource.load(withRoomId: roomId,
|
||||||
initialEventId: nil,
|
initialEventId: nil,
|
||||||
threadId: threadId,
|
threadId: threadId,
|
||||||
andMatrixSession: self.parameters.session) { [weak self] (dataSource) in
|
andMatrixSession: self.parameters.session) { [weak self] (dataSource) in
|
||||||
|
|
||||||
guard let self = self else {
|
guard let self = self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
self.activityIndicatorPresenter.removeCurrentActivityIndicator(animated: true)
|
self.activityIndicatorPresenter.removeCurrentActivityIndicator(animated: true)
|
||||||
|
|
||||||
guard let threadDataSource = dataSource as? ThreadDataSource else {
|
guard let threadDataSource = dataSource as? ThreadDataSource else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
threadDataSource.markTimelineInitialEvent = false
|
threadDataSource.markTimelineInitialEvent = false
|
||||||
self.roomViewController.displayRoom(threadDataSource)
|
self.roomViewController.displayRoom(threadDataSource)
|
||||||
|
|
||||||
// Give the data source ownership to the room view controller.
|
// Give the data source ownership to the room view controller.
|
||||||
self.roomViewController.hasRoomDataSourceOwnership = true
|
self.roomViewController.hasRoomDataSourceOwnership = true
|
||||||
|
|
||||||
completion?()
|
completion?()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func loadRoomPreview(withData previewData: RoomPreviewData, completion: (() -> Void)?) {
|
||||||
|
|
||||||
|
self.roomViewController.displayRoomPreview(previewData)
|
||||||
|
|
||||||
|
completion?()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - RoomIdentifiable
|
// MARK: - RoomIdentifiable
|
||||||
|
|
|
@ -1117,16 +1117,12 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
if (self.roomDataSource)
|
if (self.roomDataSource)
|
||||||
{
|
{
|
||||||
// Restore tool bar view and room activities view if none
|
// Update the input toolbar class and update the layout
|
||||||
if (!self.inputToolbarView)
|
[self updateRoomInputToolbarViewClassIfNeeded];
|
||||||
{
|
|
||||||
[self updateRoomInputToolbarViewClassIfNeeded];
|
|
||||||
|
|
||||||
[self refreshRoomInputToolbar];
|
|
||||||
|
|
||||||
self.inputToolbarView.hidden = (self.roomDataSource.state != MXKDataSourceStateReady);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
self.inputToolbarView.hidden = (self.roomDataSource.state != MXKDataSourceStateReady);
|
||||||
|
|
||||||
|
// Restore room activities view if none
|
||||||
if (!self.activitiesView)
|
if (!self.activitiesView)
|
||||||
{
|
{
|
||||||
// And the extra area
|
// And the extra area
|
||||||
|
@ -1211,6 +1207,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
}
|
}
|
||||||
|
|
||||||
[self updateInputToolBarViewHeight];
|
[self updateInputToolBarViewHeight];
|
||||||
|
[self refreshRoomInputToolbar];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2122,20 +2119,22 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
[VectorL10n widgetStickerPickerNoStickerpacksAlert],
|
[VectorL10n widgetStickerPickerNoStickerpacksAlert],
|
||||||
[VectorL10n widgetStickerPickerNoStickerpacksAlertAddNow]];
|
[VectorL10n widgetStickerPickerNoStickerpacksAlertAddNow]];
|
||||||
|
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:nil message:alertMessage preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *installPrompt = [UIAlertController alertControllerWithTitle:nil
|
||||||
|
message:alertMessage
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n no]
|
[installPrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n no]
|
||||||
style:UIAlertActionStyleCancel
|
style:UIAlertActionStyleCancel
|
||||||
handler:^(UIAlertAction * action)
|
handler:^(UIAlertAction * action)
|
||||||
{
|
{
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n yes]
|
[installPrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n yes]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action)
|
handler:^(UIAlertAction * action)
|
||||||
{
|
{
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
|
@ -2150,8 +2149,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
[self presentViewController:modularVC animated:NO completion:nil];
|
[self presentViewController:modularVC animated:NO completion:nil];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier:@"RoomVCStickerPickerAlert"];
|
[installPrompt mxk_setAccessibilityIdentifier:@"RoomVCStickerPickerAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:installPrompt animated:YES completion:nil];
|
||||||
|
currentAlert = installPrompt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3205,7 +3205,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
}
|
}
|
||||||
|
|
||||||
MXWeakify(self);
|
MXWeakify(self);
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
UIAlertController *actionsMenu = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
||||||
|
|
||||||
BOOL showThreadOption = RiotSettings.shared.enableThreads
|
BOOL showThreadOption = RiotSettings.shared.enableThreads
|
||||||
&& !self.roomDataSource.threadId
|
&& !self.roomDataSource.threadId
|
||||||
|
@ -3226,9 +3226,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
// Add actions for a failed event
|
// Add actions for a failed event
|
||||||
if (selectedEvent.sentState == MXEventSentStateFailed)
|
if (selectedEvent.sentState == MXEventSentStateFailed)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n retry]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n retry]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3237,9 +3237,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
[self.roomDataSource resendEventWithEventId:selectedEvent.eventId success:nil failure:nil];
|
[self.roomDataSource resendEventWithEventId:selectedEvent.eventId success:nil failure:nil];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionDelete]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionDelete]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3269,9 +3269,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
selectedEvent.sentState == MXEventSentStateEncrypting ||
|
selectedEvent.sentState == MXEventSentStateEncrypting ||
|
||||||
selectedEvent.sentState == MXEventSentStateSending)
|
selectedEvent.sentState == MXEventSentStateSending)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionCancelSend]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionCancelSend]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
|
@ -3285,9 +3285,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedEvent.sentState == MXEventSentStateSent) {
|
if (selectedEvent.sentState == MXEventSentStateSent) {
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionForward]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionForward]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
[self presentEventForwardingDialogForSelectedEvent:selectedEvent];
|
[self presentEventForwardingDialogForSelectedEvent:selectedEvent];
|
||||||
}]];
|
}]];
|
||||||
|
@ -3309,9 +3309,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
if (!isJitsiCallEvent)
|
if (!isJitsiCallEvent)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionQuote]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionQuote]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3326,9 +3326,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
if (!isJitsiCallEvent && BuildSettings.messageDetailsAllowShare)
|
if (!isJitsiCallEvent && BuildSettings.messageDetailsAllowShare)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionShare]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionShare]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3355,9 +3355,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
attachment.type == MXKAttachmentTypeImage ||
|
attachment.type == MXKAttachmentTypeImage ||
|
||||||
attachment.type == MXKAttachmentTypeVideo ||
|
attachment.type == MXKAttachmentTypeVideo ||
|
||||||
attachment.type == MXKAttachmentTypeVoiceMessage)) {
|
attachment.type == MXKAttachmentTypeVoiceMessage)) {
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionForward]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionForward]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
[self presentEventForwardingDialogForSelectedEvent:selectedEvent];
|
[self presentEventForwardingDialogForSelectedEvent:selectedEvent];
|
||||||
}]];
|
}]];
|
||||||
|
@ -3367,9 +3367,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
{
|
{
|
||||||
if (attachment.type == MXKAttachmentTypeImage || attachment.type == MXKAttachmentTypeVideo)
|
if (attachment.type == MXKAttachmentTypeImage || attachment.type == MXKAttachmentTypeVideo)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionSave]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionSave]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3404,9 +3404,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
NSString *uploadId = roomBubbleTableViewCell.bubbleData.attachment.contentURL;
|
NSString *uploadId = roomBubbleTableViewCell.bubbleData.attachment.contentURL;
|
||||||
if ([MXMediaManager existingUploaderWithId:uploadId])
|
if ([MXMediaManager existingUploaderWithId:uploadId])
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionCancelSend]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionCancelSend]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
|
@ -3438,9 +3438,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
{
|
{
|
||||||
if (BuildSettings.messageDetailsAllowShare)
|
if (BuildSettings.messageDetailsAllowShare)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionShare]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionShare]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3485,9 +3485,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
NSString *downloadId = roomBubbleTableViewCell.bubbleData.attachment.downloadId;
|
NSString *downloadId = roomBubbleTableViewCell.bubbleData.attachment.downloadId;
|
||||||
if ([MXMediaManager existingDownloaderWithIdentifier:downloadId])
|
if ([MXMediaManager existingDownloaderWithIdentifier:downloadId])
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionCancelDownload]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionCancelDownload]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3508,9 +3508,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
// because it breaks everything
|
// because it breaks everything
|
||||||
if (selectedEvent.eventType != MXEventTypeRoomEncryption)
|
if (selectedEvent.eventType != MXEventTypeRoomEncryption)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionRedact]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionRedact]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3534,9 +3534,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
if (BuildSettings.messageDetailsAllowPermalink)
|
if (BuildSettings.messageDetailsAllowPermalink)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionPermalink]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionPermalink]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3558,9 +3558,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
// Add reaction history if event contains reactions
|
// Add reaction history if event contains reactions
|
||||||
if (roomBubbleTableViewCell.bubbleData.reactions[selectedEvent.eventId].aggregatedReactionsWithNonZeroCount)
|
if (roomBubbleTableViewCell.bubbleData.reactions[selectedEvent.eventId].aggregatedReactionsWithNonZeroCount)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionReactionHistory]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionReactionHistory]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3572,9 +3572,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
if (BuildSettings.messageDetailsAllowViewSource)
|
if (BuildSettings.messageDetailsAllowViewSource)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionViewSource]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionViewSource]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3587,9 +3587,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
// Add "View Decrypted Source" for e2ee event we can decrypt
|
// Add "View Decrypted Source" for e2ee event we can decrypt
|
||||||
if (selectedEvent.isEncrypted && selectedEvent.clearEvent)
|
if (selectedEvent.isEncrypted && selectedEvent.clearEvent)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionViewDecryptedSource]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionViewDecryptedSource]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
@ -3602,24 +3602,26 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
if (![selectedEvent.sender isEqualToString:self.mainSession.myUser.userId] && RiotSettings.shared.roomContextualMenuShowReportContentOption)
|
if (![selectedEvent.sender isEqualToString:self.mainSession.myUser.userId] && RiotSettings.shared.roomContextualMenuShowReportContentOption)
|
||||||
{
|
{
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionReport]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionReport]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self cancelEventSelection];
|
[self cancelEventSelection];
|
||||||
|
|
||||||
// Prompt user to enter a description of the problem content.
|
// Prompt user to enter a description of the problem content.
|
||||||
self->currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomEventActionReportPromptReason] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *reportReasonAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomEventActionReportPromptReason]
|
||||||
|
message:nil
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[self->currentAlert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
[reportReasonAlert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
||||||
textField.secureTextEntry = NO;
|
textField.secureTextEntry = NO;
|
||||||
textField.placeholder = nil;
|
textField.placeholder = nil;
|
||||||
textField.keyboardType = UIKeyboardTypeDefault;
|
textField.keyboardType = UIKeyboardTypeDefault;
|
||||||
}];
|
}];
|
||||||
|
|
||||||
MXWeakify(self);
|
MXWeakify(self);
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
[reportReasonAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
NSString *text = [self->currentAlert textFields].firstObject.text;
|
NSString *text = [self->currentAlert textFields].firstObject.text;
|
||||||
|
@ -3634,10 +3636,12 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
[self stopActivityIndicator];
|
[self stopActivityIndicator];
|
||||||
|
|
||||||
// Prompt user to ignore content from this user
|
// Prompt user to ignore content from this user
|
||||||
self->currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomEventActionReportPromptIgnoreUser] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *ignoreUserAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomEventActionReportPromptIgnoreUser]
|
||||||
|
message:nil
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
MXWeakify(self);
|
MXWeakify(self);
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n yes] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
[ignoreUserAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n yes] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
|
@ -3659,12 +3663,13 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
}];
|
}];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n no] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
[ignoreUserAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n no] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self presentViewController:self->currentAlert animated:YES completion:nil];
|
[self presentViewController:ignoreUserAlert animated:YES completion:nil];
|
||||||
|
self->currentAlert = ignoreUserAlert;
|
||||||
|
|
||||||
} failure:^(NSError *error) {
|
} failure:^(NSError *error) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
@ -3677,12 +3682,13 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
}];
|
}];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {
|
[reportReasonAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self presentViewController:self->currentAlert animated:YES completion:nil];
|
[self presentViewController:reportReasonAlert animated:YES completion:nil];
|
||||||
|
self->currentAlert = reportReasonAlert;
|
||||||
}]];
|
}]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3701,29 +3707,26 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
[actionsMenu addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
||||||
style:UIAlertActionStyleCancel
|
style:UIAlertActionStyleCancel
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
[self hideContextualMenuAnimated:YES];
|
[self hideContextualMenuAnimated:YES];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
// Do not display empty action sheet
|
// Do not display empty action sheet
|
||||||
if (currentAlert.actions.count > 1)
|
if (actionsMenu.actions.count > 1)
|
||||||
{
|
{
|
||||||
NSInteger bubbleComponentIndex = [roomBubbleTableViewCell.bubbleData bubbleComponentIndexForEventId:selectedEvent.eventId];
|
NSInteger bubbleComponentIndex = [roomBubbleTableViewCell.bubbleData bubbleComponentIndexForEventId:selectedEvent.eventId];
|
||||||
|
|
||||||
CGRect sourceRect = [roomBubbleTableViewCell componentFrameInContentViewForIndex:bubbleComponentIndex];
|
CGRect sourceRect = [roomBubbleTableViewCell componentFrameInContentViewForIndex:bubbleComponentIndex];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier:@"RoomVCEventMenuAlert"];
|
[actionsMenu mxk_setAccessibilityIdentifier:@"RoomVCEventMenuAlert"];
|
||||||
[currentAlert popoverPresentationController].sourceView = roomBubbleTableViewCell;
|
[actionsMenu popoverPresentationController].sourceView = roomBubbleTableViewCell;
|
||||||
[currentAlert popoverPresentationController].sourceRect = sourceRect;
|
[actionsMenu popoverPresentationController].sourceRect = sourceRect;
|
||||||
[self presentViewController:currentAlert animated:animated completion:nil];
|
[self presentViewController:actionsMenu animated:animated completion:nil];
|
||||||
}
|
currentAlert = actionsMenu;
|
||||||
else
|
|
||||||
{
|
|
||||||
currentAlert = nil;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4121,14 +4124,14 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
- (void)showVoiceCallActionSheet
|
- (void)showVoiceCallActionSheet
|
||||||
{
|
{
|
||||||
// Ask the user the kind of the call: voice or dialpad?
|
// Ask the user the kind of the call: voice or dialpad?
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:nil
|
UIAlertController *callActionSheet = [UIAlertController alertControllerWithTitle:nil
|
||||||
message:nil
|
message:nil
|
||||||
preferredStyle:UIAlertControllerStyleActionSheet];
|
preferredStyle:UIAlertControllerStyleActionSheet];
|
||||||
|
|
||||||
__weak typeof(self) weakSelf = self;
|
__weak typeof(self) weakSelf = self;
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomPlaceVoiceCall]
|
[callActionSheet addAction:[UIAlertAction actionWithTitle:[VectorL10n roomPlaceVoiceCall]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -4140,9 +4143,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomOpenDialpad]
|
[callActionSheet addAction:[UIAlertAction actionWithTitle:[VectorL10n roomOpenDialpad]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -4154,9 +4157,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
[callActionSheet addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||||
style:UIAlertActionStyleCancel
|
style:UIAlertActionStyleCancel
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -4166,9 +4169,10 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert popoverPresentationController].barButtonItem = self.navigationItem.rightBarButtonItems.firstObject;
|
[callActionSheet popoverPresentationController].barButtonItem = self.navigationItem.rightBarButtonItems.firstObject;
|
||||||
[currentAlert popoverPresentationController].permittedArrowDirections = UIPopoverArrowDirectionUp;
|
[callActionSheet popoverPresentationController].permittedArrowDirections = UIPopoverArrowDirectionUp;
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:callActionSheet animated:YES completion:nil];
|
||||||
|
currentAlert = callActionSheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)placeCallWithVideo2:(BOOL)video
|
- (void)placeCallWithVideo2:(BOOL)video
|
||||||
|
@ -4220,20 +4224,21 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
MXWeakify(self);
|
MXWeakify(self);
|
||||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
|
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomNoPrivilegesToCreateGroupCall]
|
UIAlertController *unprivilegedAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomNoPrivilegesToCreateGroupCall]
|
||||||
message:nil
|
message:nil
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
[unprivilegedAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action)
|
handler:^(UIAlertAction * action)
|
||||||
{
|
{
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier:@"RoomVCCallAlert"];
|
[unprivilegedAlert mxk_setAccessibilityIdentifier:@"RoomVCCallAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:unprivilegedAlert animated:YES completion:nil];
|
||||||
|
currentAlert = unprivilegedAlert;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5214,6 +5219,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
[VectorL10n roomUnsentMessagesUnknownDevicesNotification] :
|
[VectorL10n roomUnsentMessagesUnknownDevicesNotification] :
|
||||||
[VectorL10n roomUnsentMessagesNotification];
|
[VectorL10n roomUnsentMessagesNotification];
|
||||||
|
|
||||||
|
MXWeakify(self);
|
||||||
RoomActivitiesView *roomActivitiesView = (RoomActivitiesView*) self.activitiesView;
|
RoomActivitiesView *roomActivitiesView = (RoomActivitiesView*) self.activitiesView;
|
||||||
self.activitiesViewExpanded = YES;
|
self.activitiesViewExpanded = YES;
|
||||||
[roomActivitiesView displayUnsentMessagesNotification:notification withResendLink:^{
|
[roomActivitiesView displayUnsentMessagesNotification:notification withResendLink:^{
|
||||||
|
@ -5225,57 +5231,53 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
[self cancelAllUnsentMessages];
|
[self cancelAllUnsentMessages];
|
||||||
|
|
||||||
} andIconTapGesture:^{
|
} andIconTapGesture:^{
|
||||||
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
if (currentAlert)
|
if (self->currentAlert)
|
||||||
{
|
{
|
||||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[self->currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak __typeof(self) weakSelf = self;
|
MXWeakify(self);
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
UIAlertController *resendAlert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomResendUnsentMessages]
|
[resendAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomResendUnsentMessages]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
MXStrongifyAndReturnIfNil(self);
|
||||||
{
|
|
||||||
typeof(self) self = weakSelf;
|
[self resendAllUnsentMessages];
|
||||||
[self resendAllUnsentMessages];
|
self->currentAlert = nil;
|
||||||
self->currentAlert = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomDeleteUnsentMessages]
|
[resendAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n roomDeleteUnsentMessages]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
MXStrongifyAndReturnIfNil(self);
|
||||||
{
|
|
||||||
typeof(self) self = weakSelf;
|
[self cancelAllUnsentMessages];
|
||||||
[self cancelAllUnsentMessages];
|
self->currentAlert = nil;
|
||||||
self->currentAlert = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
[resendAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
||||||
style:UIAlertActionStyleCancel
|
style:UIAlertActionStyleCancel
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
MXStrongifyAndReturnIfNil(self);
|
||||||
{
|
|
||||||
typeof(self) self = weakSelf;
|
self->currentAlert = nil;
|
||||||
self->currentAlert = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier:@"RoomVCUnsentMessagesMenuAlert"];
|
[resendAlert mxk_setAccessibilityIdentifier:@"RoomVCUnsentMessagesMenuAlert"];
|
||||||
[currentAlert popoverPresentationController].sourceView = roomActivitiesView;
|
[resendAlert popoverPresentationController].sourceView = roomActivitiesView;
|
||||||
[currentAlert popoverPresentationController].sourceRect = roomActivitiesView.bounds;
|
[resendAlert popoverPresentationController].sourceRect = roomActivitiesView.bounds;
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:resendAlert animated:YES completion:nil];
|
||||||
|
self->currentAlert = resendAlert;
|
||||||
|
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
@ -5315,13 +5317,13 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n unknownDevicesAlertTitle]
|
UIAlertController *unknownDevicesAlert = [UIAlertController alertControllerWithTitle:[VectorL10n unknownDevicesAlertTitle]
|
||||||
message:[VectorL10n unknownDevicesAlert]
|
message:[VectorL10n unknownDevicesAlert]
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n unknownDevicesVerify]
|
[unknownDevicesAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n unknownDevicesVerify]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -5333,9 +5335,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n unknownDevicesSendAnyway]
|
[unknownDevicesAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n unknownDevicesSendAnyway]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -5356,8 +5358,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier:@"RoomVCUnknownDevicesAlert"];
|
[unknownDevicesAlert mxk_setAccessibilityIdentifier:@"RoomVCUnknownDevicesAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:unknownDevicesAlert animated:YES completion:nil];
|
||||||
|
currentAlert = unknownDevicesAlert;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5419,15 +5422,17 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
- (void)cancelAllUnsentMessages
|
- (void)cancelAllUnsentMessages
|
||||||
{
|
{
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomUnsentMessagesCancelTitle] message:[VectorL10n roomUnsentMessagesCancelMessage] preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *cancelAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomUnsentMessagesCancelTitle]
|
||||||
|
message:[VectorL10n roomUnsentMessagesCancelMessage]
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
MXWeakify(self);
|
MXWeakify(self);
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {
|
[cancelAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n delete] style:UIAlertActionStyleDestructive handler:^(UIAlertAction * action) {
|
[cancelAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n delete] style:UIAlertActionStyleDestructive handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
// Remove unsent event ids
|
// Remove unsent event ids
|
||||||
for (NSUInteger index = 0; index < self.roomDataSource.room.outgoingMessages.count;)
|
for (NSUInteger index = 0; index < self.roomDataSource.room.outgoingMessages.count;)
|
||||||
|
@ -5444,9 +5449,11 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
}
|
}
|
||||||
|
|
||||||
[self refreshActivitiesViewDisplay];
|
[self refreshActivitiesViewDisplay];
|
||||||
|
self->currentAlert = nil;
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:cancelAlert animated:YES completion:nil];
|
||||||
|
currentAlert = cancelAlert;
|
||||||
}
|
}
|
||||||
|
|
||||||
# pragma mark - Encryption Information view
|
# pragma mark - Encryption Information view
|
||||||
|
@ -5680,11 +5687,11 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
// Invite ?
|
// Invite ?
|
||||||
NSString *promptMsg = [VectorL10n roomParticipantsInvitePromptMsg:contact.displayName];
|
NSString *promptMsg = [VectorL10n roomParticipantsInvitePromptMsg:contact.displayName];
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomParticipantsInvitePromptTitle]
|
UIAlertController *invitePrompt = [UIAlertController alertControllerWithTitle:[VectorL10n roomParticipantsInvitePromptTitle]
|
||||||
message:promptMsg
|
message:promptMsg
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
[invitePrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||||
style:UIAlertActionStyleCancel
|
style:UIAlertActionStyleCancel
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
|
@ -5696,7 +5703,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n invite]
|
[invitePrompt addAction:[UIAlertAction actionWithTitle:[VectorL10n invite]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
|
@ -5791,8 +5798,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier:@"RoomVCInviteAlert"];
|
[invitePrompt mxk_setAccessibilityIdentifier:@"RoomVCInviteAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:invitePrompt animated:YES completion:nil];
|
||||||
|
currentAlert = invitePrompt;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Re-request encryption keys
|
#pragma mark - Re-request encryption keys
|
||||||
|
@ -5836,8 +5844,6 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
alert = [UIAlertController alertControllerWithTitle:VectorL10n.rerequestKeysAlertTitle
|
alert = [UIAlertController alertControllerWithTitle:VectorL10n.rerequestKeysAlertTitle
|
||||||
message:[VectorL10n e2eRoomKeyRequestMessage:AppInfo.current.displayName]
|
message:[VectorL10n e2eRoomKeyRequestMessage:AppInfo.current.displayName]
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
currentAlert = alert;
|
|
||||||
|
|
||||||
|
|
||||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
|
@ -5851,7 +5857,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:alert animated:YES completion:nil];
|
||||||
|
currentAlert = alert;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)presentReviewUnverifiedSessionsAlert
|
- (void)presentReviewUnverifiedSessionsAlert
|
||||||
|
@ -6129,18 +6136,19 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||||
[self hideContextualMenuAnimated:YES cancelEventSelection:YES completion:^{
|
[self hideContextualMenuAnimated:YES cancelEventSelection:YES completion:^{
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
self->currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomEventActionDeleteConfirmationTitle]
|
UIAlertController *deleteConfirmation = [UIAlertController alertControllerWithTitle:[VectorL10n roomEventActionDeleteConfirmationTitle]
|
||||||
message:[VectorL10n roomEventActionDeleteConfirmationMessage]
|
message:[VectorL10n roomEventActionDeleteConfirmationMessage]
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
[deleteConfirmation addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n delete] style:UIAlertActionStyleDestructive handler:^(UIAlertAction * action) {
|
[deleteConfirmation addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n delete] style:UIAlertActionStyleDestructive handler:^(UIAlertAction * action) {
|
||||||
[self.roomDataSource removeEventWithEventId:event.eventId];
|
[self.roomDataSource removeEventWithEventId:event.eventId];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self presentViewController:self->currentAlert animated:YES completion:nil];
|
[self presentViewController:deleteConfirmation animated:YES completion:nil];
|
||||||
|
self->currentAlert = deleteConfirmation;
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -542,13 +542,8 @@ TableViewSectionsDelegate>
|
||||||
sectionAbout.headerTitle = VectorL10n.settingsAbout;
|
sectionAbout.headerTitle = VectorL10n.settingsAbout;
|
||||||
|
|
||||||
if (BuildSettings.settingsScreenShowAdvancedSettings)
|
if (BuildSettings.settingsScreenShowAdvancedSettings)
|
||||||
{
|
{
|
||||||
sectionAbout.footerTitle = [NSString stringWithFormat:@"Element %@ (%@) / Olm %@\n%@\n%@",
|
sectionAbout.footerTitle = [self buildAboutSectionFooterTitleWithAccount:account];
|
||||||
AppInfo.current.appVersion.bundleShortVersion,
|
|
||||||
AppInfo.current.appVersion.bundleVersion,
|
|
||||||
[OLMKit versionString],
|
|
||||||
[MatrixKitL10n settingsConfigUserId:account.mxCredentials.userId],
|
|
||||||
[MatrixKitL10n settingsConfigHomeServer:account.mxCredentials.homeServer]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[tmpSections addObject:sectionAbout];
|
[tmpSections addObject:sectionAbout];
|
||||||
|
@ -993,9 +988,11 @@ TableViewSectionsDelegate>
|
||||||
{
|
{
|
||||||
MXWeakify(self);
|
MXWeakify(self);
|
||||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountEmailValidationTitle] message:message preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *validationAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountEmailValidationTitle]
|
||||||
|
message:message
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
[validationAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
[self stopActivityIndicator];
|
[self stopActivityIndicator];
|
||||||
|
@ -1004,14 +1001,15 @@ TableViewSectionsDelegate>
|
||||||
self.newEmailEditingEnabled = NO;
|
self.newEmailEditingEnabled = NO;
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n continue] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
[validationAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n continue] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
[self tryFinaliseAddEmailSession:threePidAddSession withAuthenticationParameters:authenticationParameters
|
[self tryFinaliseAddEmailSession:threePidAddSession withAuthenticationParameters:authenticationParameters
|
||||||
threePidAddManager:threePidAddManager];
|
threePidAddManager:threePidAddManager];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier:@"SettingsVCEmailValidationAlert"];
|
[validationAlert mxk_setAccessibilityIdentifier:@"SettingsVCEmailValidationAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:validationAlert animated:YES completion:nil];
|
||||||
|
currentAlert = validationAlert;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tryFinaliseAddEmailSession:(MX3PidAddSession*)threePidAddSession withAuthenticationParameters:(NSDictionary*)authParams threePidAddManager:(MX3PidAddManager*)threePidAddManager
|
- (void)tryFinaliseAddEmailSession:(MX3PidAddSession*)threePidAddSession withAuthenticationParameters:(NSDictionary*)authParams threePidAddManager:(MX3PidAddManager*)threePidAddManager
|
||||||
|
@ -1051,11 +1049,13 @@ TableViewSectionsDelegate>
|
||||||
MXLogDebug(@"[SettingsViewController] tryFinaliseAddEmailSession: Wrong credentials");
|
MXLogDebug(@"[SettingsViewController] tryFinaliseAddEmailSession: Wrong credentials");
|
||||||
|
|
||||||
// Ask password again
|
// Ask password again
|
||||||
self->currentAlert = [UIAlertController alertControllerWithTitle:nil
|
UIAlertController *passwordPrompt = [UIAlertController alertControllerWithTitle:nil
|
||||||
message:[VectorL10n settingsAdd3pidInvalidPasswordMessage]
|
message:[VectorL10n settingsAdd3pidInvalidPasswordMessage]
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n retry] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
MXWeakify(self);
|
||||||
|
[passwordPrompt addAction:[UIAlertAction actionWithTitle:[VectorL10n retry] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
|
|
||||||
[self showAuthenticationIfNeededForAdding:kMX3PIDMediumEmail withSession:self.mainSession completion:^(NSDictionary *authParams) {
|
[self showAuthenticationIfNeededForAdding:kMX3PIDMediumEmail withSession:self.mainSession completion:^(NSDictionary *authParams) {
|
||||||
|
@ -1063,7 +1063,8 @@ TableViewSectionsDelegate>
|
||||||
}];
|
}];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self presentViewController:self->currentAlert animated:YES completion:nil];
|
[self presentViewController:passwordPrompt animated:YES completion:nil];
|
||||||
|
self->currentAlert = passwordPrompt;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1104,9 +1105,11 @@ TableViewSectionsDelegate>
|
||||||
MXWeakify(self);
|
MXWeakify(self);
|
||||||
|
|
||||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountMsisdnValidationTitle] message:message preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *validationAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountMsisdnValidationTitle]
|
||||||
|
message:message
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
[validationAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
|
@ -1117,13 +1120,13 @@ TableViewSectionsDelegate>
|
||||||
self.newPhoneEditingEnabled = NO;
|
self.newPhoneEditingEnabled = NO;
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
[validationAlert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
||||||
textField.secureTextEntry = NO;
|
textField.secureTextEntry = NO;
|
||||||
textField.placeholder = nil;
|
textField.placeholder = nil;
|
||||||
textField.keyboardType = UIKeyboardTypeDecimalPad;
|
textField.keyboardType = UIKeyboardTypeDecimalPad;
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n submit] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
[validationAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n submit] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
|
||||||
|
@ -1142,8 +1145,9 @@ TableViewSectionsDelegate>
|
||||||
}
|
}
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier: @"SettingsVCMsisdnValidationAlert"];
|
[validationAlert mxk_setAccessibilityIdentifier: @"SettingsVCMsisdnValidationAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:validationAlert animated:YES completion:nil];
|
||||||
|
currentAlert = validationAlert;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)finaliseAddPhoneNumberSession:(MX3PidAddSession*)threePidAddSession withToken:(NSString*)token andAuthenticationParameters:(NSDictionary*)authParams message:(NSString*)message threePidAddManager:(MX3PidAddManager*)threePidAddManager
|
- (void)finaliseAddPhoneNumberSession:(MX3PidAddSession*)threePidAddSession withToken:(NSString*)token andAuthenticationParameters:(NSDictionary*)authParams message:(NSString*)message threePidAddManager:(MX3PidAddManager*)threePidAddManager
|
||||||
|
@ -1182,11 +1186,13 @@ TableViewSectionsDelegate>
|
||||||
MXLogDebug(@"[SettingsViewController] finaliseAddPhoneNumberSession: Wrong authentication credentials");
|
MXLogDebug(@"[SettingsViewController] finaliseAddPhoneNumberSession: Wrong authentication credentials");
|
||||||
|
|
||||||
// Ask password again
|
// Ask password again
|
||||||
self->currentAlert = [UIAlertController alertControllerWithTitle:nil
|
UIAlertController *passwordPrompt = [UIAlertController alertControllerWithTitle:nil
|
||||||
message:[VectorL10n settingsAdd3pidInvalidPasswordMessage]
|
message:[VectorL10n settingsAdd3pidInvalidPasswordMessage]
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n retry] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
MXWeakify(self);
|
||||||
|
[passwordPrompt addAction:[UIAlertAction actionWithTitle:[VectorL10n retry] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
|
|
||||||
[self showAuthenticationIfNeededForAdding:kMX3PIDMediumMSISDN withSession:self.mainSession completion:^(NSDictionary *authParams) {
|
[self showAuthenticationIfNeededForAdding:kMX3PIDMediumMSISDN withSession:self.mainSession completion:^(NSDictionary *authParams) {
|
||||||
|
@ -1194,7 +1200,8 @@ TableViewSectionsDelegate>
|
||||||
}];
|
}];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self presentViewController:self->currentAlert animated:YES completion:nil];
|
[self presentViewController:passwordPrompt animated:YES completion:nil];
|
||||||
|
self->currentAlert = passwordPrompt;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1234,17 +1241,20 @@ TableViewSectionsDelegate>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
self->currentAlert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
MXWeakify(self);
|
||||||
|
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||||
|
MXStrongifyAndReturnIfNil(self);
|
||||||
self->currentAlert = nil;
|
self->currentAlert = nil;
|
||||||
|
|
||||||
// Ask again the sms token
|
// Ask again the sms token
|
||||||
[self showValidationMsisdnDialogWithMessage:message for3PidAddSession:threePidAddSession threePidAddManager:threePidAddManager authenticationParameters:authParams];
|
[self showValidationMsisdnDialogWithMessage:message for3PidAddSession:threePidAddSession threePidAddManager:threePidAddManager authenticationParameters:authParams];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self->currentAlert mxk_setAccessibilityIdentifier: @"SettingsVCErrorAlert"];
|
[errorAlert mxk_setAccessibilityIdentifier: @"SettingsVCErrorAlert"];
|
||||||
[self presentViewController:self->currentAlert animated:YES completion:nil];
|
[self presentViewController:errorAlert animated:YES completion:nil];
|
||||||
|
self->currentAlert = errorAlert;
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
@ -1412,6 +1422,35 @@ TableViewSectionsDelegate>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString*)buildAboutSectionFooterTitleWithAccount:(MXKAccount*)account
|
||||||
|
{
|
||||||
|
NSMutableString *footerText = [NSMutableString new];
|
||||||
|
|
||||||
|
AppInfo *appInfo = AppInfo.current;
|
||||||
|
|
||||||
|
NSString *appName = appInfo.displayName;
|
||||||
|
NSString *appVersion = appInfo.appVersion.bundleShortVersion;
|
||||||
|
NSString *buildVersion = appInfo.appVersion.bundleVersion;
|
||||||
|
|
||||||
|
NSString *appVersionInfo = [NSString stringWithFormat:@"%@ %@ (%@)", appName, appVersion, buildVersion];
|
||||||
|
|
||||||
|
NSString *loggedUserInfo = [MatrixKitL10n settingsConfigUserId:account.mxCredentials.userId];
|
||||||
|
|
||||||
|
NSString *homeserverInfo = [MatrixKitL10n settingsConfigHomeServer:account.mxCredentials.homeServer];
|
||||||
|
|
||||||
|
NSString *sdkVersionInfo = [NSString stringWithFormat:@"Matrix SDK %@", MatrixSDKVersion];
|
||||||
|
|
||||||
|
NSString *olmVersionInfo = [NSString stringWithFormat:@"OLM %@", [OLMKit versionString]];
|
||||||
|
|
||||||
|
[footerText appendFormat:@"%@\n", loggedUserInfo];
|
||||||
|
[footerText appendFormat:@"%@\n", homeserverInfo];
|
||||||
|
[footerText appendFormat:@"%@\n", appVersionInfo];
|
||||||
|
[footerText appendFormat:@"%@\n", sdkVersionInfo];
|
||||||
|
[footerText appendFormat:@"%@", olmVersionInfo];
|
||||||
|
|
||||||
|
return [footerText copy];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - 3Pid Add
|
#pragma mark - 3Pid Add
|
||||||
|
|
||||||
- (void)showAuthenticationIfNeededForAdding:(MX3PIDMedium)medium withSession:(MXSession*)session completion:(void (^)(NSDictionary* authParams))completion
|
- (void)showAuthenticationIfNeededForAdding:(MX3PIDMedium)medium withSession:(MXSession*)session completion:(void (^)(NSDictionary* authParams))completion
|
||||||
|
@ -2620,11 +2659,11 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
__weak typeof(self) weakSelf = self;
|
__weak typeof(self) weakSelf = self;
|
||||||
|
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n settingsUnignoreUser:ignoredUserId] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *unignorePrompt = [UIAlertController alertControllerWithTitle:[VectorL10n settingsUnignoreUser:ignoredUserId] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n yes]
|
[unignorePrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n yes]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -2653,9 +2692,9 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n no]
|
[unignorePrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n no]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -2665,8 +2704,9 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier: @"SettingsVCUnignoreAlert"];
|
[unignorePrompt mxk_setAccessibilityIdentifier: @"SettingsVCUnignoreAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:unignorePrompt animated:YES completion:nil];
|
||||||
|
currentAlert = unignorePrompt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (section == SECTION_TAG_ABOUT)
|
else if (section == SECTION_TAG_ABOUT)
|
||||||
|
@ -2852,9 +2892,9 @@ TableViewSectionsDelegate>
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove ?
|
// Remove ?
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n settingsRemovePromptTitle] message:promptMsg preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *removePrompt = [UIAlertController alertControllerWithTitle:[VectorL10n settingsRemovePromptTitle] message:promptMsg preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
[removePrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||||
style:UIAlertActionStyleCancel
|
style:UIAlertActionStyleCancel
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
|
@ -2866,7 +2906,7 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n remove]
|
[removePrompt addAction:[UIAlertAction actionWithTitle:[VectorL10n remove]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
|
@ -2906,8 +2946,9 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier: @"SettingsVCRemove3PIDAlert"];
|
[removePrompt mxk_setAccessibilityIdentifier: @"SettingsVCRemove3PIDAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:removePrompt animated:YES completion:nil];
|
||||||
|
currentAlert = removePrompt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2929,9 +2970,9 @@ TableViewSectionsDelegate>
|
||||||
NSString *title = [VectorL10n settingsNotificationsDisabledAlertTitle];
|
NSString *title = [VectorL10n settingsNotificationsDisabledAlertTitle];
|
||||||
NSString *message = [VectorL10n settingsNotificationsDisabledAlertMessage];
|
NSString *message = [VectorL10n settingsNotificationsDisabledAlertMessage];
|
||||||
|
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *showSettingsPrompt = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
[showSettingsPrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||||
style:UIAlertActionStyleCancel
|
style:UIAlertActionStyleCancel
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
|
@ -2955,13 +2996,14 @@ TableViewSectionsDelegate>
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[currentAlert addAction:settingsAction];
|
[showSettingsPrompt addAction:settingsAction];
|
||||||
currentAlert.preferredAction = settingsAction;
|
showSettingsPrompt.preferredAction = settingsAction;
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier: @"SettingsVCPushNotificationsAlert"];
|
[showSettingsPrompt mxk_setAccessibilityIdentifier: @"SettingsVCPushNotificationsAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:showSettingsPrompt animated:YES completion:nil];
|
||||||
|
currentAlert = showSettingsPrompt;
|
||||||
|
|
||||||
// Keep off the switch
|
// Keep the the switch off.
|
||||||
sender.on = NO;
|
sender.on = NO;
|
||||||
}
|
}
|
||||||
else if ([MXKAccountManager sharedManager].activeAccounts.count)
|
else if ([MXKAccountManager sharedManager].activeAccounts.count)
|
||||||
|
@ -3356,11 +3398,11 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
|
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -3381,9 +3423,9 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n retry]
|
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n retry]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -3397,8 +3439,9 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier: @"SettingsVCSaveChangesFailedAlert"];
|
[errorAlert mxk_setAccessibilityIdentifier: @"SettingsVCSaveChangesFailedAlert"];
|
||||||
[rootViewController presentViewController:currentAlert animated:YES completion:nil];
|
[rootViewController presentViewController:errorAlert animated:YES completion:nil];
|
||||||
|
currentAlert = errorAlert;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3419,13 +3462,13 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
|
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountErrorEmailWrongTitle]
|
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountErrorEmailWrongTitle]
|
||||||
message:[MatrixKitL10n accountErrorEmailWrongDescription]
|
message:[MatrixKitL10n accountErrorEmailWrongDescription]
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
if (weakSelf)
|
if (weakSelf)
|
||||||
{
|
{
|
||||||
|
@ -3436,8 +3479,9 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier: @"SettingsVCAddEmailAlert"];
|
[errorAlert mxk_setAccessibilityIdentifier: @"SettingsVCAddEmailAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:errorAlert animated:YES completion:nil];
|
||||||
|
currentAlert = errorAlert;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3529,11 +3573,11 @@ TableViewSectionsDelegate>
|
||||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
__weak typeof(self) weakSelf = self;
|
__weak typeof(self) weakSelf = self;
|
||||||
|
|
||||||
currentAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountErrorMsisdnWrongTitle]
|
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountErrorMsisdnWrongTitle]
|
||||||
message:[MatrixKitL10n accountErrorMsisdnWrongDescription]
|
message:[MatrixKitL10n accountErrorMsisdnWrongDescription]
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
|
@ -3545,8 +3589,9 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[currentAlert mxk_setAccessibilityIdentifier: @"SettingsVCAddMsisdnAlert"];
|
[errorAlert mxk_setAccessibilityIdentifier: @"SettingsVCAddMsisdnAlert"];
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[self presentViewController:errorAlert animated:YES completion:nil];
|
||||||
|
currentAlert = errorAlert;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3902,9 +3947,9 @@ TableViewSectionsDelegate>
|
||||||
{
|
{
|
||||||
[self->currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[self->currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
|
|
||||||
self->currentAlert = [UIAlertController alertControllerWithTitle:nil message:[VectorL10n settingsPasswordUpdated] preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *successAlert = [UIAlertController alertControllerWithTitle:nil message:[VectorL10n settingsPasswordUpdated] preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
[successAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
|
@ -3924,8 +3969,9 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self->currentAlert mxk_setAccessibilityIdentifier:@"SettingsVCOnPasswordUpdatedAlert"];
|
[successAlert mxk_setAccessibilityIdentifier:@"SettingsVCOnPasswordUpdatedAlert"];
|
||||||
[self presentViewController:self->currentAlert animated:YES completion:nil];
|
[self presentViewController:successAlert animated:YES completion:nil];
|
||||||
|
self->currentAlert = successAlert;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3950,9 +3996,9 @@ TableViewSectionsDelegate>
|
||||||
{
|
{
|
||||||
[self->currentAlert dismissViewControllerAnimated:NO completion:nil];
|
[self->currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||||
|
|
||||||
self->currentAlert = [UIAlertController alertControllerWithTitle:nil message:[VectorL10n settingsFailToUpdatePassword] preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:nil message:[VectorL10n settingsFailToUpdatePassword] preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
[self->currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
|
||||||
|
@ -3973,8 +4019,9 @@ TableViewSectionsDelegate>
|
||||||
|
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
[self->currentAlert mxk_setAccessibilityIdentifier:@"SettingsVCPasswordChangeFailedAlert"];
|
[errorAlert mxk_setAccessibilityIdentifier:@"SettingsVCPasswordChangeFailedAlert"];
|
||||||
[rootViewController presentViewController:self->currentAlert animated:YES completion:nil];
|
[rootViewController presentViewController:errorAlert animated:YES completion:nil];
|
||||||
|
self->currentAlert = errorAlert;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,9 @@ final class SpaceListViewModel: SpaceListViewModelType {
|
||||||
|
|
||||||
private func loadData() {
|
private func loadData() {
|
||||||
guard let session = self.userSessionsService.mainUserSession?.matrixSession else {
|
guard let session = self.userSessionsService.mainUserSession?.matrixSession else {
|
||||||
|
// If there is no main session, reset current selection and give an empty section list
|
||||||
|
// It can happen when the user make a clear cache or logout
|
||||||
|
self.resetList()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,4 +246,15 @@ final class SpaceListViewModel: SpaceListViewModelType {
|
||||||
return spaceViewData.spaceId
|
return spaceViewData.spaceId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func resetList() {
|
||||||
|
self.sections = []
|
||||||
|
|
||||||
|
let selectedIndexPath = IndexPath(row: 0, section: 0)
|
||||||
|
|
||||||
|
self.selectedIndexPath = selectedIndexPath
|
||||||
|
self.homeIndexPath = selectedIndexPath
|
||||||
|
|
||||||
|
self.update(viewState: .loaded([]))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,20 +125,20 @@ final class SplitViewCoordinator: NSObject, SplitViewCoordinatorType {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Do not expose publicly this method
|
// TODO: Do not expose publicly this method
|
||||||
func restorePlaceholderDetails() {
|
func resetDetails(animated: Bool) {
|
||||||
// Be sure that the primary is then visible too.
|
// Be sure that the primary is then visible too.
|
||||||
if splitViewController.displayMode == .primaryHidden {
|
if splitViewController.displayMode == .primaryHidden {
|
||||||
splitViewController.preferredDisplayMode = .allVisible
|
splitViewController.preferredDisplayMode = .allVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
self.resetDetailNavigationControllerWithPlaceholder(animated: false)
|
self.resetDetailNavigationController(animated: animated)
|
||||||
|
|
||||||
// Release the current selected item (room/contact/group...).
|
// Release the current selected item (room/contact/group...).
|
||||||
self.tabBarCoordinator?.releaseSelectedItems()
|
self.tabBarCoordinator?.releaseSelectedItems()
|
||||||
}
|
}
|
||||||
|
|
||||||
func popToHome(animated: Bool, completion: (() -> Void)?) {
|
func popToHome(animated: Bool, completion: (() -> Void)?) {
|
||||||
self.resetDetailNavigationControllerWithPlaceholder(animated: animated)
|
self.resetDetails(animated: animated)
|
||||||
|
|
||||||
// Force back to the main screen if this is not the one that is displayed
|
// Force back to the main screen if this is not the one that is displayed
|
||||||
self.tabBarCoordinator?.popToHome(animated: animated, completion: completion)
|
self.tabBarCoordinator?.popToHome(animated: animated, completion: completion)
|
||||||
|
@ -172,6 +172,17 @@ final class SplitViewCoordinator: NSObject, SplitViewCoordinatorType {
|
||||||
// Set placeholder screen as root controller of detail navigation controller
|
// Set placeholder screen as root controller of detail navigation controller
|
||||||
let placeholderDetailsVC = self.createPlaceholderDetailsViewController()
|
let placeholderDetailsVC = self.createPlaceholderDetailsViewController()
|
||||||
detailNavigationRouter.setRootModule(placeholderDetailsVC, hideNavigationBar: false, animated: animated, popCompletion: nil)
|
detailNavigationRouter.setRootModule(placeholderDetailsVC, hideNavigationBar: false, animated: animated, popCompletion: nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
private func resetDetailNavigationController(animated: Bool) {
|
||||||
|
|
||||||
|
if self.splitViewController.isCollapsed {
|
||||||
|
if let topMostNavigationController = self.selectedNavigationRouter?.modules.last as? UINavigationController, topMostNavigationController == self.detailNavigationController {
|
||||||
|
self.selectedNavigationRouter?.popModule(animated: animated)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
self.resetDetailNavigationControllerWithPlaceholder(animated: animated)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func isPlaceholderShown(from secondaryViewController: UIViewController) -> Bool {
|
private func isPlaceholderShown(from secondaryViewController: UIViewController) -> Bool {
|
||||||
|
@ -270,7 +281,7 @@ extension SplitViewCoordinator: UISplitViewControllerDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore detail navigation controller with placeholder as root
|
// Restore detail navigation controller with placeholder as root
|
||||||
self.resetDetailNavigationControllerWithPlaceholder(animated: false)
|
self.resetDetailNavigationController(animated: false)
|
||||||
|
|
||||||
// Return up to date detail navigation controller
|
// Return up to date detail navigation controller
|
||||||
// In any cases `detailNavigationController` will be used as secondary view of the split view controller.
|
// In any cases `detailNavigationController` will be used as secondary view of the split view controller.
|
||||||
|
@ -353,6 +364,6 @@ extension SplitViewCoordinator: SplitViewMasterPresentableDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func splitViewMasterPresentableWantsToResetDetail(_ presentable: Presentable) {
|
func splitViewMasterPresentableWantsToResetDetail(_ presentable: Presentable) {
|
||||||
self.resetDetailNavigationControllerWithPlaceholder(animated: false)
|
self.resetDetails(animated: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,10 @@ protocol SplitViewCoordinatorType: Coordinator, Presentable {
|
||||||
/// - Parameter spaceId: The id of the Space to use.
|
/// - Parameter spaceId: The id of the Space to use.
|
||||||
func start(with spaceId: String?)
|
func start(with spaceId: String?)
|
||||||
|
|
||||||
|
/// Restore navigation stack and show home screen
|
||||||
func popToHome(animated: Bool, completion: (() -> Void)?)
|
func popToHome(animated: Bool, completion: (() -> Void)?)
|
||||||
|
|
||||||
// TODO: Do not expose publicly this method
|
// TODO: Do not expose publicly this method
|
||||||
func restorePlaceholderDetails()
|
/// Remove detail screens and display placeholder if needed
|
||||||
|
func resetDetails(animated: Bool)
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,12 @@ class NotificationService: UNNotificationServiceExtension {
|
||||||
private lazy var configuration: Configurable = {
|
private lazy var configuration: Configurable = {
|
||||||
return CommonConfiguration()
|
return CommonConfiguration()
|
||||||
}()
|
}()
|
||||||
|
private lazy var mxRestClient: MXRestClient? = {
|
||||||
|
guard let userAccount = userAccount else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return MXRestClient(credentials: userAccount.mxCredentials, unrecognizedCertificateHandler: nil)
|
||||||
|
}()
|
||||||
private static var isLoggerInitialized: Bool = false
|
private static var isLoggerInitialized: Bool = false
|
||||||
private lazy var pushGatewayRestClient: MXPushGatewayRestClient = {
|
private lazy var pushGatewayRestClient: MXPushGatewayRestClient = {
|
||||||
let url = URL(string: BuildSettings.serverConfigSygnalAPIUrlString)!
|
let url = URL(string: BuildSettings.serverConfigSygnalAPIUrlString)!
|
||||||
|
@ -222,7 +228,7 @@ class NotificationService: UNNotificationServiceExtension {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
self.notificationContent(forEvent: event, forAccount: userAccount) { (notificationContent) in
|
self.notificationContent(forEvent: event, forAccount: userAccount) { (notificationContent, ignoreBadgeUpdate) in
|
||||||
var isUnwantedNotification = false
|
var isUnwantedNotification = false
|
||||||
|
|
||||||
// Modify the notification content here...
|
// Modify the notification content here...
|
||||||
|
@ -240,6 +246,10 @@ class NotificationService: UNNotificationServiceExtension {
|
||||||
isUnwantedNotification = true
|
isUnwantedNotification = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ignoreBadgeUpdate {
|
||||||
|
content.badge = nil
|
||||||
|
}
|
||||||
|
|
||||||
if self.ongoingVoIPPushRequests[event.eventId] == true {
|
if self.ongoingVoIPPushRequests[event.eventId] == true {
|
||||||
// modify the best attempt content, to be able to use in the future
|
// modify the best attempt content, to be able to use in the future
|
||||||
self.bestAttemptContents[event.eventId] = content
|
self.bestAttemptContents[event.eventId] = content
|
||||||
|
@ -279,10 +289,10 @@ class NotificationService: UNNotificationServiceExtension {
|
||||||
MXLog.debug("--------------------------------------------------------------------------------")
|
MXLog.debug("--------------------------------------------------------------------------------")
|
||||||
}
|
}
|
||||||
|
|
||||||
private func notificationContent(forEvent event: MXEvent, forAccount account: MXKAccount, onComplete: @escaping (UNNotificationContent?) -> Void) {
|
private func notificationContent(forEvent event: MXEvent, forAccount account: MXKAccount, onComplete: @escaping (UNNotificationContent?, Bool) -> Void) {
|
||||||
guard let content = event.content, content.count > 0 else {
|
guard let content = event.content, content.count > 0 else {
|
||||||
MXLog.debug("[NotificationService] notificationContentForEvent: empty event content")
|
MXLog.debug("[NotificationService] notificationContentForEvent: empty event content")
|
||||||
onComplete(nil)
|
onComplete(nil, false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,7 +308,7 @@ class NotificationService: UNNotificationServiceExtension {
|
||||||
var notificationTitle: String?
|
var notificationTitle: String?
|
||||||
var notificationBody: String?
|
var notificationBody: String?
|
||||||
var additionalUserInfo: [AnyHashable: Any]?
|
var additionalUserInfo: [AnyHashable: Any]?
|
||||||
|
var ignoreBadgeUpdate = false
|
||||||
var threadIdentifier: String? = roomId
|
var threadIdentifier: String? = roomId
|
||||||
let currentUserId = account.mxCredentials.userId
|
let currentUserId = account.mxCredentials.userId
|
||||||
let roomDisplayName = roomSummary?.displayname
|
let roomDisplayName = roomSummary?.displayname
|
||||||
|
@ -322,7 +332,25 @@ class NotificationService: UNNotificationServiceExtension {
|
||||||
if let callInviteContent = MXCallInviteEventContent(fromJSON: event.content),
|
if let callInviteContent = MXCallInviteEventContent(fromJSON: event.content),
|
||||||
callInviteContent.lifetime > event.age,
|
callInviteContent.lifetime > event.age,
|
||||||
(callInviteContent.lifetime - event.age) > UInt(NSE.Constants.timeNeededToSendVoIPPushes * MSEC_PER_SEC) {
|
(callInviteContent.lifetime - event.age) > UInt(NSE.Constants.timeNeededToSendVoIPPushes * MSEC_PER_SEC) {
|
||||||
|
NotificationService.backgroundSyncService.roomAccountData(forRoomId: roomId) { response in
|
||||||
|
if let accountData = response.value, accountData.virtualRoomInfo.isVirtual {
|
||||||
|
self.sendReadReceipt(forEvent: event)
|
||||||
|
ignoreBadgeUpdate = true
|
||||||
|
}
|
||||||
|
self.validateNotificationContentAndComplete(
|
||||||
|
notificationTitle: notificationTitle,
|
||||||
|
notificationBody: notificationBody,
|
||||||
|
additionalUserInfo: additionalUserInfo,
|
||||||
|
ignoreBadgeUpdate: ignoreBadgeUpdate,
|
||||||
|
threadIdentifier: threadIdentifier,
|
||||||
|
currentUserId: currentUserId,
|
||||||
|
event: event,
|
||||||
|
pushRule: pushRule,
|
||||||
|
onComplete: onComplete
|
||||||
|
)
|
||||||
|
}
|
||||||
self.sendVoipPush(forEvent: event)
|
self.sendVoipPush(forEvent: event)
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
MXLog.debug("[NotificationService] notificationContent: Do not attempt to send a VoIP push, there is not enough time to process it.")
|
MXLog.debug("[NotificationService] notificationContent: Do not attempt to send a VoIP push, there is not enough time to process it.")
|
||||||
}
|
}
|
||||||
|
@ -351,7 +379,7 @@ class NotificationService: UNNotificationServiceExtension {
|
||||||
#warning("In practice, this only hides the notification's content. An empty notification may be less useful in this instance?")
|
#warning("In practice, this only hides the notification's content. An empty notification may be less useful in this instance?")
|
||||||
// Ignore this notif.
|
// Ignore this notif.
|
||||||
MXLog.debug("[NotificationService] notificationContentForEvent: Ignore non highlighted notif in mentions only room")
|
MXLog.debug("[NotificationService] notificationContentForEvent: Ignore non highlighted notif in mentions only room")
|
||||||
onComplete(nil)
|
onComplete(nil, false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -475,35 +503,63 @@ class NotificationService: UNNotificationServiceExtension {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.localAuthenticationService.isProtectionSet {
|
|
||||||
MXLog.debug("[NotificationService] notificationContentForEvent: Resetting title and body because app protection is set")
|
|
||||||
notificationBody = NSString.localizedUserNotificationString(forKey: "MESSAGE_PROTECTED", arguments: [])
|
|
||||||
notificationTitle = nil
|
|
||||||
}
|
|
||||||
|
|
||||||
guard notificationBody != nil else {
|
self.validateNotificationContentAndComplete(
|
||||||
MXLog.debug("[NotificationService] notificationContentForEvent: notificationBody is nil")
|
notificationTitle: notificationTitle,
|
||||||
onComplete(nil)
|
notificationBody: notificationBody,
|
||||||
return
|
additionalUserInfo: additionalUserInfo,
|
||||||
}
|
ignoreBadgeUpdate: ignoreBadgeUpdate,
|
||||||
|
threadIdentifier: threadIdentifier,
|
||||||
let notificationContent = self.notificationContent(withTitle: notificationTitle,
|
currentUserId: currentUserId,
|
||||||
body: notificationBody,
|
event: event,
|
||||||
threadIdentifier: threadIdentifier,
|
pushRule: pushRule,
|
||||||
userId: currentUserId,
|
onComplete: onComplete
|
||||||
event: event,
|
)
|
||||||
pushRule: pushRule,
|
|
||||||
additionalInfo: additionalUserInfo)
|
|
||||||
|
|
||||||
MXLog.debug("[NotificationService] notificationContentForEvent: Calling onComplete.")
|
|
||||||
onComplete(notificationContent)
|
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
MXLog.debug("[NotificationService] notificationContentForEvent: error: \(error)")
|
MXLog.debug("[NotificationService] notificationContentForEvent: error: \(error)")
|
||||||
onComplete(nil)
|
onComplete(nil, false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func validateNotificationContentAndComplete(
|
||||||
|
notificationTitle: String?,
|
||||||
|
notificationBody: String?,
|
||||||
|
additionalUserInfo: [AnyHashable: Any]?,
|
||||||
|
ignoreBadgeUpdate: Bool,
|
||||||
|
threadIdentifier: String?,
|
||||||
|
currentUserId: String?,
|
||||||
|
event: MXEvent,
|
||||||
|
pushRule: MXPushRule?,
|
||||||
|
onComplete: @escaping (UNNotificationContent?, Bool) -> Void
|
||||||
|
) {
|
||||||
|
|
||||||
|
var validatedNotificationBody: String? = notificationBody
|
||||||
|
var validatedNotificationTitle: String? = notificationTitle
|
||||||
|
if self.localAuthenticationService.isProtectionSet {
|
||||||
|
MXLog.debug("[NotificationService] validateNotificationContentAndComplete: Resetting title and body because app protection is set")
|
||||||
|
validatedNotificationBody = NSString.localizedUserNotificationString(forKey: "MESSAGE_PROTECTED", arguments: [])
|
||||||
|
validatedNotificationTitle = nil
|
||||||
|
}
|
||||||
|
|
||||||
|
guard validatedNotificationBody != nil else {
|
||||||
|
MXLog.debug("[NotificationService] validateNotificationContentAndComplete: notificationBody is nil")
|
||||||
|
onComplete(nil, false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let notificationContent = self.notificationContent(withTitle: validatedNotificationTitle,
|
||||||
|
body: validatedNotificationBody,
|
||||||
|
threadIdentifier: threadIdentifier,
|
||||||
|
userId: currentUserId,
|
||||||
|
event: event,
|
||||||
|
pushRule: pushRule,
|
||||||
|
additionalInfo: additionalUserInfo)
|
||||||
|
|
||||||
|
MXLog.debug("[NotificationService] validateNotificationContentAndComplete: Calling onComplete.")
|
||||||
|
onComplete(notificationContent, ignoreBadgeUpdate)
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the default title for message notifications.
|
/// Returns the default title for message notifications.
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - eventSenderName: The displayname of the sender.
|
/// - eventSenderName: The displayname of the sender.
|
||||||
|
@ -710,4 +766,23 @@ class NotificationService: UNNotificationServiceExtension {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func sendReadReceipt(forEvent event: MXEvent) {
|
||||||
|
guard let mxRestClient = mxRestClient else {
|
||||||
|
MXLog.error("[NotificationService] sendReadReceipt: Missing mxRestClient for read receipt request.")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
guard let eventId = event.eventId,
|
||||||
|
let roomId = event.roomId else {
|
||||||
|
MXLog.error("[NotificationService] sendReadReceipt: Event information missing for read receipt request.")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
mxRestClient.sendReadReceipt(toRoom: roomId, forEvent: eventId) { response in
|
||||||
|
if response.isSuccess {
|
||||||
|
MXLog.debug("[NotificationService] sendReadReceipt: Read receipt send successfully.")
|
||||||
|
} else if let error = response.error {
|
||||||
|
MXLog.error("[NotificationService] sendReadReceipt: Read receipt send failed with error \(error).")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Using mutable room list fetch sort options after chaning them to be a structure.
|
|
|
@ -1 +0,0 @@
|
||||||
Share Extension: Remove the image compression prompt when the showMediaSizeSelection setting is disabled.
|
|
|
@ -1 +0,0 @@
|
||||||
Replaced GrowingTextView with simpler, custom implementation. Cleaned up the RoomInputToolbar header.
|
|
1
changelog.d/4984.misc
Normal file
1
changelog.d/4984.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix redundancy in heading in the bug report issue form
|
|
@ -1 +0,0 @@
|
||||||
Improve wording around rageshakes in the defect issue template.
|
|
|
@ -1 +0,0 @@
|
||||||
Fixed share extension and message forwarding room list accessory view icon.
|
|
|
@ -1 +0,0 @@
|
||||||
Fixed message composer not following keyboard when swiping to dismiss.
|
|
|
@ -1 +0,0 @@
|
||||||
RoomVC: Fix retain cycles that prevents `RoomViewController` to be deallocated.
|
|
|
@ -1 +0,0 @@
|
||||||
Share Extension: Fix missing avatars and don't list spaces as rooms.
|
|
|
@ -1 +0,0 @@
|
||||||
Fix retain cycles that prevents deallocation in several classes.
|
|
|
@ -1 +0,0 @@
|
||||||
Fixed retain cycles between the user suggestion coordinator and the suggestion service, and in the suggestion service currentTextTrigger subject sink.
|
|
1
changelog.d/5153.misc
Normal file
1
changelog.d/5153.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Update automation for issue triage
|
1
changelog.d/5155.bugfix
Normal file
1
changelog.d/5155.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Ignore badge updates from virtual rooms.
|
Loading…
Reference in a new issue