mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 18:15:59 +08:00
msg
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
type ConversationLocalCacheInterface interface {
|
||||
GetRecvMsgNotNotifyUserIDs(ctx context.Context, groupID string) ([]string, error)
|
||||
GetConversationIDs(ctx context.Context, userID string) ([]string, error)
|
||||
}
|
||||
|
||||
type ConversationLocalCache struct {
|
||||
@@ -40,3 +41,18 @@ func (g *ConversationLocalCache) GetRecvMsgNotNotifyUserIDs(ctx context.Context,
|
||||
}
|
||||
return resp.UserIDs, nil
|
||||
}
|
||||
|
||||
func (g *ConversationLocalCache) GetConversationIDs(ctx context.Context, userID string) ([]string, error) {
|
||||
conn, err := g.client.GetConn(ctx, config.Config.RpcRegisterName.OpenImConversationName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client := conversation.NewConversationClient(conn)
|
||||
resp, err := client.GetConversationIDs(ctx, &conversation.GetConversationIDsReq{
|
||||
UserID: userID,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.ConversationIDs, nil
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func (g *GroupLocalCache) GetGroupMemberIDs(ctx context.Context, groupID string)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(resp.GroupAbstractInfos) < 0 {
|
||||
if len(resp.GroupAbstractInfos) < 1 {
|
||||
return nil, errs.ErrGroupIDNotFound
|
||||
}
|
||||
localHashInfo, ok := g.cache[groupID]
|
||||
|
||||
Reference in New Issue
Block a user