|
|
@ -192,6 +192,7 @@ func (g *GroupNotificationSender) getGroupOwnerAndAdminUserID(ctx context.Contex
|
|
|
|
return utils.Slice(members, fn), nil
|
|
|
|
return utils.Slice(members, fn), nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//nolint:unused
|
|
|
|
func (g *GroupNotificationSender) groupDB2PB(group *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo {
|
|
|
|
func (g *GroupNotificationSender) groupDB2PB(group *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo {
|
|
|
|
return &sdkws.GroupInfo{
|
|
|
|
return &sdkws.GroupInfo{
|
|
|
|
GroupID: group.GroupID,
|
|
|
|
GroupID: group.GroupID,
|
|
|
@ -231,7 +232,7 @@ func (g *GroupNotificationSender) groupMemberDB2PB(member *relation.GroupMemberM
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) getUsersInfoMap(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error) {
|
|
|
|
/* func (g *GroupNotificationSender) getUsersInfoMap(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error) {
|
|
|
|
users, err := g.getUsersInfo(ctx, userIDs)
|
|
|
|
users, err := g.getUsersInfo(ctx, userIDs)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
@ -241,7 +242,7 @@ func (g *GroupNotificationSender) getUsersInfoMap(ctx context.Context, userIDs [
|
|
|
|
result[user.GetUserID()] = user.(*sdkws.UserInfo)
|
|
|
|
result[user.GetUserID()] = user.(*sdkws.UserInfo)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result, nil
|
|
|
|
return result, nil
|
|
|
|
}
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) fillOpUser(ctx context.Context, opUser **sdkws.GroupMemberFullInfo, groupID string) (err error) {
|
|
|
|
func (g *GroupNotificationSender) fillOpUser(ctx context.Context, opUser **sdkws.GroupMemberFullInfo, groupID string) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
@ -266,11 +267,11 @@ func (g *GroupNotificationSender) fillOpUser(ctx context.Context, opUser **sdkws
|
|
|
|
AppMangerLevel: constant.AppAdmin,
|
|
|
|
AppMangerLevel: constant.AppAdmin,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
member, err := g.db.TakeGroupMember(ctx, groupID, userID)
|
|
|
|
member, err2 := g.db.TakeGroupMember(ctx, groupID, userID)
|
|
|
|
if err == nil {
|
|
|
|
if err2 == nil {
|
|
|
|
*opUser = g.groupMemberDB2PB(member, 0)
|
|
|
|
*opUser = g.groupMemberDB2PB(member, 0)
|
|
|
|
} else if !errs.ErrRecordNotFound.Is(err) {
|
|
|
|
} else if !errs.ErrRecordNotFound.Is(err2) {
|
|
|
|
return err
|
|
|
|
return err2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|