mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 14:29:19 +08:00
sg recv opt
This commit is contained in:
@@ -40,6 +40,9 @@ const (
|
||||
sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG:"
|
||||
userBadgeUnreadCountSum = "USER_BADGE_UNREAD_COUNT_SUM:"
|
||||
exTypeKeyLocker = "EX_LOCK:"
|
||||
|
||||
//temp
|
||||
superGroupUserNotRecvOfflineMsgOptTemp = "SG_RECV_MSG_OPT_TEMP:"
|
||||
)
|
||||
|
||||
func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) {
|
||||
@@ -164,6 +167,23 @@ func (d *DataBases) GetSingleConversationRecvMsgOpt(userID, conversationID strin
|
||||
result, err := d.RDB.HGet(context.Background(), key, conversationID).Result()
|
||||
return utils.StringToInt(result), err
|
||||
}
|
||||
|
||||
func (d *DataBases) SetSuperGroupUserNotRecvOfflineMsgOpt(groupID, userID string) error {
|
||||
key := superGroupUserNotRecvOfflineMsgOptTemp + groupID
|
||||
return d.RDB.SAdd(context.Background(), key, userID).Err()
|
||||
}
|
||||
|
||||
func (d *DataBases) ReduceSuperGroupUserNotRecvOfflineMsgOpt(groupID, userID string) error {
|
||||
key := superGroupUserNotRecvOfflineMsgOptTemp + groupID
|
||||
return d.RDB.SRem(context.Background(), key, userID).Err()
|
||||
}
|
||||
|
||||
func (d *DataBases) GetSuperGroupUserNotRecvOfflineMsgIDList(groupID string) ([]string, error) {
|
||||
key := superGroupUserNotRecvOfflineMsgOptTemp + groupID
|
||||
userIDs, _ := d.RDB.SMembers(context.Background(), key).Result()
|
||||
return userIDs, nil
|
||||
}
|
||||
|
||||
func (d *DataBases) SetUserGlobalMsgRecvOpt(userID string, opt int32) error {
|
||||
key := conversationReceiveMessageOpt + userID
|
||||
return d.RDB.HSet(context.Background(), key, GlobalMsgRecvOpt, opt).Err()
|
||||
|
||||
Reference in New Issue
Block a user