超管踢管理员的提示区分平台超管和房间超管
This commit is contained in:
@@ -12,6 +12,7 @@ public class KickOutExtBean {
|
||||
|
||||
|
||||
public final static String KEY_ROLE = "role";
|
||||
public final static String KEY_UID = "handleUid";
|
||||
|
||||
/**
|
||||
* 操作者/超管 Uid
|
||||
|
@@ -7,7 +7,6 @@ import com.yizhuan.xchat_android_core.kick.KickModel;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatLogKey;
|
||||
import com.yizhuan.xchat_android_core.super_admin.bean.KickOutExtBean;
|
||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver;
|
||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||
@@ -24,6 +23,7 @@ public class SAdminOptUtil {
|
||||
|
||||
/**
|
||||
* 判断该操作,是不是超管发起的
|
||||
*
|
||||
* @param reason -
|
||||
* @return -
|
||||
*/
|
||||
@@ -32,10 +32,18 @@ public class SAdminOptUtil {
|
||||
return false;
|
||||
}
|
||||
Map<String, Object> map = reason.getExtension();
|
||||
|
||||
if (map.containsKey(KickOutExtBean.KEY_UID)) {
|
||||
Object handleUid = map.get(KickOutExtBean.KEY_UID);
|
||||
if (handleUid instanceof String && AvRoomDataManager.get().isSuperAdmin((String) handleUid)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (map.containsKey(KickOutExtBean.KEY_ROLE)) {
|
||||
Object role = map.get(KickOutExtBean.KEY_ROLE);
|
||||
if (role instanceof Integer) {
|
||||
return 1 == (Integer)role;
|
||||
return 1 == (Integer) role;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -56,13 +64,13 @@ public class SAdminOptUtil {
|
||||
Single<String> single;
|
||||
if (!AvRoomDataManager.get().isRoomAdmin()) {
|
||||
//将超管设置为房间管理员
|
||||
single = AvRoomModel.get().markManager(AuthModel.get().getCurrentUid(),true);
|
||||
single = AvRoomModel.get().markManager(AuthModel.get().getCurrentUid(), true);
|
||||
} else {
|
||||
single = Single.just("");
|
||||
}
|
||||
long roomId = AvRoomDataManager.get().getRoomId();
|
||||
single.flatMap(s -> IMNetEaseManager.get().kickMemberFromRoomBySdk(roomId,
|
||||
JavaUtil.str2long(kickUid), reason))
|
||||
JavaUtil.str2long(kickUid), reason))
|
||||
//发公屏
|
||||
.flatMap(s -> {
|
||||
ChatRoomMessage chatRoomMessage = SaAttachmentFactory
|
||||
|
Reference in New Issue
Block a user