Search in sources :

Example 1 with RequestClientJoinByInviteLink

use of net.iGap.request.RequestClientJoinByInviteLink in project iGap-Android by KianIranian-STDG.

the class HelperUrl method joinToRoom.

private static void joinToRoom(FragmentActivity activity, String token, final ProtoGlobal.Room room) {
    if (RequestManager.getInstance(AccountManager.selectedAccount).isUserLogin()) {
        showIndeterminateProgressDialog(activity);
        G.onClientJoinByInviteLink = new OnClientJoinByInviteLink() {

            @Override
            public void onClientJoinByInviteLinkResponse(long roomId) {
                closeDialogWaiting();
                new RequestClientGetRoom().clientGetRoom(roomId, RequestClientGetRoom.CreateRoomMode.requestFromOwner);
                if (roomId != FragmentChat.lastChatRoomId) {
                    new GoToChatActivity(roomId).startActivity(activity);
                }
                G.onClientJoinByInviteLink = null;
            }

            @Override
            public void onError(int majorCode, int minorCode) {
                closeDialogWaiting();
                G.onClientJoinByInviteLink = null;
            }
        };
        new RequestClientJoinByInviteLink().clientJoinByInviteLink(token);
    } else {
        closeDialogWaiting();
        HelperError.showSnackMessage(G.context.getString(R.string.there_is_no_connection_to_server), false);
    }
}
Also used : RequestClientJoinByInviteLink(net.iGap.request.RequestClientJoinByInviteLink) RequestClientGetRoom(net.iGap.request.RequestClientGetRoom) TextPaint(android.text.TextPaint) OnClientJoinByInviteLink(net.iGap.observers.interfaces.OnClientJoinByInviteLink)

Aggregations

TextPaint (android.text.TextPaint)1 OnClientJoinByInviteLink (net.iGap.observers.interfaces.OnClientJoinByInviteLink)1 RequestClientGetRoom (net.iGap.request.RequestClientGetRoom)1 RequestClientJoinByInviteLink (net.iGap.request.RequestClientJoinByInviteLink)1