Skip to content

Commit f72d529

Browse files
committed
Merge branch 'release/0.22.2/master'
2 parents 205d60a + f1f7211 commit f72d529

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1417
-206
lines changed

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
source .synapse/bin/activate
9595
pip install synapse matrix-synapse
9696
curl -sL https://raw.githubusercontent.com/matrix-org/synapse/develop/demo/start.sh \
97-
| sed s/127.0.0.1/0.0.0.0/g | bash
97+
| sed s/127.0.0.1/0.0.0.0/g | bash -s -- "--no-rate-limit"
9898
9999
- name: Bundle install
100100
run: |

CHANGES.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## Changes in 0.22.2 (2022-02-22)
2+
3+
🙌 Improvements
4+
5+
- Added support for unstable poll prefixes. ([#5114](https://github.com/vector-im/element-ios/issues/5114))
6+
- Exclude all files and directories from iCloud and iTunes backup ([#5498](https://github.com/vector-im/element-ios/issues/5498))
7+
- MXSession & MXThreadingService: Implement server capabilities api & implement thread list api according to server capabilities. ([#5540](https://github.com/vector-im/element-ios/issues/5540))
8+
- MXThreadEventTimeline: Replace context api with relations api. ([#5629](https://github.com/vector-im/element-ios/issues/5629))
9+
10+
🐛 Bugfixes
11+
12+
- Settings: fix phone number validation through custom URL ([#3562](https://github.com/vector-im/element-ios/issues/3562))
13+
- MXRoomListData: Consider all properties when comparing room list data. ([#5537](https://github.com/vector-im/element-ios/issues/5537))
14+
15+
🧱 Build
16+
17+
- Use the --no-rate-limit flag as mentioned in the README ([#1352](https://github.com/vector-im/element-ios/issues/1352))
18+
19+
120
## Changes in 0.22.1 (2022-02-16)
221

322
🐛 Bugfixes

MatrixSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "MatrixSDK"
4-
s.version = "0.22.1"
4+
s.version = "0.22.2"
55
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"
66

77
s.description = <<-DESC

MatrixSDK.xcodeproj/project.pbxproj

Lines changed: 86 additions & 0 deletions
Large diffs are not rendered by default.

MatrixSDK/Aggregations/MXAggregations.m

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ - (MXHTTPOperation*)reactionsEventsForEvent:(NSString*)eventId
9898
inRoom:roomId
9999
relationType:MXEventRelationTypeAnnotation
100100
eventType:kMXEventTypeStringReaction
101-
from:from
101+
from:from
102+
direction:MXTimelineDirectionBackwards
102103
limit:limit
103104
success:success
104105
failure:failure];
@@ -131,7 +132,15 @@ - (MXHTTPOperation*)replaceEventsForEvent:(NSString*)eventId
131132
failure:(void (^)(NSError *error))failure
132133
{
133134
NSString *eventType = isEncrypted ? kMXEventTypeStringRoomEncrypted : kMXEventTypeStringRoomMessage;
134-
return [self.mxSession.matrixRestClient relationsForEvent:eventId inRoom:roomId relationType:MXEventRelationTypeReplace eventType:eventType from:from limit:limit success:success failure:failure];
135+
return [self.mxSession.matrixRestClient relationsForEvent:eventId
136+
inRoom:roomId
137+
relationType:MXEventRelationTypeReplace
138+
eventType:eventType
139+
from:from
140+
direction:MXTimelineDirectionBackwards
141+
limit:limit
142+
success:success
143+
failure:failure];
135144
}
136145

137146
- (MXHTTPOperation*)referenceEventsForEvent:(NSString*)eventId
@@ -183,7 +192,14 @@ - (MXHTTPOperation*)referenceEventsForEvent:(NSString*)eventId
183192

184193
if (!event)
185194
{
186-
operation = [self.mxSession.matrixRestClient relationsForEvent:eventId inRoom:roomId relationType:MXEventRelationTypeReference eventType:nil from:from limit:limit success:^(MXAggregationPaginatedResponse *paginatedResponse) {
195+
operation = [self.mxSession.matrixRestClient relationsForEvent:eventId
196+
inRoom:roomId
197+
relationType:MXEventRelationTypeReference
198+
eventType:nil
199+
from:from
200+
direction:MXTimelineDirectionBackwards
201+
limit:limit
202+
success:^(MXAggregationPaginatedResponse *paginatedResponse) {
187203
processPaginatedResponse(paginatedResponse);
188204
} failure:failure];
189205
}

MatrixSDK/Background/MXBackgroundStore.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,19 @@ class MXBackgroundStore: NSObject, MXStore {
231231
func localUnreadEventCount(_ roomId: String, threadId: String?, withTypeIn types: [Any]?) -> UInt {
232232
return 0
233233
}
234+
235+
func newIncomingEvents(inRoom roomId: String, threadId: String?, withTypeIn types: [String]?) -> [MXEvent] {
236+
return []
237+
}
234238

235239
var homeserverWellknown: MXWellKnown?
236240

237241
func storeHomeserverWellknown(_ homeserverWellknown: MXWellKnown) {
238242
}
243+
244+
var homeserverCapabilities: MXCapabilities?
245+
func storeHomeserverCapabilities(_ homeserverCapabilities: MXCapabilities) {
246+
}
239247

240248
func loadRoomMessages(forRoom roomId: String, completion: (() -> Void)? = nil) {
241249
DispatchQueue.main.async {

MatrixSDK/Background/Store/SyncResponseFileStore/MXSyncResponseFileStore.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public class MXSyncResponseFileStore: NSObject {
5050
}
5151
var cachePath: URL!
5252

53-
if let appGroupIdentifier = MXSDKOptions.sharedInstance().applicationGroupIdentifier {
54-
cachePath = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroupIdentifier)
53+
if let container = FileManager.default.applicationGroupContainerURL() {
54+
cachePath = container
5555
} else {
5656
cachePath = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first
5757
}
@@ -70,9 +70,7 @@ public class MXSyncResponseFileStore: NSObject {
7070
fileOperationQueue = DispatchQueue(label: "MXSyncResponseFileStore-" + MXTools.generateSecret())
7171

7272
fileOperationQueue.async {
73-
try? FileManager.default.createDirectory(at: syncResponsesFolderPath,
74-
withIntermediateDirectories: true,
75-
attributes: nil)
73+
try? FileManager.default.createDirectoryExcludedFromBackup(at: syncResponsesFolderPath)
7674

7775
// Clean the single cache file used for "v0"
7876
// TODO: Remove it at some point
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//
2+
// Copyright 2021 The Matrix.org Foundation C.I.C
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
import Foundation
18+
19+
@objc
20+
public extension MXEvent {
21+
22+
/// Flag indicating the receiver event should be highlighted
23+
/// - Parameter session: session instance to read notification rules from
24+
/// - Returns: true if clients should highlight the receiver event
25+
func shouldBeHighlighted(inSession session: MXSession) -> Bool {
26+
let displayNameChecker = MXPushRuleDisplayNameCondtionChecker(matrixSession: session,
27+
currentUserDisplayName: nil)
28+
29+
if displayNameChecker.isCondition(nil, satisfiedBy: self, roomState: nil, withJsonDict: nil) {
30+
return true
31+
}
32+
guard let rule = session.notificationCenter.rule(matching: self, roomState: nil) else {
33+
return false
34+
}
35+
36+
var isHighlighted = false
37+
38+
// Check whether is there an highlight tweak on it
39+
for ruleAction in rule.actions ?? [] {
40+
guard let action = ruleAction as? MXPushRuleAction else { continue }
41+
guard action.actionType == MXPushRuleActionTypeSetTweak else { continue }
42+
guard action.parameters["set_tweak"] as? String == "highlight" else { continue }
43+
// Check the highlight tweak "value"
44+
// If not present, highlight. Else check its value before highlighting
45+
if nil == action.parameters["value"] || true == (action.parameters["value"] as? Bool) {
46+
isHighlighted = true
47+
break
48+
}
49+
}
50+
51+
return isHighlighted
52+
}
53+
54+
}

MatrixSDK/Contrib/Swift/MXRestClient.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,7 @@ public extension MXRestClient {
19041904
/// - relationType: Optional. The type of relation
19051905
/// - eventType: Optional. Event type to filter by
19061906
/// - from: Optional. The token to start getting results from
1907+
/// - direction: direction from the token
19071908
/// - limit: Optional. The maximum number of messages to return
19081909
/// - completion: A closure called when the operation completes.
19091910
/// - Returns: a `MXHTTPOperation` instance.
@@ -1912,6 +1913,7 @@ public extension MXRestClient {
19121913
relationType: String?,
19131914
eventType: String?,
19141915
from: String?,
1916+
direction: MXTimelineDirection,
19151917
limit: UInt?,
19161918
completion: @escaping (_ response: MXResponse<MXAggregationPaginatedResponse>) -> Void) -> MXHTTPOperation {
19171919
let _limit: Int
@@ -1920,7 +1922,7 @@ public extension MXRestClient {
19201922
} else {
19211923
_limit = -1
19221924
}
1923-
return __relations(forEvent: eventId, inRoom: roomId, relationType: relationType, eventType: eventType, from: from, limit: _limit, success: currySuccess(completion), failure: curryFailure(completion))
1925+
return __relations(forEvent: eventId, inRoom: roomId, relationType: relationType, eventType: eventType, from: from, direction: direction, limit: _limit, success: currySuccess(completion), failure: curryFailure(completion))
19241926
}
19251927

19261928
}

MatrixSDK/Contrib/Swift/MXSession.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,4 +299,11 @@ public extension MXSession {
299299
return __listen(toEvents: legacyBlock)
300300
}
301301
}
302+
303+
// MARK: - Homeserver Information
304+
305+
/// The homeserver capabilities
306+
var homeserverCapabilities: MXCapabilities? {
307+
return __homeserverCapabilities
308+
}
302309
}

0 commit comments

Comments
 (0)