Skip to content

Commit 61ae390

Browse files
authored
Merge pull request #126 from matrix-org/release-v0.6.13
Release v0.6.13
2 parents f852e7f + bc14b9c commit 61ae390

Some content is hidden

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

49 files changed

+2369
-1006
lines changed

CHANGES.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
Changes in Matrix iOS SDK in 0.6.13 (2016-08-25)
2+
================================================
3+
4+
Improvements:
5+
* Add conference call support.
6+
* Call: Update the libjingle lib to its latest version. That implied a major refactoring of MXJingleCallStack.
7+
* Repair MXFileStore in case of interrupted commit (https://github.com/vector-im/vector-ios/issues/376).
8+
* Speed up MXFileStore loading.
9+
* Allow MXFileStore to run when the app is backgrounded.
10+
* Change the MXStore API to be able to run several paginations in parallel.
11+
12+
API improvements:
13+
* Add MXEventsEnumerator to enumerate sets of events like those returned by the MXStore API.
14+
* MXRoomState: Added - (NSArray*)membersWithMembership:(MXMembership)membership.
15+
* MXSession & MXRestClient: Add createRoom with a parameters dictionary to manage all fields available in Matrix spec.
16+
* MXCall: Add cameraPosition property to switch the camera.
17+
* MXMyUser: Allow nil callback blocks in setter methods.
18+
* SDK Tests: Add a test on [MXRestClient close].
19+
* SDK Tests: Add a test on [MXFileStore diskUsage].
20+
21+
Bug fixes:
22+
* Redacting membership events should immediately reset the displayname & avatar of room members (https://github.com/vector-im/vector-ios/issues/443).
23+
* Profile changes shouldn't reorder the room list (https://github.com/vector-im/vector-ios/issues/494).
24+
* When the last message is redacted, [MXKRecentCellData update] makes paginations loops (https://github.com/vector-im/vector-ios/issues/520).
25+
* MXSession: Do not send kMXSessionIgnoredUsersDidChangeNotification when the session loads the data from the store (https://github.com/vector-im/vector-ios/issues/491).
26+
* MXHTTPClient: Fix crash: "Task created in a session that has been invalidated" (https://github.com/vector-im/vector-ios/issues/490).
27+
* Call: the remote and local video are not scaled to fill the video container (https://github.com/vector-im/vector-ios/issues/537).
28+
29+
API Breaks:
30+
* Rename "kMXRoomSyncWithLimitedTimelineNotification" with "kMXRoomDidFlushMessagesNotification"
31+
* MXRoom: Make placeCall: asynchronous.
32+
* MXFileStore: Replace 'diskUsage' property by an async non blocking method: [self diskUsageWithBlock:].
33+
* MXStore: Replace [MXStore resetPaginationOfRoom:], [MXStore paginateRoom:numMessages:] and [MXStore remainingMessagesForPaginationInRoom:] methods by [MXStore messagesEnumeratorForRoom:]
34+
135
Changes in Matrix iOS SDK in 0.6.12 (2016-08-01)
236
================================================
337

MatrixSDK.podspec

Lines changed: 2 additions & 2 deletions
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.6.12"
4+
s.version = "0.6.13"
55
s.summary = "The iOS SDK to build apps compatible with Matrix (http://www.matrix.org)"
66

77
s.description = <<-DESC
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
1919

2020
s.platform = :ios, "7.0"
2121

22-
s.source = { :git => "https://github.com/matrix-org/matrix-ios-sdk.git", :tag => "v0.6.12" }
22+
s.source = { :git => "https://github.com/matrix-org/matrix-ios-sdk.git", :tag => "v0.6.13" }
2323
s.source_files = "MatrixSDK", "MatrixSDK/**/*.{h,m}"
2424
s.resources = "MatrixSDK/Data/Store/MXCoreDataStore/*.xcdatamodeld"
2525

MatrixSDK.xcodeproj/project.pbxproj

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
320BBF3C1D6C7D9D0079890E /* MXEventsEnumerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 320BBF3B1D6C7D9D0079890E /* MXEventsEnumerator.h */; };
11+
320BBF411D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 320BBF3D1D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.m */; };
12+
320BBF421D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 320BBF3E1D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.h */; };
13+
320BBF431D6C81550079890E /* MXEventsEnumeratorOnArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 320BBF3F1D6C81550079890E /* MXEventsEnumeratorOnArray.h */; };
14+
320BBF441D6C81550079890E /* MXEventsEnumeratorOnArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 320BBF401D6C81550079890E /* MXEventsEnumeratorOnArray.m */; };
1015
320DFDDB19DD99B60068622A /* MXRoom.h in Headers */ = {isa = PBXBuildFile; fileRef = 320DFDCA19DD99B60068622A /* MXRoom.h */; };
1116
320DFDDC19DD99B60068622A /* MXRoom.m in Sources */ = {isa = PBXBuildFile; fileRef = 320DFDCB19DD99B60068622A /* MXRoom.m */; };
1217
320DFDE019DD99B60068622A /* MXSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 320DFDD019DD99B60068622A /* MXSession.h */; };
@@ -172,6 +177,11 @@
172177
/* Begin PBXFileReference section */
173178
0BCFBADF157F3C8C43112BD6 /* Pods-MatrixSDKTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrixSDKTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-MatrixSDKTests/Pods-MatrixSDKTests.release.xcconfig"; sourceTree = "<group>"; };
174179
2BF02FACC417CA3368671024 /* Pods-MatrixSDK.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrixSDK.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MatrixSDK/Pods-MatrixSDK.debug.xcconfig"; sourceTree = "<group>"; };
180+
320BBF3B1D6C7D9D0079890E /* MXEventsEnumerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXEventsEnumerator.h; sourceTree = "<group>"; };
181+
320BBF3D1D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXEventsByTypesEnumeratorOnArray.m; sourceTree = "<group>"; };
182+
320BBF3E1D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXEventsByTypesEnumeratorOnArray.h; sourceTree = "<group>"; };
183+
320BBF3F1D6C81550079890E /* MXEventsEnumeratorOnArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXEventsEnumeratorOnArray.h; sourceTree = "<group>"; };
184+
320BBF401D6C81550079890E /* MXEventsEnumeratorOnArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXEventsEnumeratorOnArray.m; sourceTree = "<group>"; };
175185
320DFDCA19DD99B60068622A /* MXRoom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXRoom.h; sourceTree = "<group>"; };
176186
320DFDCB19DD99B60068622A /* MXRoom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = MXRoom.m; sourceTree = "<group>"; };
177187
320DFDD019DD99B60068622A /* MXSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = MXSession.h; sourceTree = "<group>"; };
@@ -354,9 +364,22 @@
354364
name = Pods;
355365
sourceTree = "<group>";
356366
};
367+
320BBF3A1D6C7D9D0079890E /* EventsEnumerator */ = {
368+
isa = PBXGroup;
369+
children = (
370+
320BBF3B1D6C7D9D0079890E /* MXEventsEnumerator.h */,
371+
320BBF3F1D6C81550079890E /* MXEventsEnumeratorOnArray.h */,
372+
320BBF401D6C81550079890E /* MXEventsEnumeratorOnArray.m */,
373+
320BBF3D1D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.m */,
374+
320BBF3E1D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.h */,
375+
);
376+
path = EventsEnumerator;
377+
sourceTree = "<group>";
378+
};
357379
320DFDC719DD99B60068622A /* Data */ = {
358380
isa = PBXGroup;
359381
children = (
382+
320BBF3A1D6C7D9D0079890E /* EventsEnumerator */,
360383
32114A831A262CE000FF2EC4 /* Store */,
361384
320DFDCA19DD99B60068622A /* MXRoom.h */,
362385
320DFDCB19DD99B60068622A /* MXRoom.m */,
@@ -686,7 +709,9 @@
686709
3245A7521AF7B2930001D8A7 /* MXCallManager.h in Headers */,
687710
3264E2A21BDF8D1500F89A86 /* MXCoreDataRoomState.h in Headers */,
688711
3291D4D41A68FFEB00C3BA41 /* MXFileRoomStore.h in Headers */,
712+
320BBF431D6C81550079890E /* MXEventsEnumeratorOnArray.h in Headers */,
689713
32C6F93319DD814400EA4E9C /* MatrixSDK.h in Headers */,
714+
320BBF3C1D6C7D9D0079890E /* MXEventsEnumerator.h in Headers */,
690715
323D299A1D426F7000A80BE4 /* MXJingleVideoView.h in Headers */,
691716
323E0C571A2F6E7D00A31D73 /* MXRoomPowerLevels.h in Headers */,
692717
3245A7501AF7B2930001D8A7 /* MXCall.h in Headers */,
@@ -697,6 +722,7 @@
697722
32481A841C03572900782AD3 /* MXRoomAccountData.h in Headers */,
698723
3281E8B919E42DFE00976E1A /* MXJSONModels.h in Headers */,
699724
323B2AFE1BCE9B6700B11F34 /* MXCoreDataEvent+CoreDataProperties.h in Headers */,
725+
320BBF421D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.h in Headers */,
700726
323B2ADF1BCD4CB600B11F34 /* MXCoreDataAccount+CoreDataProperties.h in Headers */,
701727
32CAB1071A91EA34008C5BB9 /* MXPushRuleRoomMemberCountConditionChecker.h in Headers */,
702728
32CAB10B1A925B41008C5BB9 /* MXHTTPOperation.h in Headers */,
@@ -916,6 +942,7 @@
916942
322360531A8E610500A3CA81 /* MXPushRuleDisplayNameCondtionChecker.m in Sources */,
917943
323E0C581A2F6E7D00A31D73 /* MXRoomPowerLevels.m in Sources */,
918944
32DC15D51A8CF874006F9AD3 /* MXPushRuleEventMatchConditionChecker.m in Sources */,
945+
320BBF411D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.m in Sources */,
919946
32CAB1081A91EA34008C5BB9 /* MXPushRuleRoomMemberCountConditionChecker.m in Sources */,
920947
3245A7511AF7B2930001D8A7 /* MXCall.m in Sources */,
921948
327F8DB31C6112BA00581CA3 /* MXRoomThirdPartyInvite.m in Sources */,
@@ -951,6 +978,7 @@
951978
32FE41371D0AB7070060835E /* MXEnumConstants.m in Sources */,
952979
320DFDE119DD99B60068622A /* MXSession.m in Sources */,
953980
F0C34CBB1C18C93700C36F09 /* MXSDKOptions.m in Sources */,
981+
320BBF441D6C81550079890E /* MXEventsEnumeratorOnArray.m in Sources */,
954982
320DFDDC19DD99B60068622A /* MXRoom.m in Sources */,
955983
3291D4D51A68FFEB00C3BA41 /* MXFileRoomStore.m in Sources */,
956984
329FB1801A0B665800A5E88E /* MXUser.m in Sources */,
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
Copyright 2016 OpenMarket Ltd
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/Foundation.h>
18+
19+
#import "MXEventsEnumerator.h"
20+
21+
/**
22+
Generic events enumerator on an array of events with a filter on events types.
23+
*/
24+
@interface MXEventsByTypesEnumeratorOnArray : NSObject <MXEventsEnumerator>
25+
26+
/**
27+
Construct an enumerator based on a events array.
28+
29+
@param messages the list of messages to enumerate on.
30+
@param types an array of event types strings to use as a filter filter.
31+
@param ignoreProfileChanges tell whether the profile changes should be ignored.
32+
33+
@return the newly created instance.
34+
*/
35+
- (instancetype)initWithMessages:(NSMutableArray<MXEvent*> *)messages andTypesIn:(NSArray*)types ignoreMemberProfileChanges:(BOOL)ignoreProfileChanges;
36+
37+
@end
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
Copyright 2016 OpenMarket Ltd
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 "MXEventsByTypesEnumeratorOnArray.h"
18+
19+
#import "MXEventsEnumeratorOnArray.h"
20+
21+
@interface MXEventsByTypesEnumeratorOnArray ()
22+
{
23+
// The all-messages enumerator
24+
// Note: it would be much quicker to process directly `messages` but
25+
// the all-messages enumerator make this enumerator easy to implement.
26+
MXEventsEnumeratorOnArray *allMessagesEnumerator;
27+
28+
// The event types to filter in
29+
NSArray *types;
30+
31+
// Tell whether the profile changes should be ignored
32+
BOOL ignoreMemberProfileChanges;
33+
}
34+
35+
@end
36+
37+
@implementation MXEventsByTypesEnumeratorOnArray
38+
39+
- (instancetype)initWithMessages:(NSMutableArray<MXEvent *> *)messages andTypesIn:(NSArray *)theTypes ignoreMemberProfileChanges:(BOOL)ignoreProfileChanges
40+
{
41+
self = [super init];
42+
if (self)
43+
{
44+
types = theTypes;
45+
ignoreMemberProfileChanges = ignoreProfileChanges;
46+
allMessagesEnumerator = [[MXEventsEnumeratorOnArray alloc] initWithMessages:messages];
47+
}
48+
49+
return self;
50+
}
51+
52+
- (NSArray<MXEvent *> *)nextEventsBatch:(NSUInteger)eventsCount
53+
{
54+
NSMutableArray *nextEvents;
55+
MXEvent *event;
56+
57+
// Feed the array with matching events
58+
while ((event = self.nextEvent) && (nextEvents.count != eventsCount))
59+
{
60+
if (!nextEvents)
61+
{
62+
// Create the array only if there are events to return
63+
nextEvents = [NSMutableArray arrayWithCapacity:eventsCount];
64+
}
65+
66+
[nextEvents addObject:event];
67+
}
68+
69+
return nextEvents;
70+
}
71+
72+
- (MXEvent *)nextEvent
73+
{
74+
MXEvent *event, *nextEvent;
75+
76+
// Loop until an event matches the criteria
77+
while ((event = [allMessagesEnumerator nextEvent]))
78+
{
79+
if (event.eventId && (!types || (NSNotFound != [types indexOfObject:event.type])))
80+
{
81+
if (!ignoreMemberProfileChanges || !event.isUserProfileChange)
82+
{
83+
nextEvent = event;
84+
break;
85+
}
86+
}
87+
}
88+
89+
return nextEvent;
90+
}
91+
92+
- (NSUInteger)remaining
93+
{
94+
// We are in the case of a filtered result, we can return NSUIntegerMax
95+
// because it would take too much time to compute.
96+
return NSUIntegerMax;
97+
}
98+
99+
@end
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
Copyright 2016 OpenMarket Ltd
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 "MXEvent.h"
18+
19+
/**
20+
The `MXStoreEventsEnumerator` protocol defines an interface that must be implemented
21+
in order to iterate on a list of events.
22+
23+
This interface is used in the MXStore to manage the results of requests on the store
24+
database.
25+
26+
The `MXStoreEventsEnumerator` implementation must start the iteration on the most recent
27+
events of the list.
28+
*/
29+
@protocol MXEventsEnumerator <NSObject>
30+
31+
/**
32+
Return next events in the enumerator.
33+
34+
@eventsCount the number of events to get.
35+
@return an array of events in chronological order. Nil if there is no more events.
36+
*/
37+
- (NSArray<MXEvent*>*)nextEventsBatch:(NSUInteger)eventsCount;
38+
39+
/**
40+
The next event in the enumerator.
41+
Nil if there is no more events.
42+
*/
43+
@property (nonatomic, readonly) MXEvent *nextEvent;
44+
45+
/**
46+
The number of events that still remain to get from this enumerator.
47+
48+
@discussion
49+
For performance reason, the value may be not garanteed when the enumarator is done on a
50+
filtered list of events.
51+
In this case, the implementation returns NSUIntegerMax.
52+
*/
53+
@property (nonatomic, readonly) NSUInteger remaining;
54+
55+
@end
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
Copyright 2016 OpenMarket Ltd
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/Foundation.h>
18+
19+
#import "MXEventsEnumerator.h"
20+
21+
/**
22+
Generic events enumerator on an array of events.
23+
*/
24+
@interface MXEventsEnumeratorOnArray : NSObject <MXEventsEnumerator>
25+
26+
/**
27+
Construct an enumerator based on a events array.
28+
29+
@param messages the list of messages to enumerate.
30+
@return the newly created instance.
31+
*/
32+
- (instancetype)initWithMessages:(NSArray<MXEvent*> *)messages;
33+
34+
@end

0 commit comments

Comments
 (0)