use of net.iGap.observers.interfaces.OnClientJoinByInviteLink 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);
}
}
Aggregations