mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 09:05:59 +08:00
msgDestruct
This commit is contained in:
@@ -85,12 +85,13 @@ func (c *ConversationGorm) GetUserAllHasReadSeqs(ctx context.Context, ownerUserI
|
||||
var conversations []*relation.ConversationModel
|
||||
err = utils.Wrap(c.db(ctx).Where("owner_user_id = ?", ownerUserID).Select("conversation_id", "has_read_seq").Find(&conversations).Error, "")
|
||||
hasReadSeqs = make(map[string]int64, len(conversations))
|
||||
// for _, conversation := range conversations {
|
||||
// hasReadSeqs[conversation.ConversationID] = conversation.HasReadSeq
|
||||
// }
|
||||
return hasReadSeqs, err
|
||||
}
|
||||
|
||||
func (c *ConversationGorm) GetConversationsByConversationID(ctx context.Context, conversationIDs []string) (conversations []*relation.ConversationModel, err error) {
|
||||
return conversations, utils.Wrap(c.db(ctx).Where("conversation_id IN (?)", conversationIDs).Find(&conversations).Error, "")
|
||||
}
|
||||
|
||||
func (c *ConversationGorm) GetConversationIDsNeedDestruct(ctx context.Context) (conversations []*relation.ConversationModel, err error) {
|
||||
return conversations, utils.Wrap(c.db(ctx).Where("UNIX_TIMESTAMP(NOW()) > (msg_destruct_time + UNIX_TIMESTAMP(latest_msg_destruct_time)) && msg_destruct_time != 0").Error, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user