Files
bundesmessenger-ios/Riot/Categories/MXLocationService.swift
T
2025-01-23 12:19:12 +01:00

27 lines
876 B
Swift

//
// Copyright 2022-2024 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
// Please see LICENSE files in the repository root for full details.
//
import Foundation
import MatrixSDK
extension MXLocationService {
public func isSomeoneSharingDisplayableLocation(inRoomWithId roomId: String) -> Bool {
return self.getDisplayableBeaconInfoSummaries(inRoomWithId: roomId).isEmpty == false
}
/// Get beacon info summaries that can be shown on a map
func getDisplayableBeaconInfoSummaries(inRoomWithId roomId: String) -> [MXBeaconInfoSummaryProtocol] {
let liveBeaconInfoSummaries = self.getLiveBeaconInfoSummaries(inRoomWithId: roomId)
return liveBeaconInfoSummaries.filter { beaconInfoSummary in
return beaconInfoSummary.isDisplayable
}
}
}