mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-20 19:49:17 +08:00
conversation
This commit is contained in:
parent
d9afe8a562
commit
8a073a9dfb
@ -2,6 +2,8 @@ package group
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
"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/group"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func CallbackBeforeCreateGroup(ctx context.Context, req *group.CreateGroupReq) (err error) {
|
func CallbackBeforeCreateGroup(ctx context.Context, req *group.CreateGroupReq) (err error) {
|
||||||
|
@ -68,12 +68,16 @@ func (c *ConversationDataBase) SetUsersConversationFiledTx(ctx context.Context,
|
|||||||
temp.OwnerUserID = v
|
temp.OwnerUserID = v
|
||||||
cList = append(cList, temp)
|
cList = append(cList, temp)
|
||||||
}
|
}
|
||||||
err = conversationTx.Create(ctx, cList)
|
cache := c.cache.NewCache()
|
||||||
if err != nil {
|
if len(cList) > 0 {
|
||||||
return err
|
err = conversationTx.Create(ctx, cList)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
cache = cache.DelConversationIDs(NotUserIDs)
|
||||||
}
|
}
|
||||||
// clear cache
|
// 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