mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-21 20:49:36 +01:00
get recording status by signaling
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
4834afaf7e
commit
1aafc9989d
@ -98,6 +98,7 @@ import com.nextcloud.talk.utils.ApiUtils;
|
||||
import com.nextcloud.talk.utils.DisplayUtils;
|
||||
import com.nextcloud.talk.utils.NotificationUtils;
|
||||
import com.nextcloud.talk.utils.animations.PulseAnimation;
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||
import com.nextcloud.talk.utils.database.user.CapabilitiesUtilNew;
|
||||
import com.nextcloud.talk.utils.permissions.PlatformPermissionUtil;
|
||||
import com.nextcloud.talk.utils.power.PowerManagerUtils;
|
||||
@ -1674,6 +1675,7 @@ public class CallActivity extends CallBaseActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
if (webSocketCommunicationEvent.getHashMap() != null) {
|
||||
switch (webSocketCommunicationEvent.getType()) {
|
||||
case "hello":
|
||||
Log.d(TAG, "onMessageEvent 'hello'");
|
||||
@ -1694,6 +1696,21 @@ public class CallActivity extends CallBaseActivity {
|
||||
performCall();
|
||||
}
|
||||
break;
|
||||
case "recordingStatus":
|
||||
Log.d(TAG, "onMessageEvent 'recordingStatus'");
|
||||
|
||||
if (webSocketCommunicationEvent.getHashMap().containsKey(BundleKeys.KEY_RECORDING_STATE)) {
|
||||
String recordingStateString =
|
||||
webSocketCommunicationEvent.getHashMap().get(BundleKeys.KEY_RECORDING_STATE);
|
||||
|
||||
if (recordingStateString != null) {
|
||||
runOnUiThread(() -> {
|
||||
callRecordingViewModel.setRecordingState(Integer.parseInt(recordingStateString));
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,6 +108,7 @@ class CallRecordingViewModel @Inject constructor(private val repository: CallRec
|
||||
when (state) {
|
||||
0 -> _viewState.value = RecordingStoppedState
|
||||
1 -> _viewState.value = RecordingStartedState
|
||||
2 -> _viewState.value = RecordingStartedState
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
@ -266,13 +266,15 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
||||
refreshChatHashMap.put(BundleKeys.KEY_INTERNAL_USER_ID, Long.toString(conversationUser.getId()));
|
||||
eventBus.post(new WebSocketCommunicationEvent("refreshChat", refreshChatHashMap));
|
||||
}
|
||||
} else if (dataHashMap.containsKey("recording")) {
|
||||
} else if (dataHashMap != null && dataHashMap.containsKey("recording")) {
|
||||
Map<String, Object> recordingMap = (Map<String, Object>) dataHashMap.get("recording");
|
||||
if (recordingMap != null && recordingMap.containsKey("status")) {
|
||||
int status = ((Long) recordingMap.get("status")).intValue();
|
||||
Log.d(TAG, "status is " + status);
|
||||
|
||||
// TODO: inform ChatController about state (after Daniels PRs are merged..)
|
||||
HashMap<String, String> recordingHashMap = new HashMap<>();
|
||||
recordingHashMap.put(BundleKeys.KEY_RECORDING_STATE, Integer.toString(status));
|
||||
eventBus.post(new WebSocketCommunicationEvent("recordingStatus", recordingHashMap));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user