修改好友欢迎提示方式,默认为关,需要在客户端上实现后打开
This commit is contained in:
@@ -94,6 +94,12 @@ friend.reject_request_duration 2592000000
|
|||||||
##好友请求过期时间,单位是毫秒,默认是7天,0为不限制
|
##好友请求过期时间,单位是毫秒,默认是7天,0为不限制
|
||||||
friend.request_expiration_duration 604800000
|
friend.request_expiration_duration 604800000
|
||||||
|
|
||||||
|
##添加好友后会发送欢迎消息,比如"你们已经是好友了,可以聊天了"。这个开关控制是用旧的方式还是用新的方式。
|
||||||
|
##旧的方式会发送notification消息(contenttype是80),内容会根据好友接收者的语言选择对应的语言,如果双方语言不一致会导致另外一方看到的不是本地语言。
|
||||||
|
##新的方式会发送添加好友消息(contenttype是93)和欢迎消息(contenttype是92),需要客户端实现这两种消息。
|
||||||
|
##如果客户端已经实现这两种消息可以打开这个开关
|
||||||
|
friend.new_welcome_message false
|
||||||
|
|
||||||
## 聊天室观众空闲退出时间,单位为毫秒,默认为15分钟,0为永远不退出
|
## 聊天室观众空闲退出时间,单位为毫秒,默认为15分钟,0为永远不退出
|
||||||
chatroom.participant_idle_time 900000
|
chatroom.participant_idle_time 900000
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ 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_New_Welcome_Message = "friend.new_welcome_message";
|
||||||
|
|
||||||
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";
|
||||||
|
|||||||
@@ -43,7 +43,12 @@ public class HandleFriendRequestHandler extends IMHandler<WFCMessage.HandleFrien
|
|||||||
if (session != null && !StringUtil.isNullOrEmpty(session.getLanguage())) {
|
if (session != null && !StringUtil.isNullOrEmpty(session.getLanguage())) {
|
||||||
language = session.getLanguage();
|
language = session.getLanguage();
|
||||||
}
|
}
|
||||||
WFCMessage.MessageContent.Builder contentBuilder = WFCMessage.MessageContent.newBuilder().setType(90).setContent(I18n.getString(language, "Above_Greeting_Message"));
|
WFCMessage.MessageContent.Builder contentBuilder = WFCMessage.MessageContent.newBuilder();
|
||||||
|
if (m_messagesStore.isNewFriendWelcomeMessage()) {
|
||||||
|
contentBuilder.setType(92);
|
||||||
|
} else {
|
||||||
|
contentBuilder.setType(90).setContent(I18n.getString(language, "Above_Greeting_Message"));
|
||||||
|
}
|
||||||
|
|
||||||
builder = WFCMessage.Message.newBuilder();
|
builder = WFCMessage.Message.newBuilder();
|
||||||
builder.setFromUser(request.getTargetUid());
|
builder.setFromUser(request.getTargetUid());
|
||||||
@@ -56,7 +61,12 @@ public class HandleFriendRequestHandler extends IMHandler<WFCMessage.HandleFrien
|
|||||||
builder.setMessageId(messageId);
|
builder.setMessageId(messageId);
|
||||||
saveAndPublish(request.getTargetUid(), null, builder.build(), false);
|
saveAndPublish(request.getTargetUid(), null, builder.build(), false);
|
||||||
|
|
||||||
contentBuilder.setContent(I18n.getString(language, "Friend_Can_Start_Chat"));
|
if (m_messagesStore.isNewFriendWelcomeMessage()) {
|
||||||
|
contentBuilder.setType(93);
|
||||||
|
} else {
|
||||||
|
contentBuilder.setContent(I18n.getString(language, "Friend_Can_Start_Chat"));
|
||||||
|
}
|
||||||
|
|
||||||
builder.setContent(contentBuilder);
|
builder.setContent(contentBuilder);
|
||||||
messageId = MessageShardingUtil.generateId();
|
messageId = MessageShardingUtil.generateId();
|
||||||
builder.setMessageId(messageId);
|
builder.setMessageId(messageId);
|
||||||
|
|||||||
@@ -127,6 +127,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 mFriendNewWelcomeMessage = false;
|
||||||
|
|
||||||
private boolean mMultiPlatformNotification = false;
|
private boolean mMultiPlatformNotification = false;
|
||||||
private boolean mDisableStrangerChat = false;
|
private boolean mDisableStrangerChat = false;
|
||||||
@@ -204,6 +205,15 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
printMissConfigLog(FRIEND_Request_Expiration_Duration, mFriendRequestExpiration + "");
|
printMissConfigLog(FRIEND_Request_Expiration_Duration, mFriendRequestExpiration + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
mFriendNewWelcomeMessage = Boolean.parseBoolean(m_Server.getConfig().getProperty(FRIEND_New_Welcome_Message));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Utility.printExecption(LOG, e);
|
||||||
|
printMissConfigLog(FRIEND_New_Welcome_Message, mFriendNewWelcomeMessage + "");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
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) {
|
||||||
@@ -2436,6 +2446,11 @@ public class MemoryMessagesStore implements IMessagesStore {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNewFriendWelcomeMessage() {
|
||||||
|
return mFriendNewWelcomeMessage;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ErrorCode deleteFriend(String userId, String friendUid, long[] head) {
|
public ErrorCode deleteFriend(String userId, String friendUid, long[] head) {
|
||||||
HazelcastInstance hzInstance = m_Server.getHazelcastInstance();
|
HazelcastInstance hzInstance = m_Server.getHazelcastInstance();
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ public interface IMessagesStore {
|
|||||||
|
|
||||||
ErrorCode saveAddFriendRequest(String userId, WFCMessage.AddFriendRequest request, long[] head);
|
ErrorCode saveAddFriendRequest(String userId, WFCMessage.AddFriendRequest request, long[] head);
|
||||||
ErrorCode handleFriendRequest(String userId, WFCMessage.HandleFriendRequest request, WFCMessage.Message.Builder msgBuilder, long[] heads, boolean isAdmin);
|
ErrorCode handleFriendRequest(String userId, WFCMessage.HandleFriendRequest request, WFCMessage.Message.Builder msgBuilder, long[] heads, boolean isAdmin);
|
||||||
|
boolean isNewFriendWelcomeMessage();
|
||||||
ErrorCode deleteFriend(String userId, String friendUid, long[] head);
|
ErrorCode deleteFriend(String userId, String friendUid, long[] head);
|
||||||
ErrorCode blackUserRequest(String fromUser, String targetUserId, int status, long[] head);
|
ErrorCode blackUserRequest(String fromUser, String targetUserId, int status, long[] head);
|
||||||
FriendData getFriendData(String fromUser, String targetUserId);
|
FriendData getFriendData(String fromUser, String targetUserId);
|
||||||
|
|||||||
@@ -85,6 +85,12 @@ friend.reject_request_duration 2592000000
|
|||||||
##好友请求过期时间,单位是毫秒,默认是7天,0为不限制
|
##好友请求过期时间,单位是毫秒,默认是7天,0为不限制
|
||||||
friend.request_expiration_duration 604800000
|
friend.request_expiration_duration 604800000
|
||||||
|
|
||||||
|
##添加好友后会发送欢迎消息,比如"你们已经是好友了,可以聊天了"。这个开关控制是用旧的方式还是用新的方式。
|
||||||
|
##旧的方式会发送notification消息(contenttype是80),内容会根据好友接收者的语言选择对应的语言,如果双方语言不一致会导致另外一方看到的不是本地语言。
|
||||||
|
##新的方式会发送添加好友消息(contenttype是93)和欢迎消息(contenttype是92),需要客户端实现这两种消息。
|
||||||
|
##如果客户端已经实现这两种消息可以打开这个开关
|
||||||
|
friend.new_welcome_message false
|
||||||
|
|
||||||
## 聊天室观众空闲退出时间,单位为毫秒,默认为15分钟,0为永远不退出
|
## 聊天室观众空闲退出时间,单位为毫秒,默认为15分钟,0为永远不退出
|
||||||
chatroom.participant_idle_time 900000
|
chatroom.participant_idle_time 900000
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user