Add emdash instead of 0 if no callers are present and we haven't connected / loaded the group state.

This commit is contained in:
Alex Hart
2021-01-05 09:16:59 -04:00
committed by Alan Evans
parent 3474b26f61
commit e2872d9af8
7 changed files with 45 additions and 28 deletions

View File

@@ -3,6 +3,8 @@ package org.thoughtcrime.securesms.service.webrtc.state;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.annimon.stream.OptionalLong;
import org.signal.ringrtc.GroupCall;
import org.thoughtcrime.securesms.events.CallParticipant;
import org.thoughtcrime.securesms.events.CallParticipantId;
@@ -35,7 +37,7 @@ public class CallInfoState {
GroupCall groupCall;
WebRtcViewModel.GroupCallState groupState;
Set<RecipientId> identityChangedRecipients;
long remoteDevicesCount;
OptionalLong remoteDevicesCount;
Long participantLimit;
public CallInfoState() {
@@ -48,7 +50,7 @@ public class CallInfoState {
null,
WebRtcViewModel.GroupCallState.IDLE,
Collections.emptySet(),
0L,
OptionalLong.empty(),
null);
}
@@ -75,7 +77,7 @@ public class CallInfoState {
@Nullable GroupCall groupCall,
@NonNull WebRtcViewModel.GroupCallState groupState,
@NonNull Set<RecipientId> identityChangedRecipients,
long remoteDevicesCount,
@NonNull OptionalLong remoteDevicesCount,
@Nullable Long participantLimit)
{
this.callState = callState;
@@ -147,7 +149,7 @@ public class CallInfoState {
return identityChangedRecipients;
}
public long getRemoteDevicesCount() {
public OptionalLong getRemoteDevicesCount() {
return remoteDevicesCount;
}

View File

@@ -3,6 +3,8 @@ package org.thoughtcrime.securesms.service.webrtc.state;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.annimon.stream.OptionalLong;
import org.signal.ringrtc.GroupCall;
import org.thoughtcrime.securesms.components.webrtc.BroadcastVideoSink;
import org.thoughtcrime.securesms.events.CallParticipant;
@@ -258,7 +260,7 @@ public class WebRtcServiceStateBuilder {
}
public @NonNull CallInfoStateBuilder remoteDevicesCount(long remoteDevicesCount) {
toBuild.remoteDevicesCount = remoteDevicesCount;
toBuild.remoteDevicesCount = OptionalLong.of(remoteDevicesCount);
return this;
}