package com.ss.android.ugc.aweme.compliance.privacy.settings.account.pages.comment;

import X.AnonymousClass2GO;
import X.AnonymousClass2UX;
import X.C12422nK;
import X.C37203mC;
import X.C38983p4;
import X.C38993p5;
import X.C39563q0;
import X.M12;
import X.PgU;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.base.api.BaseResponse;
import com.ss.android.ugc.aweme.compliance.privacy.settings.account.pages.BasePrivacyUserSettingViewModel;
import com.ss.android.ugc.aweme.profile.model.User;

public final class CommentViewModel extends BasePrivacyUserSettingViewModel implements AnonymousClass2GO {
    static {
        Covode.recordClassIndex(61620);
    }

    public final PgU<BaseResponse> LIZ(int i) {
        return C39563q0.LIZIZ.LIZ("comment", i);
    }

    public final Integer LIZ(C38993p5 r2) {
        M12.LIZ(r2);
        C37203mC r0 = r2.LIZ;
        if (r0 != null) {
            return Integer.valueOf(r0.LIZLLL);
        }
        return null;
    }

    public final void LIZ(C38993p5 r2, int i) {
        M12.LIZ(r2);
        C37203mC r0 = r2.LIZ;
        if (r0 != null) {
            r0.LIZLLL = i;
        }
    }

    public final void LIZ(int i, BaseResponse baseResponse) {
        String str;
        M12.LIZ(baseResponse);
        super.LIZ(i, baseResponse);
        if (i != 0) {
            if (i == 1) {
                str = "Friends";
            } else if (i != 3) {
                str = null;
            } else {
                str = "No_one";
            }
        } else if (C38983p4.LIZ.LIZIZ()) {
            str = "Followers";
        } else {
            str = "Everyone";
        }
        AnonymousClass2UX r2 = new AnonymousClass2UX();
        r2.LIZ("enter_from", "comment_permission");
        r2.LIZ("to_status", str);
        r2.LIZ("is_private", C38983p4.LIZ.LIZIZ() ? 1 : 0);
        C12422nK.LIZ("change_comment_permission", r2.LIZ);
        User LJ = C38983p4.LIZ.LJ();
        LJ.setCommentSetting(i);
        C38983p4.LIZ.LJFF().LJFF().updateCurUser(LJ);
    }
}
