check if conversation is breakout room

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2023-02-15 11:19:47 +01:00
parent 99a4ca5e33
commit 2835bb6c02
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
4 changed files with 23 additions and 4 deletions

View File

@ -173,6 +173,7 @@ import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CALL_WITHOUT_NOTIFI
import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CONVERSATION_NAME;
import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CONVERSATION_PASSWORD;
import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_FROM_NOTIFICATION_START_CALL;
import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_BREAKOUT_ROOM;
import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_MODERATOR;
import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_MODIFIED_BASE_URL;
import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_AUDIO;
@ -309,6 +310,7 @@ public class CallActivity extends CallBaseActivity {
private CallParticipantList callParticipantList;
private String switchToRoomToken = "";
private boolean isBreakoutRoom = false;
private SignalingMessageReceiver.LocalParticipantMessageListener localParticipantMessageListener =
new SignalingMessageReceiver.LocalParticipantMessageListener() {
@ -390,6 +392,10 @@ public class CallActivity extends CallBaseActivity {
isIncomingCallFromNotification = extras.getBoolean(KEY_FROM_NOTIFICATION_START_CALL);
}
if (extras.containsKey(KEY_IS_BREAKOUT_ROOM)) {
isBreakoutRoom = extras.getBoolean(KEY_IS_BREAKOUT_ROOM);
}
credentials = ApiUtils.getCredentials(conversationUser.getUsername(), conversationUser.getToken());
baseUrl = extras.getString(KEY_MODIFIED_BASE_URL, "");
@ -496,7 +502,7 @@ public class CallActivity extends CallBaseActivity {
}
private void initFeaturesVisibility() {
if (isAllowedToStartOrStopRecording()) {
if (isAllowedToStartOrStopRecording() || isAllowedToRaiseHand()) {
binding.moreCallActions.setVisibility(View.VISIBLE);
} else {
binding.moreCallActions.setVisibility(View.GONE);
@ -1225,6 +1231,12 @@ public class CallActivity extends CallBaseActivity {
}
public void clickHand(Boolean raise) {
if (isBreakoutRoom) {
Log.d(TAG, "send request to request help for breakout rooms.");
}
//
// TODO: fix how to build&send the message
// if (isConnectionEstablished() && peerConnectionWrapperList != null) {
// if (!hasMCU) {
@ -1911,7 +1923,6 @@ public class CallActivity extends CallBaseActivity {
Bundle bundle = new Bundle();
bundle.putBoolean(KEY_SWITCH_TO_ROOM_AND_START_CALL, true);
bundle.putString(KEY_ROOM_TOKEN, switchToRoomToken);
// bundle.putString(KEY_ROOM_ID, roomId);
bundle.putParcelable(KEY_USER_ENTITY, conversationUser);
// conversationName = extras.getString(KEY_CONVERSATION_NAME, "");
@ -3062,7 +3073,8 @@ public class CallActivity extends CallBaseActivity {
}
public boolean isAllowedToRaiseHand() {
return CapabilitiesUtilNew.hasSpreedFeatureCapability(conversationUser, "raise-hand");
return CapabilitiesUtilNew.hasSpreedFeatureCapability(conversationUser, "raise-hand") ||
isBreakoutRoom;
}
private class SelfVideoTouchListener implements View.OnTouchListener {

View File

@ -173,6 +173,7 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ACTIVE_CONVERSATION
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CONVERSATION_NAME
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_FILE_PATHS
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_INTERNAL_USER_ID
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_BREAKOUT_ROOM
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_MODERATOR
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_RECORDING_STATE
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ID
@ -2841,6 +2842,10 @@ class ChatController(args: Bundle) :
bundle.putBoolean(BundleKeys.KEY_CALL_WITHOUT_NOTIFICATION, true)
}
if (it.objectType == BREAKOUT_ROOM_TYPE) {
bundle.putBoolean(KEY_IS_BREAKOUT_ROOM, true)
}
return if (activity != null) {
val callIntent = Intent(activity, CallActivity::class.java)
callIntent.putExtras(bundle)
@ -3531,5 +3536,6 @@ class ChatController(args: Bundle) :
private const val LOOKING_INTO_FUTURE_TIMEOUT = 30
private const val CHUNK_SIZE: Int = 10
private const val ONE_SECOND_IN_MILLIS = 1000
private const val BREAKOUT_ROOM_TYPE = "room"
}
}

View File

@ -81,4 +81,5 @@ object BundleKeys {
const val KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO = "KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO"
const val KEY_IS_MODERATOR = "KEY_IS_MODERATOR"
const val KEY_SWITCH_TO_ROOM_AND_START_CALL = "KEY_SWITCH_TO_ROOM_AND_START_CALL"
const val KEY_IS_BREAKOUT_ROOM = "KEY_IS_BREAKOUT_ROOM"
}

View File

@ -292,7 +292,7 @@ public class PeerConnectionWrapper {
try {
buffer = ByteBuffer.wrap(LoganSquare.serialize(dataChannelMessage).getBytes());
dataChannel.send(new DataChannel.Buffer(buffer, false));
} catch (IOException e) {
} catch (Exception e) {
Log.d(TAG, "Failed to send channel data, attempting regular " + dataChannelMessage);
}
}