|
|
@ -59,6 +59,7 @@ func NewGroupNotificationSender(
|
|
|
|
config: config,
|
|
|
|
config: config,
|
|
|
|
|
|
|
|
|
|
|
|
conversationRpcClient: conversationRpcClient,
|
|
|
|
conversationRpcClient: conversationRpcClient,
|
|
|
|
|
|
|
|
msgRpcClient: msgRpcClient,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -69,6 +70,7 @@ type GroupNotificationSender struct {
|
|
|
|
config *Config
|
|
|
|
config *Config
|
|
|
|
|
|
|
|
|
|
|
|
conversationRpcClient *rpcclient.ConversationRpcClient
|
|
|
|
conversationRpcClient *rpcclient.ConversationRpcClient
|
|
|
|
|
|
|
|
msgRpcClient *rpcclient.MessageRpcClient
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) PopulateGroupMember(ctx context.Context, members ...*model.GroupMember) error {
|
|
|
|
func (g *GroupNotificationSender) PopulateGroupMember(ctx context.Context, members ...*model.GroupMember) error {
|
|
|
@ -516,14 +518,11 @@ func (g *GroupNotificationSender) MemberEnterNotification(ctx context.Context, g
|
|
|
|
|
|
|
|
|
|
|
|
if !g.config.RpcConfig.EnableHistoryForNewMembers {
|
|
|
|
if !g.config.RpcConfig.EnableHistoryForNewMembers {
|
|
|
|
conversationID := msgprocessor.GetConversationIDBySessionType(constant.ReadGroupChatType, groupID)
|
|
|
|
conversationID := msgprocessor.GetConversationIDBySessionType(constant.ReadGroupChatType, groupID)
|
|
|
|
conversation, err := g.conversationRpcClient.GetConversationsByConversationID(ctx, []string{conversationID})
|
|
|
|
maxSeq, err := g.msgRpcClient.GetConversationMaxSeq(ctx, conversationID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(conversation) == 0 {
|
|
|
|
err = g.conversationRpcClient.SetConversationMinSeq(ctx, entrantUserID, conversationID, maxSeq)
|
|
|
|
return errs.New("group conversation not found").Wrap()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
err = g.conversationRpcClient.SetConversationMaxSeq(ctx, entrantUserID, conversationID, conversation[0].MaxSeq)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|