添加拉取历史消息开关。设置默认消息漫游和拉取都为关闭,这样无法删除问题就不会再出现
This commit is contained in:
@@ -43,7 +43,10 @@ client.proto.secret_key 0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x78,0x79,0x7A,0
|
|||||||
token.key testim
|
token.key testim
|
||||||
|
|
||||||
##首次登录,是否接收之前的历史消息。0 不接收;1接收。
|
##首次登录,是否接收之前的历史消息。0 不接收;1接收。
|
||||||
message.roaming 1
|
message.roaming 0
|
||||||
|
|
||||||
|
##是否开启拉取远程历史消息
|
||||||
|
message.remote_history_message 0
|
||||||
|
|
||||||
#*********************************************************************
|
#*********************************************************************
|
||||||
# hazelcase configuration
|
# hazelcase configuration
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ public final class BrokerConstants {
|
|||||||
public static final String MONGODB_Data_Expire_Days = "mongodb.data_expire_days";
|
public static final String MONGODB_Data_Expire_Days = "mongodb.data_expire_days";
|
||||||
|
|
||||||
public static final String MESSAGE_ROAMING = "message.roaming";
|
public static final String MESSAGE_ROAMING = "message.roaming";
|
||||||
|
public static final String MESSAGE_Remote_History_Message = "message.reomte_history_message";
|
||||||
|
|
||||||
|
|
||||||
private BrokerConstants() {
|
private BrokerConstants() {
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
|
|
||||||
private static boolean IS_MESSAGE_ROAMING = true;
|
private static boolean IS_MESSAGE_ROAMING = true;
|
||||||
|
|
||||||
|
private static boolean IS_MESSAGE_REMOTE_HISTORY_MESSAGE = true;
|
||||||
|
|
||||||
static final String USER_ROBOTS = "user_robots";
|
static final String USER_ROBOTS = "user_robots";
|
||||||
static final String USER_THINGS = "user_things";
|
static final String USER_THINGS = "user_things";
|
||||||
|
|
||||||
@@ -119,6 +121,7 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
m_Server = server;
|
m_Server = server;
|
||||||
this.databaseStore = databaseStore;
|
this.databaseStore = databaseStore;
|
||||||
IS_MESSAGE_ROAMING = "1".equals(m_Server.getConfig().getProperty(MESSAGE_ROAMING));
|
IS_MESSAGE_ROAMING = "1".equals(m_Server.getConfig().getProperty(MESSAGE_ROAMING));
|
||||||
|
IS_MESSAGE_REMOTE_HISTORY_MESSAGE = "1".equals(m_Server.getConfig().getProperty(MESSAGE_Remote_History_Message));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -370,7 +373,12 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
@Override
|
@Override
|
||||||
public WFCMessage.PullMessageResult loadRemoteMessages(String user, WFCMessage.Conversation conversation, long beforeUid, int count) {
|
public WFCMessage.PullMessageResult loadRemoteMessages(String user, WFCMessage.Conversation conversation, long beforeUid, int count) {
|
||||||
WFCMessage.PullMessageResult.Builder builder = WFCMessage.PullMessageResult.newBuilder();
|
WFCMessage.PullMessageResult.Builder builder = WFCMessage.PullMessageResult.newBuilder();
|
||||||
List<WFCMessage.Message> messages = databaseStore.loadRemoteMessages(user, conversation, beforeUid, count);
|
List<WFCMessage.Message> messages;
|
||||||
|
if (IS_MESSAGE_REMOTE_HISTORY_MESSAGE) {
|
||||||
|
messages = databaseStore.loadRemoteMessages(user, conversation, beforeUid, count);
|
||||||
|
} else {
|
||||||
|
messages = new ArrayList<>();
|
||||||
|
}
|
||||||
builder.setCurrent(0).setHead(0);
|
builder.setCurrent(0).setHead(0);
|
||||||
if(messages != null) {
|
if(messages != null) {
|
||||||
builder.addAllMessage(messages);
|
builder.addAllMessage(messages);
|
||||||
|
|||||||
@@ -43,7 +43,10 @@ client.proto.secret_key 0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x78,0x79,0x7A,0
|
|||||||
token.key testim
|
token.key testim
|
||||||
|
|
||||||
##首次登录,是否接收之前的历史消息。0 不接收;1接收。
|
##首次登录,是否接收之前的历史消息。0 不接收;1接收。
|
||||||
message.roaming 1
|
message.roaming 0
|
||||||
|
|
||||||
|
##是否开启拉取远程历史消息
|
||||||
|
message.remote_history_message 0
|
||||||
|
|
||||||
#*********************************************************************
|
#*********************************************************************
|
||||||
# hazelcase configuration
|
# hazelcase configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user