Skip to content

Commit

Permalink
Finish v0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
manuroe committed Aug 10, 2018
2 parents 58aaf58 + 15fae06 commit 9a7791d
Show file tree
Hide file tree
Showing 99 changed files with 8,385 additions and 3,346 deletions.
34 changes: 34 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
Changes in Matrix iOS SDK in 0.11.0 (2018-08-10)
===============================================

Improvements:
* MXSession: Add the option to use a Matrix filter in /sync requests ([MXSession startWithSyncFilter:]).
* MXSession: Add API to manage Matrix filters.
* MXRestClient: Add Matrix filter API.
* MXRoom: Add send reply with text message (vector-im/riot-ios#1911).
* MXRoom: Add an asynchronous methods for liveTimeline, state and members.
* MXRoom: Add methods to manage the room liveTimeline listeners synchronously.
* MXRoomState: Add a membersCount property to store members stats independently from MXRoomMember objects.
* MXRoomSummary: Add a membersCount property to cache MXRoomState one.
* MXRoomSummary: Add a membership property to cache MXRoomState one.
* MXRoomSummary: add isConferenceUserRoom.
* MXStore: Add Obj-C annotations.
* MXFileStore: Add a setting to set which data to preload ([MXFileStore setPreloadOptions:]).
* Manage the new summary API from the homeserver( MSC: https://docs.google.com/document/d/11i14UI1cUz-OJ0knD5BFu7fmT6Fo327zvMYqfSAR7xs/edit#).
* MXRoom: Add send reply with text message (vector-im/riot-ios#1911).
* Support room versioning (vector-im/riot-ios#1938).
* Add SwiftSupport subspec to MatrixSDK in order to be able to expose Swift refinements to a project using both Swift and Objective-C.

Bug fix:
* MXRestClient: Fix filter parameter in messagesForRoom. It must be sent as an inline JSON string.
* Sends read receipts on login (vector-im/riot-ios/issues/1918).

API break:
* MXSession: [MXSession startWithMessagesLimit] has been removed. Use the more generic [MXSession startWithSyncFilter:].
* MXRoom: liveTimeline and state accesses are now asynchronous.
* MXCall: callee access is now asynchronous.
* MXRoomState: Remove displayName property. Use MXRoomSummary.displayName instead.
* MXRoomState: Create a MXRoomMembers property. All members getter methods has been to the new class.
* MXStore: Make the stateOfRoom method asynchronous.
* MXRestClient: contextOfEvent: Add a filter parameter.

Changes in Matrix iOS SDK in 0.10.12 (2018-05-31)
===============================================

Expand Down
14 changes: 10 additions & 4 deletions MatrixSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MatrixSDK"
s.version = "0.10.12"
s.version = "0.11.0"
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"

s.description = <<-DESC
Expand All @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.author = { "matrix.org" => "[email protected]" }
s.social_media_url = "http://twitter.com/matrixdotorg"

s.source = { :git => "https://github.com/matrix-org/matrix-ios-sdk.git", :tag => "v0.10.12" }
s.source = { :git => "https://github.com/matrix-org/matrix-ios-sdk.git", :tag => "v#{s.version}" }

s.requires_arc = true

Expand All @@ -35,8 +35,8 @@ Pod::Spec.new do |s|
ss.dependency 'GZIP', '~> 1.2.1'

# Requirements for e2e encryption
ss.dependency 'OLMKit', '~> 2.2.2'
ss.dependency 'Realm', '~> 3.6.0'
ss.dependency 'OLMKit', '~> 2.3.0'
ss.dependency 'Realm', '~> 3.7.4'
end

s.subspec 'JingleCallStack' do |ss|
Expand Down Expand Up @@ -65,4 +65,10 @@ Pod::Spec.new do |s|
ss.ios.dependency 'GoogleAnalytics'
end

s.subspec 'SwiftSupport' do |ss|
ss.source_files = "MatrixSDK", "MatrixSDK/**/*.{swift}"

ss.dependency 'MatrixSDK/Core'
end

end
90 changes: 80 additions & 10 deletions MatrixSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions MatrixSDK/Contrib/Swift/Data/MXRoom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,39 @@ public extension MXRoom {
return __reportEvent(eventId, score: score, reason: reason, success: currySuccess(completion), failure: curryFailure(completion))
}

/**
Send a reply to an event with text message to the room.
It's only supported to reply to event with 'm.room.message' event type and following message types: 'm.text', 'm.text', 'm.emote', 'm.notice', 'm.image', 'm.file', 'm.video', 'm.audio'.
- parameters:
- eventToReply: The event to reply.
- textMessage: The text to send.
- formattedTextMessage: The optional HTML formatted string of the text to send.
- stringLocalizations: String localizations used when building reply message.
- localEcho: a pointer to an MXEvent object.
When the event type is `MXEventType.roomMessage`, this pointer is set to an actual
MXEvent object containing the local created event which should be used to echo the
message in the messages list until the resulting event comes through the server sync.
For information, the identifier of the created local event has the prefix:
`kMXEventLocalEventIdPrefix`.
You may specify nil for this parameter if you do not want this information.
You may provide your own MXEvent object, in this case only its send state is updated.
When the event type is `kMXEventTypeStringRoomEncrypted`, no local event is created.
- completion: A block object called when the operation completes.
- response: Provides the event id of the event generated on the home server on success
- returns: a `MXHTTPOperation` instance.
*/
@nonobjc @discardableResult func sendReply(to eventToReply: MXEvent, textMessage: String, formattedTextMessage: String?, stringLocalizations: MXSendReplyEventStringsLocalizable?, localEcho: inout MXEvent?, completion: @escaping (_ response: MXResponse<String?>) -> Void) -> MXHTTPOperation {
return __sendReply(to: eventToReply, withTextMessage: textMessage, formattedTextMessage: formattedTextMessage, stringLocalizations: stringLocalizations, localEcho: &localEcho, success: currySuccess(completion), failure: curryFailure(completion))
}


// MARK: - Room Tags Operations

Expand Down
28 changes: 28 additions & 0 deletions MatrixSDK/Contrib/Swift/Data/MXRoomSummary.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import Foundation

extension MXRoomSummary {

/// The membership state of the logged in user for this room
///
/// If the membership is `invite`, the room state contains few information.
/// Join the room with [MXRoom join] to get full information about the room.
public var membership: MXMembership {
return MXMembership(identifier: self.__membership)
}
}
4 changes: 3 additions & 1 deletion MatrixSDK/Contrib/Swift/JSONModels/MXEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public enum MXEventType {
case callAnswer
case callHangup
case receipt
case roomTombStone

case custom(String)

Expand Down Expand Up @@ -88,6 +89,7 @@ public enum MXEventType {
case .callAnswer: return kMXEventTypeStringCallAnswer
case .callHangup: return kMXEventTypeStringCallHangup
case .receipt: return kMXEventTypeStringReceipt
case .roomTombStone: return kMXEventTypeStringRoomTombStone

// Swift converts any constant with the suffix "Notification" as the type `Notification.Name`
// The original value can be reached using the `rawValue` property.
Expand All @@ -98,7 +100,7 @@ public enum MXEventType {
}

public init(identifier: String) {
let events: [MXEventType] = [.roomName, .roomTopic, .roomAvatar, .roomMember, .roomCreate, .roomJoinRules, .roomPowerLevels, .roomAliases, .roomCanonicalAlias, .roomEncrypted, .roomEncryption, .roomGuestAccess, .roomHistoryVisibility, .roomKey, .roomForwardedKey, .roomKeyRequest, .roomMessage, .roomMessageFeedback, .roomRedaction, .roomThirdPartyInvite, .roomTag, .presence, .typing, .callInvite, .callCandidates, .callAnswer, .callHangup, .receipt]
let events: [MXEventType] = [.roomName, .roomTopic, .roomAvatar, .roomMember, .roomCreate, .roomJoinRules, .roomPowerLevels, .roomAliases, .roomCanonicalAlias, .roomEncrypted, .roomEncryption, .roomGuestAccess, .roomHistoryVisibility, .roomKey, .roomForwardedKey, .roomKeyRequest, .roomMessage, .roomMessageFeedback, .roomRedaction, .roomThirdPartyInvite, .roomTag, .presence, .typing, .callInvite, .callCandidates, .callAnswer, .callHangup, .receipt, .roomTombStone]
self = events.first(where: { $0.identifier == identifier }) ?? .custom(identifier)
}
}
Expand Down
5 changes: 3 additions & 2 deletions MatrixSDK/Contrib/Swift/MXRestClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1208,13 +1208,14 @@ public extension MXRestClient {
- eventId: the id of the event to get context around.
- roomId: the id of the room to get events from.
- limit: the maximum number of messages to return.
- filter the filter to pass in the request. Can be nil.
- completion: A block object called when the operation completes.
- response: Provides the model created from the homeserver JSON response on success.
- returns: a `MXHTTPOperation` instance.
*/
@nonobjc @discardableResult func context(ofEvent eventId: String, inRoom roomId: String, limit: UInt, completion: @escaping (_ response: MXResponse<MXEventContext>) -> Void) -> MXHTTPOperation {
return __context(ofEvent: eventId, inRoom: roomId, limit: limit, success: currySuccess(completion), failure: curryFailure(completion))
@nonobjc @discardableResult func context(ofEvent eventId: String, inRoom roomId: String, limit: UInt, filter: MXRoomEventFilter? = nil, completion: @escaping (_ response: MXResponse<MXEventContext>) -> Void) -> MXHTTPOperation {
return __context(ofEvent: eventId, inRoom: roomId, limit: limit, filter:filter, success: currySuccess(completion), failure: curryFailure(completion))
}


Expand Down
15 changes: 5 additions & 10 deletions MatrixSDK/Contrib/Swift/MXSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,16 @@ public extension MXSession {
will resume the events streaming from where it had been stopped the time before.
- parameters:
- limit: The number of messages to retrieve in each room. If `nil`, this preloads 10 messages.
Use this argument to use a custom limit.
- filterId: the id of the filter to use.
- completion: A block object called when the operation completes. In case of failure during
the initial sync, the session state is `MXSessionStateInitialSyncFailed`.
- response: Indicates whether the operation was successful.
*/
@nonobjc func start(withMessagesLimit limit: UInt? = nil, completion: @escaping (_ response: MXResponse<Void>) -> Void) {
if let limit = limit {
__start(withMessagesLimit: limit, onServerSyncDone: currySuccess(completion), failure: curryFailure(completion))
} else {
__start(currySuccess(completion), failure: curryFailure(completion))
}
@nonobjc func start(withSyncFilterId filterId: String? = nil, completion: @escaping (_ response: MXResponse<Void>) -> Void) {
__start(withSyncFilterId:filterId, onServerSyncDone: currySuccess(completion), failure: curryFailure(completion))
}


/**
Perform an events stream catchup in background (by keeping user offline).
Expand Down
Loading

0 comments on commit 9a7791d

Please sign in to comment.