mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-20 03:09:23 +08:00
conversation
This commit is contained in:
parent
d9afe8a562
commit
8a073a9dfb
@ -2,6 +2,8 @@ package group
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||
@ -12,7 +14,6 @@ import (
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/group"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
||||
"time"
|
||||
)
|
||||
|
||||
func CallbackBeforeCreateGroup(ctx context.Context, req *group.CreateGroupReq) (err error) {
|
||||
|
@ -68,12 +68,16 @@ func (c *ConversationDataBase) SetUsersConversationFiledTx(ctx context.Context,
|
||||
temp.OwnerUserID = v
|
||||
cList = append(cList, temp)
|
||||
}
|
||||
err = conversationTx.Create(ctx, cList)
|
||||
if err != nil {
|
||||
return err
|
||||
cache := c.cache.NewCache()
|
||||
if len(cList) > 0 {
|
||||
err = conversationTx.Create(ctx, cList)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cache = cache.DelConversationIDs(NotUserIDs)
|
||||
}
|
||||
// clear cache
|
||||
return c.cache.DelConversationIDs(NotUserIDs).DelUsersConversation(haveUserIDs, conversation.ConversationID).ExecDel(ctx)
|
||||
return cache.DelUsersConversation(haveUserIDs, conversation.ConversationID).ExecDel(ctx)
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user