添加配置,请求机器人好友时,是否自动接受
This commit is contained in:
@@ -154,6 +154,9 @@ friend.reject_request_duration 2592000000
|
|||||||
##好友请求过期时间,单位是毫秒,默认是7天,0为无限长期限。
|
##好友请求过期时间,单位是毫秒,默认是7天,0为无限长期限。
|
||||||
friend.request_expiration_duration 604800000
|
friend.request_expiration_duration 604800000
|
||||||
|
|
||||||
|
##请求添加机器人为好友时,机器人是否自动接受,默认为true
|
||||||
|
friend.robot_auto_accept true
|
||||||
|
|
||||||
## 聊天室观众空闲退出时间,单位为毫秒,默认为15分钟,0为永远不退出
|
## 聊天室观众空闲退出时间,单位为毫秒,默认为15分钟,0为永远不退出
|
||||||
chatroom.participant_idle_time 900000
|
chatroom.participant_idle_time 900000
|
||||||
|
|
||||||
|
|||||||
@@ -163,6 +163,8 @@ public final class BrokerConstants {
|
|||||||
public static final String FRIEND_Repeat_Request_Duration = "friend.repeat_request_duration";
|
public static final String FRIEND_Repeat_Request_Duration = "friend.repeat_request_duration";
|
||||||
public static final String FRIEND_Reject_Request_Duration = "friend.reject_request_duration";
|
public static final String FRIEND_Reject_Request_Duration = "friend.reject_request_duration";
|
||||||
public static final String FRIEND_Request_Expiration_Duration = "friend.request_expiration_duration";
|
public static final String FRIEND_Request_Expiration_Duration = "friend.request_expiration_duration";
|
||||||
|
public static final String FRIEND_Request_Robot_Auto_Accept = "friend.robot_auto_accept";
|
||||||
|
|
||||||
|
|
||||||
public static final String CHATROOM_Participant_Idle_Time = "chatroom.participant_idle_time";
|
public static final String CHATROOM_Participant_Idle_Time = "chatroom.participant_idle_time";
|
||||||
public static final String CHATROOM_Rejoin_When_Active = "chatroom.rejoin_when_active";
|
public static final String CHATROOM_Rejoin_When_Active = "chatroom.rejoin_when_active";
|
||||||
|
|||||||
@@ -30,8 +30,10 @@ public class AddFriendHandler extends GroupHandler<WFCMessage.AddFriendRequest>
|
|||||||
if (user != null && user.getType() == ProtoConstants.UserType.UserType_Normal) {
|
if (user != null && user.getType() == ProtoConstants.UserType.UserType_Normal) {
|
||||||
publisher.publishNotification(IMTopic.NotifyFriendRequestTopic, request.getTargetUid(), head[0], fromUser, request.getReason());
|
publisher.publishNotification(IMTopic.NotifyFriendRequestTopic, request.getTargetUid(), head[0], fromUser, request.getReason());
|
||||||
} else if(user != null && user.getType() == ProtoConstants.UserType.UserType_Robot) {
|
} else if(user != null && user.getType() == ProtoConstants.UserType.UserType_Robot) {
|
||||||
WFCMessage.HandleFriendRequest handleFriendRequest = WFCMessage.HandleFriendRequest.newBuilder().setTargetUid(fromUser).setStatus(ProtoConstants.FriendRequestStatus.RequestStatus_Accepted).build();
|
if(m_messagesStore.isRobotAutoAcceptFriendRequest()) {
|
||||||
mServer.onApiMessage(request.getTargetUid(), null, handleFriendRequest.toByteArray(), 0, fromUser, HandleFriendRequestTopic, requestSourceType);
|
WFCMessage.HandleFriendRequest handleFriendRequest = WFCMessage.HandleFriendRequest.newBuilder().setTargetUid(fromUser).setStatus(ProtoConstants.FriendRequestStatus.RequestStatus_Accepted).build();
|
||||||
|
mServer.onApiMessage(request.getTargetUid(), null, handleFriendRequest.toByteArray(), 0, fromUser, HandleFriendRequestTopic, requestSourceType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return errorCode;
|
return errorCode;
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
private long mFriendRequestDuration = 7 * 24 * 60 * 60 * 1000;
|
private long mFriendRequestDuration = 7 * 24 * 60 * 60 * 1000;
|
||||||
private long mFriendRejectDuration = 30 * 24 * 60 * 60 * 1000;
|
private long mFriendRejectDuration = 30 * 24 * 60 * 60 * 1000;
|
||||||
private long mFriendRequestExpiration = 7 * 24 * 60 * 60 * 1000;
|
private long mFriendRequestExpiration = 7 * 24 * 60 * 60 * 1000;
|
||||||
|
private boolean mFriendRobotAutoAccept = true;
|
||||||
|
|
||||||
private boolean mMultiPlatformNotification = false;
|
private boolean mMultiPlatformNotification = false;
|
||||||
private boolean mMobileDefaultSilentWhenPCOnline = true;
|
private boolean mMobileDefaultSilentWhenPCOnline = true;
|
||||||
@@ -297,6 +298,12 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
printMissConfigLog(FRIEND_Request_Expiration_Duration, mFriendRequestExpiration + "");
|
printMissConfigLog(FRIEND_Request_Expiration_Duration, mFriendRequestExpiration + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
mFriendRobotAutoAccept = Boolean.parseBoolean(m_Server.getConfig().getProperty(BrokerConstants.FRIEND_Request_Robot_Auto_Accept, "true"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mChatroomRejoinWhenActive = Boolean.parseBoolean(m_Server.getConfig().getProperty(BrokerConstants.CHATROOM_Rejoin_When_Active));
|
mChatroomRejoinWhenActive = Boolean.parseBoolean(m_Server.getConfig().getProperty(BrokerConstants.CHATROOM_Rejoin_When_Active));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -4306,6 +4313,11 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
return mChannelCallbackWithClientInfo;
|
return mChannelCallbackWithClientInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRobotAutoAcceptFriendRequest() {
|
||||||
|
return mFriendRobotAutoAccept;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> getClientForbiddenSendTypes() {
|
public List<Integer> getClientForbiddenSendTypes() {
|
||||||
return mForbiddenClientSendTypes;
|
return mForbiddenClientSendTypes;
|
||||||
|
|||||||
@@ -239,6 +239,8 @@ public interface IMessagesStore {
|
|||||||
boolean isRobotCallbackWithClientInfo();
|
boolean isRobotCallbackWithClientInfo();
|
||||||
boolean isChannelCallbackWithClientInfo();
|
boolean isChannelCallbackWithClientInfo();
|
||||||
|
|
||||||
|
boolean isRobotAutoAcceptFriendRequest();
|
||||||
|
|
||||||
List<Integer> getClientForbiddenSendTypes();
|
List<Integer> getClientForbiddenSendTypes();
|
||||||
List<Integer> getBlackListExceptionTypes();
|
List<Integer> getBlackListExceptionTypes();
|
||||||
List<Integer> getGroupMuteExceptionTypes();
|
List<Integer> getGroupMuteExceptionTypes();
|
||||||
|
|||||||
@@ -152,6 +152,9 @@ friend.reject_request_duration 2592000000
|
|||||||
##好友请求过期时间,单位是毫秒,默认是7天,0为无限长期限。
|
##好友请求过期时间,单位是毫秒,默认是7天,0为无限长期限。
|
||||||
friend.request_expiration_duration 604800000
|
friend.request_expiration_duration 604800000
|
||||||
|
|
||||||
|
##请求添加机器人为好友时,机器人是否自动接受,默认为true
|
||||||
|
friend.robot_auto_accept true
|
||||||
|
|
||||||
## 聊天室观众空闲退出时间,单位为毫秒,默认为15分钟,0为永远不退出
|
## 聊天室观众空闲退出时间,单位为毫秒,默认为15分钟,0为永远不退出
|
||||||
chatroom.participant_idle_time 900000
|
chatroom.participant_idle_time 900000
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user