mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Live Location Sharing Banner (#5370)
* Live Location Sharing Banner # Conflicts: # ElementX.xcodeproj/project.pbxproj * updated the top banner modifier and the top banner views # Conflicts: # ElementX/Resources/Localizations/en-US.lproj/Localizable.strings # ElementX/Resources/Localizations/en.lproj/Localizable.strings * improved the stopping function from the timeline item * stop live location sharing before starting a new one. * added some tests for LiveLocationManager * pr suggestions
This commit is contained in:
@@ -198,8 +198,9 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
||||
handlePollAction(pollAction)
|
||||
case .handleAudioPlayerAction(let audioPlayerAction):
|
||||
handleAudioPlayerAction(audioPlayerAction)
|
||||
case .stopLiveLocationSharing:
|
||||
Task { await userSession.liveLocationManager.stopLiveLocation(roomID: state.roomID) }
|
||||
case .stopLiveLocationSharing(let id):
|
||||
state.stoppedLiveLocationIDs.insert(id)
|
||||
Task { await stopLiveLocationSharing() }
|
||||
case .focusOnEventID(let eventID):
|
||||
Task { await focusOnEvent(eventID: eventID) }
|
||||
case .focusLive:
|
||||
@@ -276,6 +277,10 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func stopLiveLocationSharing() async {
|
||||
await userSession.liveLocationManager.stopLiveLocation(roomID: roomProxy.id)
|
||||
}
|
||||
|
||||
func makeForwardingItem(for itemID: TimelineItemIdentifier) async -> MessageForwardingItem? {
|
||||
guard let content = await timelineController.messageEventContent(for: itemID) else { return nil }
|
||||
return .init(id: itemID, roomID: roomProxy.id, content: content)
|
||||
|
||||
Reference in New Issue
Block a user