Skip to content

Commit

Permalink
Merge branch 'release/0.23.7/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave committed May 31, 2022
2 parents 4c9efc0 + 9451fba commit 331a4a2
Show file tree
Hide file tree
Showing 42 changed files with 1,469 additions and 171 deletions.
22 changes: 22 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## Changes in 0.23.7 (2022-05-31)

🐛 Bugfixes

- MXSession: Recreate room summaries when detected missing. ([#5924](https://github.com/vector-im/element-ios/issues/5924))
- Fixed crashes on invalid casting of MXUser to MXMyUser causing unrecognized selectors on the mxSession property. ([#6187](https://github.com/vector-im/element-ios/issues/6187))
- MXCoreDataRoomSummaryStore: Make removing a room summary synchronous. ([#6218](https://github.com/vector-im/element-ios/issues/6218))

⚠️ API Changes

- MXTools: generateTransactionId no longer returns an optional in Swift. ([#1477](https://github.com/matrix-org/matrix-ios-sdk/pull/1477))

🚧 In development 🚧

- Location sharing: Persist beacon info summaries to disk. ([#6199](https://github.com/vector-im/element-ios/issues/6199))

Others

- MXFileStore: Add extra logs when saving and loading room state ([#1478](https://github.com/matrix-org/matrix-ios-sdk/pull/1478))
- MXBackgroundSyncServiceTests: Add tests for outdated gappy syncs. ([#6142](https://github.com/vector-im/element-ios/issues/6142))


## Changes in 0.23.6 (2022-05-19)

No significant changes.
Expand Down
4 changes: 2 additions & 2 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.23.6"
s.version = "0.23.7"
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"

s.description = <<-DESC
Expand Down Expand Up @@ -43,7 +43,7 @@ Pod::Spec.new do |s|

# Requirements for e2e encryption
ss.dependency 'OLMKit', '~> 3.2.5'
ss.dependency 'Realm', '10.16.0'
ss.dependency 'Realm', '10.26.0'
ss.dependency 'libbase58', '~> 0.1.4'
end

Expand Down
244 changes: 145 additions & 99 deletions MatrixSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public class MXBeaconAggregations: NSObject {
return self.beaconInfoSummaryStore.getAllBeaconInfoSummaries(inRoomWithId: roomId)
}

/// Get all MXBeaconInfoSummary for a user
public func getBeaconInfoSummaries(for userId: String) -> [MXBeaconInfoSummaryProtocol] {
return self.beaconInfoSummaryStore.getAllBeaconInfoSummaries(forUserId: userId)
}

/// Update a MXBeaconInfoSummary device id that belongs to the current user.
/// Enables to recognize that a beacon info has been started on the device
public func updateBeaconInfoSummary(with eventId: String, deviceId: String, inRoomWithId roomId: String) {
Expand All @@ -62,6 +67,7 @@ public class MXBeaconAggregations: NSObject {
}

if beaconInfoSummary.updateWithDeviceId(deviceId) {
self.beaconInfoSummaryStore.addOrUpdateBeaconInfoSummary(beaconInfoSummary, inRoomWithId: roomId)
self.notifyBeaconInfoSummaryListeners(ofRoomWithId: roomId, beaconInfoSummary: beaconInfoSummary)
}
}
Expand All @@ -87,6 +93,7 @@ public class MXBeaconAggregations: NSObject {
}

if beaconInfoSummary.updateWithLastBeacon(beacon) {
self.beaconInfoSummaryStore.addOrUpdateBeaconInfoSummary(beaconInfoSummary, inRoomWithId: roomId)
self.notifyBeaconInfoSummaryListeners(ofRoomWithId: roomId, beaconInfoSummary: beaconInfoSummary)
}
}
Expand Down Expand Up @@ -164,7 +171,6 @@ public class MXBeaconAggregations: NSObject {

if let beaconInfoSummary = beaconInfoSummary {
self.beaconInfoSummaryStore.addOrUpdateBeaconInfoSummary(beaconInfoSummary, inRoomWithId: roomId)

self.notifyBeaconInfoSummaryListeners(ofRoomWithId: roomId, beaconInfoSummary: beaconInfoSummary)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ public class MXBeaconInfoSummaryMemoryStore: NSObject, MXBeaconInfoSummaryStoreP
}
}

public func getAllBeaconInfoSummaries(forUserId userId: String) -> [MXBeaconInfoSummary] {

var userSummaries: [MXBeaconInfoSummary] = []

for (_, roomSummaries) in self.beaconInfoSummaries {

let userRoomSummaries = roomSummaries.filter { summary in
summary.userId == userId
}

userSummaries.append(contentsOf: userRoomSummaries)
}

return userSummaries
}

public func getAllBeaconInfoSummaries(inRoomWithId roomId: String) -> [MXBeaconInfoSummary] {
return self.beaconInfoSummaries[roomId] ?? []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ import Foundation
/// Get all MXBeaconInfoSummary in a room
func getAllBeaconInfoSummaries(inRoomWithId roomId: String) -> [MXBeaconInfoSummary]

/// Get all MXBeaconInfoSummary for a user
func getAllBeaconInfoSummaries(forUserId userId: String) -> [MXBeaconInfoSummary]

/// Delete all MXBeaconInfoSummary in a room
func deleteAllBeaconInfoSummaries(inRoomWithId roomId: String)

Expand Down
Loading

0 comments on commit 331a4a2

Please sign in to comment.