mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-10 03:56:00 +08:00
sg recv opt
This commit is contained in:
@@ -168,17 +168,17 @@ func (d *DataBases) GetSingleConversationRecvMsgOpt(userID, conversationID strin
|
||||
return utils.StringToInt(result), err
|
||||
}
|
||||
|
||||
func (d *DataBases) SetSuperGroupUserNotRecvOfflineMsgOpt(groupID, userID string) error {
|
||||
func (d *DataBases) SetSuperGroupUserReceiveNotNotifyMessage(groupID, userID string) error {
|
||||
key := superGroupUserNotRecvOfflineMsgOptTemp + groupID
|
||||
return d.RDB.SAdd(context.Background(), key, userID).Err()
|
||||
}
|
||||
|
||||
func (d *DataBases) ReduceSuperGroupUserNotRecvOfflineMsgOpt(groupID, userID string) error {
|
||||
func (d *DataBases) SetSuperGroupUserReceiveNotifyMessage(groupID, userID string) error {
|
||||
key := superGroupUserNotRecvOfflineMsgOptTemp + groupID
|
||||
return d.RDB.SRem(context.Background(), key, userID).Err()
|
||||
}
|
||||
|
||||
func (d *DataBases) GetSuperGroupUserNotRecvOfflineMsgIDList(groupID string) ([]string, error) {
|
||||
func (d *DataBases) GetSuperGroupUserReceiveNotNotifyMessageIDList(groupID string) ([]string, error) {
|
||||
key := superGroupUserNotRecvOfflineMsgOptTemp + groupID
|
||||
userIDs, _ := d.RDB.SMembers(context.Background(), key).Result()
|
||||
return userIDs, nil
|
||||
|
||||
@@ -119,6 +119,22 @@ func DifferenceString(slice1, slice2 []string) []string {
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func RemoveFromSlice(slice1, slice2 []string) []string {
|
||||
for _, v1 := range slice1 {
|
||||
for i2, v2 := range slice2 {
|
||||
if v2 == v1 {
|
||||
if i2 != len(slice2)-1 {
|
||||
slice2 = append(slice2[:i2], slice2[i2+1:]...)
|
||||
} else {
|
||||
slice2 = append(slice2[:i2])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return slice2
|
||||
}
|
||||
|
||||
func OperationIDGenerator() string {
|
||||
return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user