Search in sources :

Example 1 with ConvId

use of com.waz.model.ConvId 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);
    }
}
Also used : CallPermissionsController(com.waz.zclient.calling.controllers.CallPermissionsController) DialogInterface(android.content.DialogInterface) VoiceChannel(com.waz.api.VoiceChannel) IConversation(com.waz.api.IConversation) ConvId(com.waz.model.ConvId) Paint(android.graphics.Paint)

Aggregations

DialogInterface (android.content.DialogInterface)1 Paint (android.graphics.Paint)1 IConversation (com.waz.api.IConversation)1 VoiceChannel (com.waz.api.VoiceChannel)1 ConvId (com.waz.model.ConvId)1 CallPermissionsController (com.waz.zclient.calling.controllers.CallPermissionsController)1