调整再次添加好友逻辑:

1,如果没发过好友请求,或者上次发送好友请求状态为接受,可以发送
2,如果发送过好友请求,且状态不为接受,时间小于7天的,返回已经请求过错误码。
3,如果发送过好友请求,且状态不为接受,时间大于7天的,如果状态为reject,30天以内不能发送(返回拉黑错误码),30天以上可以再次发送
4,如果发送过好友请求,且状态不为接受,时间大于7天的,如果状态为sent,可以再次发送
This commit is contained in:
heavyrain.lee
2019-04-12 16:06:07 +08:00
parent 9560b9c202
commit 58c98bbbfa
@@ -1480,9 +1480,10 @@ public class MemoryMessagesStore implements IMessagesStore {
}
}
if (existRequest != null) {
if (existRequest.getStatus() != ProtoConstants.FriendRequestStatus.RequestStatus_Accepted && System.currentTimeMillis() - existRequest.getUpdateDt() > 7 * 24 * 60 * 60 * 1000) {
if (existRequest.getStatus() == ProtoConstants.FriendRequestStatus.RequestStatus_Rejected) {
if (existRequest != null && existRequest.getStatus() != ProtoConstants.FriendRequestStatus.RequestStatus_Accepted) {
if (System.currentTimeMillis() - existRequest.getUpdateDt() > 7 * 24 * 60 * 60 * 1000) {
if (existRequest.getStatus() == ProtoConstants.FriendRequestStatus.RequestStatus_Rejected
&& System.currentTimeMillis() - existRequest.getUpdateDt() < 30 * 24 * 60 * 60 * 1000) {
return ErrorCode.ERROR_CODE_FRIEND_REQUEST_BLOCKED;
}
requestMap.remove(userId, existRequest);