feat:初步搭建房间内公聊
This commit is contained in:
@@ -48,4 +48,6 @@ public interface IInitialModel extends IModel {
|
||||
FairyOpenInfo getFairyOpenInfo();
|
||||
|
||||
void regionCheck();
|
||||
|
||||
String getPublicChatSessionId();
|
||||
}
|
||||
|
@@ -53,6 +53,7 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
@@ -482,6 +483,19 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
||||
return fairyOpenInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPublicChatSessionId() {
|
||||
long partitionId = UserModel.get().getPartitionId();
|
||||
if (cacheInitInfo == null) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> idMap = cacheInitInfo.getPublicChatRoomIdMap();
|
||||
if (idMap == null) {
|
||||
return null;
|
||||
}
|
||||
return idMap.get(partitionId + "");
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
/**
|
||||
* 客户端初始化
|
||||
|
@@ -19,6 +19,7 @@ import androidx.annotation.Nullable;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chwl.core.gift.bean.GiftType;
|
||||
import com.chwl.core.initial.InitialModel;
|
||||
import com.chwl.core.monsterhunting.bean.MonsterDataBean;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -619,6 +620,9 @@ public final class IMNetEaseManager {
|
||||
if (Objects.equals(sessionId, String.valueOf(PublicChatHallDataManager.get().getPublicChatHallId()))) {
|
||||
return true;
|
||||
}
|
||||
if (Objects.equals(sessionId, InitialModel.get().getPublicChatSessionId())) {
|
||||
return true;
|
||||
}
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoomInfo == null) {
|
||||
return false;
|
||||
|
@@ -41,6 +41,8 @@ public class UserInfo implements Serializable {
|
||||
public static String IS_NEW_USER = "newUser";
|
||||
public static String IS_FROM_SAY_HELLO_CHANNEL = "fromSayHelloChannel";
|
||||
public static String GENDER = "gender";
|
||||
public static String NICK = "nick";
|
||||
public static String AVATAR = "avatar";
|
||||
public static String IS_OFFICIAL = "official";
|
||||
public static String DEF_USER = "defUser";
|
||||
public static String HAS_PRETTY = "hasPrettyErbanNo";
|
||||
@@ -662,6 +664,8 @@ public class UserInfo implements Serializable {
|
||||
if (map == null) {
|
||||
map = new HashMap<>();
|
||||
}
|
||||
map.put(NICK, userInfo.getNick());
|
||||
map.put(AVATAR, userInfo.getNewAvatar());
|
||||
map.put(GENDER, userInfo.getGender());
|
||||
map.put(IS_OFFICIAL, userInfo.getDefUser() == USER_TYPE_OFFICIAL);
|
||||
map.put(IS_NEW_USER, isNewUser());
|
||||
|
Reference in New Issue
Block a user