package com.ss.android.ugc.aweme.live.livehostimpl;

import X.0Uo;
import X.1hK;
import X.B9B;
import X.C0892FsL;
import X.C3494GtD;
import X.C4115H7s;
import X.C4116H7t;
import X.C4117H7u;
import X.C4184HAj;
import X.C4185HAk;
import X.C4249HCw;
import X.C4250HCx;
import X.C4251HCy;
import X.ESC;
import X.FIx;
import X.FIy;
import X.GNM;
import X.KE3;
import X.Lw4;
import android.app.Activity;
import android.os.Bundle;
import com.bytedance.android.live.base.model.ImageModel;
import com.bytedance.android.livesdkapi.host.IHostUser;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.framework.services.IUserService;
import com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService;
import com.ss.android.ugc.aweme.im.service.model.IMUser;
import com.ss.android.ugc.aweme.live.LiveOuterService;
import com.ss.android.ugc.aweme.profile.model.FollowStatus;
import com.ss.android.ugc.aweme.profile.model.FollowStatusEvent;
import com.ss.android.ugc.aweme.profile.model.User;
import com.ss.android.ugc.aweme.sec.SecApiImpl;
import com.ss.android.ugc.aweme.services.BaseUserService;
import com.ss.android.ugc.aweme.services.BindService;
import java.util.ArrayList;
import java.util.List;
import org.greenrobot.eventbus.EventBus;

public class LiveHostUser implements IHostUser {
    public FIx LIZ;
    public C4116H7t LIZIZ;

    static {
        Covode.recordClassIndex(91254);
    }

    public boolean interceptOperation(String str) {
        return false;
    }

    public void markAsOutOfDate(boolean z) {
    }

    public void onInit() {
    }

    public void setRoomAttrsAdminFlag(int i) {
    }

    public void updateUser(0Uo r1) {
    }

    public boolean isDeleteByAgeGate() {
        return ESC.LJFF();
    }

    public boolean isMinorMode() {
        return ESC.LIZLLL();
    }

    public 0Uo getCurUser() {
        return C3494GtD.LIZ(BaseUserService.createIUserServicebyMonsterPlugin(false).getCurrentUser());
    }

    public long getCurUserId() {
        return Long.parseLong(BaseUserService.createIUserServicebyMonsterPlugin(false).getCurrentUserID());
    }

    public boolean isLogin() {
        return BaseUserService.createIUserServicebyMonsterPlugin(false).isLogin();
    }

    public void refreshUser() {
        IUserService createIUserServicebyMonsterPlugin = BaseUserService.createIUserServicebyMonsterPlugin(false);
        if (createIUserServicebyMonsterPlugin != null) {
            createIUserServicebyMonsterPlugin.refreshUser();
        }
    }

    public int getCurUserMode() {
        IUserService createIUserServicebyMonsterPlugin = BaseUserService.createIUserServicebyMonsterPlugin(false);
        if (createIUserServicebyMonsterPlugin == null || createIUserServicebyMonsterPlugin.getCurrentUser() == null) {
            return -1;
        }
        return createIUserServicebyMonsterPlugin.getCurrentUser().getUserMode();
    }

    public String getEmail() {
        User currentUser;
        IUserService createIUserServicebyMonsterPlugin = BaseUserService.createIUserServicebyMonsterPlugin(false);
        if (createIUserServicebyMonsterPlugin == null || (currentUser = createIUserServicebyMonsterPlugin.getCurrentUser()) == null) {
            return "";
        }
        return currentUser.getEmail();
    }

    public boolean isEmailVerified() {
        User currentUser;
        IUserService createIUserServicebyMonsterPlugin = BaseUserService.createIUserServicebyMonsterPlugin(false);
        if (createIUserServicebyMonsterPlugin == null || (currentUser = createIUserServicebyMonsterPlugin.getCurrentUser()) == null) {
            return false;
        }
        return currentUser.isEmailVerified();
    }

    public List<C0892FsL> getAllFriends() {
        List<IMUser> allFriends = IMService.createIIMServicebyMonsterPlugin(false).getAllFriends();
        ArrayList arrayList = new ArrayList();
        for (IMUser iMUser : allFriends) {
            if (!IMUser.isInvalidUser(iMUser.getUid())) {
                arrayList.add(new C0892FsL(Long.valueOf(Long.parseLong(iMUser.getUid())), iMUser.getSecUid(), iMUser.getNickName(), iMUser.getUniqueId(), new ImageModel(iMUser.getAvatarThumb().getUri(), iMUser.getAvatarThumb().getUrlList())));
            }
        }
        return arrayList;
    }

    public void requestLivePermission(GNM gnm) {
        LiveOuterService.LJJI().LIZLLL().LIZ(gnm);
    }

    public void unRegisterCurrentUserUpdateListener(FIy fIy) {
        FIx fIx = this.LIZ;
        if (fIx != null) {
            EventBus.LIZ().LIZIZ(fIx);
            fIx.LIZ = null;
        }
    }

    public void unRegisterFollowStatusListener(C4115H7s h7s) {
        C4116H7t h7t = this.LIZIZ;
        if (h7t != null) {
            EventBus.LIZ().LIZIZ(h7t);
            h7t.LIZ = null;
        }
    }

    public void registerCurrentUserUpdateListener(FIy fIy) {
        if (this.LIZ == null) {
            this.LIZ = new FIx((byte) 0);
        }
        this.LIZ.LIZ = fIy;
        this.LIZ.LIZ();
    }

    public void registerFollowStatusListener(C4115H7s h7s) {
        if (this.LIZIZ == null) {
            this.LIZIZ = new C4116H7t((byte) 0);
        }
        this.LIZIZ.LIZ = h7s;
        this.LIZIZ.LIZ();
    }

    public String getTTDisPlayName(String str, String str2) {
        return B9B.LIZ.LIZ(str2, str, false, false);
    }

    public void onFollowStatusChanged(int i, long j) {
        FollowStatus followStatus = new FollowStatus();
        followStatus.userId = String.valueOf(j);
        followStatus.followStatus = i;
        new FollowStatusEvent(followStatus).post();
    }

    public void popCaptchaV2(Activity activity, String str, final C4251HCy hCy) {
        SecApiImpl.LIZ().popCaptchaV2(activity, str, new KE3() {
            static {
                Covode.recordClassIndex(91255);
            }

            public final void LIZ(boolean z, int i) {
                if (z) {
                    hCy.LIZ();
                }
            }
        });
    }

    public void unFollowWithConfirm(Activity activity, int i, long j, C4117H7u h7u) {
        h7u.LIZ();
    }

    public void bindMobile(Activity activity, String str, String str2, Bundle bundle, C4250HCx hCx) {
        Activity activity2 = activity;
        String str3 = str2;
        BindService.createIBindServicebyMonsterPlugin(false).bindMobile(activity2, str, str3, bundle, new C4249HCw(hCx));
    }

    public void login(1hK r4, C4184HAj hAj, String str, String str2, int i, String str3, String str4, String str5) {
        Lw4.LIZ(r4, str4, "live_room", (Bundle) null, new C4185HAk(hAj));
    }
}
