Skip to content

Commit ca97ca2

Browse files
committed
Update MXLocationService
1 parent bbd3995 commit ca97ca2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

MatrixSDK/LocationSharing/MXLocationService.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ public class MXLocationService: NSObject {
7777
}
7878
}
7979

80-
public func getCurrentUserAllBeaconInfo(inRoomWithId roomId: String, completion: @escaping ([MXBeaconInfo]) -> Void) {
80+
public func getAllBeaconInfoForCurrentUser(inRoomWithId roomId: String, completion: @escaping ([MXBeaconInfo]) -> Void) {
8181

8282
guard let myUserId = self.session.myUserId else {
83+
completion([])
8384
return
8485
}
8586

@@ -107,7 +108,7 @@ public class MXLocationService: NSObject {
107108
/// - beaconInfoEventId: The associated beacon info event id
108109
/// - latitude: Coordinate latitude
109110
/// - longitude: Coordinate longitude
110-
/// - description: Beacon description
111+
/// - description: Beacon description. nil by default.
111112
/// - threadId: the id of the thread to send the message. nil by default.
112113
/// - roomId: The room id
113114
/// - localEcho: a pointer to an MXEvent object.
@@ -117,11 +118,11 @@ public class MXLocationService: NSObject {
117118
public func sendBeacon(withBeaconInfoEventId beaconInfoEventId: String,
118119
latitude: Double,
119120
longitude: Double,
120-
description: String?,
121-
threadId: String?,
121+
description: String? = nil,
122+
threadId: String? = nil,
122123
inRoomWithId roomId: String,
123124
localEcho: inout MXEvent?,
124-
completion: @escaping (MXResponse<String?>) -> Void) -> MXHTTPOperation? {
125+
completion: @escaping (MXResponse<String?>) -> Void) -> MXHTTPOperation? {
125126

126127
guard let room = self.session.room(withRoomId: roomId) else {
127128
completion(.failure(MXLocationServiceError.roomNotFound))

0 commit comments

Comments
 (0)