use of com.waz.api.VoiceChannel in project wire-android by wireapp.
the class ScalaConversationStore method hasOngoingCallInCurrentConversation.
@Override
public boolean hasOngoingCallInCurrentConversation() {
if (selectedConversation == null) {
return false;
}
VoiceChannel voiceChannel = selectedConversation.getVoiceChannel();
if (voiceChannel == null) {
return false;
}
VoiceChannelState state = voiceChannel.getState();
return state != VoiceChannelState.NO_ACTIVE_USERS && state != VoiceChannelState.UNKNOWN;
}
use of com.waz.api.VoiceChannel in project wire-android by wireapp.
the class MainActivity method startCall.
private void startCall(final boolean withVideo) {
final IConversation currentConversation = getStoreFactory().getConversationStore().getCurrentConversation();
if (currentConversation == null) {
return;
}
final VoiceChannel voiceChannel = currentConversation.getVoiceChannel();
if (currentConversation.hasUnjoinedCall() && voiceChannel.isVideoCall() != withVideo) {
ViewUtils.showAlertDialog(this, getString(R.string.calling__cannot_start__ongoing_different_kind__title, currentConversation.getName()), getString(R.string.calling__cannot_start__ongoing_different_kind__message), getString(R.string.calling__cannot_start__button), null, true);
return;
}
if (currentConversation.getType() == IConversation.Type.GROUP && currentConversation.getUsers().size() >= 5) {
int users = currentConversation.getUsers().size();
ViewUtils.showAlertDialog(this, getString(R.string.group_calling_title), getString(R.string.group_calling_message, users), getString(R.string.group_calling_confirm), getString(R.string.group_calling_cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
injectJava(CallPermissionsController.class).startCall(new ConvId(voiceChannel.getConversation().getId()), withVideo);
}
}, null);
return;
} else {
injectJava(CallPermissionsController.class).startCall(new ConvId(voiceChannel.getConversation().getId()), withVideo);
}
}
Aggregations