mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-16 03:08:58 +03:00
Jitsi widget: use state_key instead of widget content
This commit is contained in:
parent
4821852430
commit
8bd1cd6b17
2 changed files with 2 additions and 17 deletions
|
@ -70,7 +70,7 @@ class WidgetItemFactory @Inject constructor(
|
|||
null
|
||||
}
|
||||
}
|
||||
val callStatus = if (isActiveTile && widgetContent.id == params.partialState.jitsiState.widgetId) {
|
||||
val callStatus = if (isActiveTile && params.event.root.stateKey == params.partialState.jitsiState.widgetId) {
|
||||
if (params.partialState.jitsiState.hasJoined) {
|
||||
CallTileTimelineItem.CallStatus.IN_CALL
|
||||
} else {
|
||||
|
|
|
@ -58,22 +58,7 @@ class TimelineEventsGroups {
|
|||
return if (EventType.isCallEvent(type)) {
|
||||
(content?.get("call_id") as? String)
|
||||
} else if (type == EventType.STATE_ROOM_WIDGET || type == EventType.STATE_ROOM_WIDGET_LEGACY) {
|
||||
val widgetContent: WidgetContent = root.getClearContent().toModel() ?: return null
|
||||
if (widgetContent.isActive()) {
|
||||
widgetContent.getJitsiIdOrNull()
|
||||
} else {
|
||||
val prevWidgetContent: WidgetContent = root.resolvedPrevContent().toModel() ?: return null
|
||||
prevWidgetContent.getJitsiIdOrNull()
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
private fun WidgetContent.getJitsiIdOrNull(): String? {
|
||||
val isJitsi = WidgetType.fromString(type ?: "") == WidgetType.Jitsi
|
||||
return if (isJitsi) {
|
||||
id
|
||||
root.stateKey
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue