贵族特权完善
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
package com.yizhuan.xchat_android_core.manager;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.style.ImageSpan;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
|
||||
@@ -13,6 +19,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.netease.nim.uikit.business.session.helper.MessageListPanelHelper;
|
||||
import com.netease.nim.uikit.common.antispam.AntiSpamEvent;
|
||||
import com.netease.nim.uikit.common.util.AntiSpamUtil;
|
||||
@@ -50,6 +57,7 @@ import com.netease.nimlib.sdk.util.api.RequestResult;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.R;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomMicInfo;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo;
|
||||
@@ -1488,11 +1496,28 @@ public final class IMNetEaseManager {
|
||||
msg.setRemoteExtension(remoteExtension);
|
||||
}
|
||||
}
|
||||
//需要稍微延迟点,否则有冲突
|
||||
new Handler().postDelayed(() -> noticeMemBerInNotice(msg), 500);
|
||||
|
||||
if (!needToHideEnterMessage(msg)) {
|
||||
addMessagesImmediately(msg);
|
||||
//需要稍微延迟点,否则有冲突
|
||||
new Handler().postDelayed(() -> noticeMemBerInNotice(msg), 500);
|
||||
} else {
|
||||
if (Objects.equals(String.valueOf(AuthModel.get().getCurrentUid()), account)) {
|
||||
//SingleToastUtil.showToast("您已隐身进入房间");
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
builder.append("-");
|
||||
builder.setSpan(new ImageSpan(
|
||||
BitmapFactory.decodeResource(
|
||||
BasicConfig.INSTANCE.getAppContext().getResources(),
|
||||
R.drawable.ic_hide_enter_room)),
|
||||
0, 1,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
builder.append(" ");
|
||||
builder.append("您已隐身进入房间");
|
||||
ToastUtils.show(builder);
|
||||
}
|
||||
}
|
||||
AvRoomDataManager.get().mRoomAllMemberList.add(chatRoomMember);
|
||||
addMessagesImmediately(!needToHideEnterMessage(msg) ? msg : null);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -59,6 +59,7 @@ public class DemoCache {
|
||||
private static final String KEY_RED_PACKAGE = "RedPackage";
|
||||
public static final String KEY_VIP_RED_POINT = "key_vip_red_point";
|
||||
private static final String KEY_AT_MSG_UUID = "AtMsgUuid";
|
||||
public static final String KEY_BOX_MESSAGE = "key_box_message";
|
||||
|
||||
/**
|
||||
* 保存网页域名
|
||||
|
@@ -419,8 +419,6 @@ public class NobleUtil {
|
||||
}
|
||||
|
||||
public static Object getResource(String type, MicMemberInfo chatRoomMember) {
|
||||
// 判断是否有权限
|
||||
if (!hasRightToDo(type, chatRoomMember)) return "";
|
||||
Object o;
|
||||
if (chatRoomMember == null || TextUtils.isEmpty(chatRoomMember.getAccount())
|
||||
|| chatRoomMember.getExtension() == null
|
||||
@@ -435,8 +433,6 @@ public class NobleUtil {
|
||||
}
|
||||
|
||||
public static Object getResource(String type, ChatRoomMember chatRoomMember) {
|
||||
// 判断是否有权限
|
||||
if (!hasRightToDo(type, chatRoomMember)) return "";
|
||||
Object o;
|
||||
if (chatRoomMember == null || TextUtils.isEmpty(chatRoomMember.getAccount())
|
||||
|| chatRoomMember.getExtension() == null
|
||||
|
@@ -48,6 +48,7 @@ import com.yizhuan.xchat_android_core.room.queue.bean.MicMemberInfo;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.BaseInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.LogUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_core.vip.UserVipInfo;
|
||||
import com.yizhuan.xchat_android_core.vip.VipInfo;
|
||||
@@ -58,6 +59,7 @@ import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
|
@@ -594,7 +594,7 @@ public class UserInfo implements Serializable {
|
||||
UserVipInfo userVipInfo = userInfo.getUserVipInfoVO();
|
||||
if (userVipInfo != null && !TextUtils.isEmpty(userVipInfo.getVipIcon())) {
|
||||
map.put(VIP_ICON, userVipInfo.getVipIcon());
|
||||
map.put(NobleResourceType.KEY_ENTER_HIDE, userVipInfo.getEnterHide() ? 1 : 0);
|
||||
map.put(NobleResourceType.KEY_ENTER_HIDE, userVipInfo.getEnterHide());
|
||||
if (!TextUtils.isEmpty(userVipInfo.getEnterRoomEffects())) {
|
||||
map.put(ENTER_ROOM_EFFECTS, userVipInfo.getEnterRoomEffects());
|
||||
}
|
||||
|
@@ -7,6 +7,6 @@ data class UserVipInfo(
|
||||
val vipLevel: Int = 0,
|
||||
val friendNickColour: String = "",
|
||||
val preventKick: Boolean = false,
|
||||
val enterHide: Boolean = false,
|
||||
var enterHide: Boolean = false,
|
||||
val enterRoomEffects: String = ""
|
||||
) : Serializable
|
||||
|
@@ -32,6 +32,11 @@ object VipModel : BaseModel() {
|
||||
api.sendVipBroadcast(content, AvRoomDataManager.get().roomUid)
|
||||
}
|
||||
|
||||
suspend fun changeInvisibleInRoom(open: Boolean): String? =
|
||||
launchRequest {
|
||||
api.changeInvisibleInRoom(open)
|
||||
}
|
||||
|
||||
|
||||
private interface Api {
|
||||
|
||||
@@ -70,6 +75,14 @@ object VipModel : BaseModel() {
|
||||
@Query("content") content: String,
|
||||
@Query("roomUid") roomUid: Long
|
||||
): ServiceResult<String>
|
||||
|
||||
/**
|
||||
* 开关隐身进房状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/vip/changeInvisibleInRoom")
|
||||
suspend fun changeInvisibleInRoom(@Query("open") open: Boolean): ServiceResult<String>
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user