@@ -17,6 +17,7 @@ package group
1717import (
1818 "context"
1919 "fmt"
20+ "math"
2021 "math/big"
2122 "math/rand"
2223 "strconv"
@@ -472,6 +473,9 @@ func (g *groupServer) InviteUserToGroup(ctx context.Context, req *pbgroup.Invite
472473 g .notification .GroupApplicationAgreeMemberEnterNotification (ctx , req .GroupID , req .SendMessage , opUserID , userIDs ... )
473474 }
474475 }
476+ if err := g .setMemberJoinSeq (ctx , req .GroupID , req .InvitedUserIDs ); err != nil {
477+ return nil , err
478+ }
475479 return & pbgroup.InviteUserToGroupResp {}, nil
476480}
477481
@@ -905,6 +909,9 @@ func (g *groupServer) GroupApplicationResponse(ctx context.Context, req *pbgroup
905909 return nil , err
906910 }
907911 }
912+ if err := g .setMemberJoinSeq (ctx , req .GroupID , []string {req .FromUserID }); err != nil {
913+ return nil , err
914+ }
908915 }
909916 case constant .GroupResponseRefuse :
910917 g .notification .GroupApplicationRejectedNotification (ctx , req )
@@ -967,6 +974,9 @@ func (g *groupServer) JoinGroup(ctx context.Context, req *pbgroup.JoinGroupReq)
967974 if err = g .notification .MemberEnterNotification (ctx , req .GroupID , req .InviterUserID ); err != nil {
968975 return nil , err
969976 }
977+ if err := g .setMemberJoinSeq (ctx , req .GroupID , []string {req .InviterUserID }); err != nil {
978+ return nil , err
979+ }
970980 g .webhookAfterJoinGroup (ctx , & g .config .WebhooksConfig .AfterJoinGroup , req )
971981
972982 return & pbgroup.JoinGroupResp {}, nil
@@ -1028,6 +1038,11 @@ func (g *groupServer) deleteMemberAndSetConversationSeq(ctx context.Context, gro
10281038 return g .conversationClient .SetConversationMaxSeq (ctx , conversationID , userIDs , maxSeq )
10291039}
10301040
1041+ func (g * groupServer ) setMemberJoinSeq (ctx context.Context , groupID string , userIDs []string ) error {
1042+ conversationID := msgprocessor .GetConversationIDBySessionType (constant .ReadGroupChatType , groupID )
1043+ return g .conversationClient .SetConversationMaxSeq (ctx , conversationID , userIDs , math .MaxInt64 )
1044+ }
1045+
10311046func (g * groupServer ) SetGroupInfo (ctx context.Context , req * pbgroup.SetGroupInfoReq ) (* pbgroup.SetGroupInfoResp , error ) {
10321047 var opMember * model.GroupMember
10331048 if ! authverify .IsAdmin (ctx ) {
0 commit comments