|
|
@ -52,26 +52,23 @@ func (g *GroupNotificationSender) getGroupInfo(ctx context.Context, groupID stri
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
userIDs, err := g.db.FindGroupMemberUserID(ctx, groupID)
|
|
|
|
num, err := g.db.FindGroupMemberNum(ctx, groupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
owner, err := g.db.FindGroupMember(ctx, []string{groupID}, nil, []int32{constant.GroupOwner})
|
|
|
|
owner, err := g.db.TakeGroupOwner(ctx, groupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(owner) == 0 {
|
|
|
|
|
|
|
|
return nil, errs.ErrInternalServer.Wrap(fmt.Sprintf("group %s owner not found", groupID))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return &sdkws.GroupInfo{
|
|
|
|
return &sdkws.GroupInfo{
|
|
|
|
GroupID: gm.GroupID,
|
|
|
|
GroupID: gm.GroupID,
|
|
|
|
GroupName: gm.GroupName,
|
|
|
|
GroupName: gm.GroupName,
|
|
|
|
Notification: gm.Notification,
|
|
|
|
Notification: gm.Notification,
|
|
|
|
Introduction: gm.Introduction,
|
|
|
|
Introduction: gm.Introduction,
|
|
|
|
FaceURL: gm.FaceURL,
|
|
|
|
FaceURL: gm.FaceURL,
|
|
|
|
OwnerUserID: owner[0].UserID,
|
|
|
|
OwnerUserID: owner.UserID,
|
|
|
|
CreateTime: gm.CreateTime.UnixMilli(),
|
|
|
|
CreateTime: gm.CreateTime.UnixMilli(),
|
|
|
|
MemberCount: uint32(len(userIDs)),
|
|
|
|
MemberCount: num,
|
|
|
|
Ex: gm.Ex,
|
|
|
|
Ex: gm.Ex,
|
|
|
|
Status: gm.Status,
|
|
|
|
Status: gm.Status,
|
|
|
|
CreatorUserID: gm.CreatorUserID,
|
|
|
|
CreatorUserID: gm.CreatorUserID,
|
|
|
@ -85,7 +82,6 @@ func (g *GroupNotificationSender) getGroupInfo(ctx context.Context, groupID stri
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) getGroupMembers(ctx context.Context, groupID string, userIDs []string) ([]*sdkws.GroupMemberFullInfo, error) {
|
|
|
|
func (g *GroupNotificationSender) getGroupMembers(ctx context.Context, groupID string, userIDs []string) ([]*sdkws.GroupMemberFullInfo, error) {
|
|
|
|
//members, err := g.db.FindGroupMember(ctx, []string{groupID}, userIDs, []int32{constant.GroupOwner})
|
|
|
|
|
|
|
|
members, err := g.db.FindGroupMember(ctx, []string{groupID}, userIDs, nil)
|
|
|
|
members, err := g.db.FindGroupMember(ctx, []string{groupID}, userIDs, nil)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
@ -96,30 +92,27 @@ func (g *GroupNotificationSender) getGroupMembers(ctx context.Context, groupID s
|
|
|
|
}
|
|
|
|
}
|
|
|
|
res := make([]*sdkws.GroupMemberFullInfo, 0, len(members))
|
|
|
|
res := make([]*sdkws.GroupMemberFullInfo, 0, len(members))
|
|
|
|
for _, member := range members {
|
|
|
|
for _, member := range members {
|
|
|
|
var appMangerLevel int32
|
|
|
|
user, ok := users[member.UserID]
|
|
|
|
if user := users[member.UserID]; user != nil {
|
|
|
|
if !ok {
|
|
|
|
appMangerLevel = user.AppMangerLevel
|
|
|
|
return nil, errs.ErrUserIDNotFound.Wrap(fmt.Sprintf("group %s member %s not in user", member.GroupID, member.UserID))
|
|
|
|
|
|
|
|
}
|
|
|
|
if member.Nickname == "" {
|
|
|
|
if member.Nickname == "" {
|
|
|
|
member.Nickname = user.Nickname
|
|
|
|
member.Nickname = user.Nickname
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if member.FaceURL == "" {
|
|
|
|
res = append(res, g.groupMemberDB2PB(member, user.AppMangerLevel))
|
|
|
|
member.FaceURL = user.FaceURL
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
res = append(res, g.groupMemberDB2PB(member, appMangerLevel))
|
|
|
|
|
|
|
|
delete(users, member.UserID)
|
|
|
|
delete(users, member.UserID)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for userID, info := range users {
|
|
|
|
//for userID, info := range users {
|
|
|
|
if info.AppMangerLevel == constant.AppAdmin {
|
|
|
|
// if info.AppMangerLevel == constant.AppAdmin {
|
|
|
|
res = append(res, &sdkws.GroupMemberFullInfo{
|
|
|
|
// res = append(res, &sdkws.GroupMemberFullInfo{
|
|
|
|
GroupID: groupID,
|
|
|
|
// GroupID: groupID,
|
|
|
|
UserID: userID,
|
|
|
|
// UserID: userID,
|
|
|
|
Nickname: info.Nickname,
|
|
|
|
// Nickname: info.Nickname,
|
|
|
|
FaceURL: info.FaceURL,
|
|
|
|
// FaceURL: info.FaceURL,
|
|
|
|
AppMangerLevel: info.AppMangerLevel,
|
|
|
|
// AppMangerLevel: info.AppMangerLevel,
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
return res, nil
|
|
|
|
return res, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -206,102 +199,70 @@ func (g *GroupNotificationSender) getUsersInfoMap(ctx context.Context, userIDs [
|
|
|
|
return result, nil
|
|
|
|
return result, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) getFromToUserNickname(ctx context.Context, fromUserID, toUserID string) (string, string, error) {
|
|
|
|
func (g *GroupNotificationSender) fillOpUser(ctx context.Context, opUser **sdkws.GroupMemberFullInfo, groupID string) error {
|
|
|
|
users, err := g.getUsersInfoMap(ctx, []string{fromUserID, toUserID})
|
|
|
|
if opUser == nil {
|
|
|
|
if err != nil {
|
|
|
|
return errs.ErrInternalServer.Wrap("**sdkws.GroupMemberFullInfo is nil")
|
|
|
|
return "", "", nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return users[fromUserID].Nickname, users[toUserID].Nickname, nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) mergeGroupFull(ctx context.Context, groupID string, group *relation.GroupModel, ms *[]*relation.GroupMemberModel, users *map[string]*sdkws.UserInfo) (groupInfo *sdkws.GroupCreatedTips, err error) {
|
|
|
|
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
if group == nil {
|
|
|
|
|
|
|
|
group, err = g.db.TakeGroup(ctx, groupID)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ms == nil {
|
|
|
|
if *opUser != nil {
|
|
|
|
var temp []*relation.GroupMemberModel
|
|
|
|
return nil
|
|
|
|
ms = &temp
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if users == nil {
|
|
|
|
|
|
|
|
temp := make(map[string]*sdkws.UserInfo)
|
|
|
|
|
|
|
|
users = &temp
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var members []*relation.GroupMemberModel
|
|
|
|
userID := mcontext.GetOpUserID(ctx)
|
|
|
|
if len(*ms) == 0 {
|
|
|
|
if groupID != "" {
|
|
|
|
members, err = g.db.FindGroupMember(ctx, []string{groupID}, nil, nil)
|
|
|
|
member, err := g.db.TakeGroupMember(ctx, groupID, userID)
|
|
|
|
if err != nil {
|
|
|
|
if err == nil {
|
|
|
|
return nil, err
|
|
|
|
*opUser = g.groupMemberDB2PB(member, 0)
|
|
|
|
|
|
|
|
} else if !errs.ErrRecordNotFound.Is(err) {
|
|
|
|
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*ms = members
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
members = *ms
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
opUserID := mcontext.GetOpUserID(ctx)
|
|
|
|
user, err := g.getUser(ctx, userID)
|
|
|
|
var userMap map[string]*sdkws.UserInfo
|
|
|
|
|
|
|
|
if users == nil || len(*users) == 0 {
|
|
|
|
|
|
|
|
userIDs := utils.Slice(members, func(e *relation.GroupMemberModel) string { return e.UserID })
|
|
|
|
|
|
|
|
userIDs = append(userIDs, opUserID)
|
|
|
|
|
|
|
|
userMap, err = g.getUsersInfoMap(ctx, userIDs)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if users != nil {
|
|
|
|
if *opUser == nil {
|
|
|
|
*users = userMap
|
|
|
|
*opUser = &sdkws.GroupMemberFullInfo{
|
|
|
|
|
|
|
|
GroupID: groupID,
|
|
|
|
|
|
|
|
UserID: userID,
|
|
|
|
|
|
|
|
Nickname: user.Nickname,
|
|
|
|
|
|
|
|
FaceURL: user.FaceURL,
|
|
|
|
|
|
|
|
OperatorUserID: userID,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
userMap = *users
|
|
|
|
if (*opUser).Nickname == "" {
|
|
|
|
}
|
|
|
|
(*opUser).Nickname = user.Nickname
|
|
|
|
var (
|
|
|
|
|
|
|
|
opUserMember *sdkws.GroupMemberFullInfo
|
|
|
|
|
|
|
|
groupOwnerMember *sdkws.GroupMemberFullInfo
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
for _, member := range members {
|
|
|
|
|
|
|
|
if member.UserID == opUserID {
|
|
|
|
|
|
|
|
opUserMember = g.groupMemberDB2PB(member, userMap[member.UserID].AppMangerLevel)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if member.RoleLevel == constant.GroupOwner {
|
|
|
|
if (*opUser).FaceURL == "" {
|
|
|
|
groupOwnerMember = g.groupMemberDB2PB(member, userMap[member.UserID].AppMangerLevel)
|
|
|
|
(*opUser).FaceURL = user.FaceURL
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if opUserMember != nil && groupOwnerMember != nil {
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
if opUser := userMap[opUserID]; opUser != nil && opUserMember == nil {
|
|
|
|
|
|
|
|
opUserMember = &sdkws.GroupMemberFullInfo{
|
|
|
|
|
|
|
|
GroupID: group.GroupID,
|
|
|
|
|
|
|
|
UserID: opUser.UserID,
|
|
|
|
|
|
|
|
Nickname: opUser.Nickname,
|
|
|
|
|
|
|
|
FaceURL: opUser.FaceURL,
|
|
|
|
|
|
|
|
AppMangerLevel: opUser.AppMangerLevel,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
groupInfo = &sdkws.GroupCreatedTips{Group: g.groupDB2PB(group, groupOwnerMember.UserID, uint32(len(members))),
|
|
|
|
|
|
|
|
OpUser: opUserMember, GroupOwnerUser: groupOwnerMember}
|
|
|
|
|
|
|
|
return groupInfo, nil
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupCreatedNotification(ctx context.Context, tips *sdkws.GroupCreatedTips) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupCreatedNotification(ctx context.Context, tips *sdkws.GroupCreatedTips) (err error) {
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupCreatedNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupCreatedNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupInfoSetNotification(ctx context.Context, tips *sdkws.GroupInfoSetTips) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupInfoSetNotification(ctx context.Context, tips *sdkws.GroupInfoSetTips) (err error) {
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupInfoSetNameNotification(ctx context.Context, tips *sdkws.GroupInfoSetNameTips) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupInfoSetNameNotification(ctx context.Context, tips *sdkws.GroupInfoSetNameTips) (err error) {
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNameNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNameNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupInfoSetAnnouncementNotification(ctx context.Context, tips *sdkws.GroupInfoSetAnnouncementTips) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupInfoSetAnnouncementNotification(ctx context.Context, tips *sdkws.GroupInfoSetAnnouncementTips) (err error) {
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetAnnouncementNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetAnnouncementNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -365,15 +326,14 @@ func (g *GroupNotificationSender) GroupApplicationAcceptedNotification(ctx conte
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
user, err := g.getGroupMember(ctx, req.GroupID, mcontext.GetOpUserID(ctx))
|
|
|
|
userIDs, err := g.getGroupOwnerAndAdminUserID(ctx, req.GroupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
userIDs, err := g.getGroupOwnerAndAdminUserID(ctx, req.GroupID)
|
|
|
|
tips := &sdkws.GroupApplicationAcceptedTips{Group: group, HandleMsg: req.HandledMsg, ReceiverAs: 1}
|
|
|
|
if err != nil {
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tips := &sdkws.GroupApplicationAcceptedTips{Group: group, OpUser: user, HandleMsg: req.HandledMsg, ReceiverAs: 1}
|
|
|
|
|
|
|
|
for _, userID := range append(userIDs, mcontext.GetOpUserID(ctx)) {
|
|
|
|
for _, userID := range append(userIDs, mcontext.GetOpUserID(ctx)) {
|
|
|
|
err = g.Notification(ctx, mcontext.GetOpUserID(ctx), userID, constant.GroupApplicationAcceptedNotification, tips)
|
|
|
|
err = g.Notification(ctx, mcontext.GetOpUserID(ctx), userID, constant.GroupApplicationAcceptedNotification, tips)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -384,25 +344,18 @@ func (g *GroupNotificationSender) GroupApplicationAcceptedNotification(ctx conte
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupApplicationRejectedNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupApplicationRejectedNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, req.GroupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, req.GroupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
user, err := g.getGroupMember(ctx, req.GroupID, mcontext.GetOpUserID(ctx))
|
|
|
|
userIDs, err := g.getGroupOwnerAndAdminUserID(ctx, req.GroupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
userIDs, err := g.getGroupOwnerAndAdminUserID(ctx, req.GroupID)
|
|
|
|
tips := &sdkws.GroupApplicationRejectedTips{Group: group, HandleMsg: req.HandledMsg}
|
|
|
|
if err != nil {
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tips := &sdkws.GroupApplicationRejectedTips{Group: group, OpUser: user, HandleMsg: req.HandledMsg}
|
|
|
|
|
|
|
|
for _, userID := range append(userIDs, mcontext.GetOpUserID(ctx)) {
|
|
|
|
for _, userID := range append(userIDs, mcontext.GetOpUserID(ctx)) {
|
|
|
|
err = g.Notification(ctx, mcontext.GetOpUserID(ctx), userID, constant.GroupApplicationRejectedNotification, tips)
|
|
|
|
err = g.Notification(ctx, mcontext.GetOpUserID(ctx), userID, constant.GroupApplicationRejectedNotification, tips)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -413,12 +366,6 @@ func (g *GroupNotificationSender) GroupApplicationRejectedNotification(ctx conte
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupOwnerTransferredNotification(ctx context.Context, req *pbGroup.TransferGroupOwnerReq) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupOwnerTransferredNotification(ctx context.Context, req *pbGroup.TransferGroupOwnerReq) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, req.GroupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, req.GroupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -429,47 +376,24 @@ func (g *GroupNotificationSender) GroupOwnerTransferredNotification(ctx context.
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tips := &sdkws.GroupOwnerTransferredTips{Group: group, OpUser: member[opUserID], NewGroupOwner: member[req.NewOwnerUserID]}
|
|
|
|
tips := &sdkws.GroupOwnerTransferredTips{Group: group, OpUser: member[opUserID], NewGroupOwner: member[req.NewOwnerUserID]}
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupOwnerTransferredNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupOwnerTransferredNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) MemberKickedNotification(ctx context.Context, tips *sdkws.MemberKickedTips) (err error) {
|
|
|
|
func (g *GroupNotificationSender) MemberKickedNotification(ctx context.Context, tips *sdkws.MemberKickedTips) (err error) {
|
|
|
|
//defer log.ZDebug(ctx, "return")
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
//defer func() {
|
|
|
|
return err
|
|
|
|
// if err != nil {
|
|
|
|
}
|
|
|
|
// log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}()
|
|
|
|
|
|
|
|
//group, err := g.getGroupInfo(ctx, tips.GroupID)
|
|
|
|
|
|
|
|
//if err != nil {
|
|
|
|
|
|
|
|
// return err
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//user, err := g.getGroupMember(ctx, tips.GroupID, mcontext.GetOpUserID(ctx))
|
|
|
|
|
|
|
|
//if err != nil {
|
|
|
|
|
|
|
|
// return err
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//tips := &sdkws.MemberKickedTips{Group: group, OpUser: user}
|
|
|
|
|
|
|
|
//for _, v := range kickedUserIDList {
|
|
|
|
|
|
|
|
// var groupMemberInfo sdkws.GroupMemberFullInfo
|
|
|
|
|
|
|
|
// if err := c.setGroupMemberInfo(ctx, tips.GroupID, v, &groupMemberInfo); err != nil {
|
|
|
|
|
|
|
|
// continue
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// MemberKickedTips.KickedUserList = append(MemberKickedTips.KickedUserList, &groupMemberInfo)
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.MemberKickedNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.MemberKickedNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) MemberInvitedNotification(ctx context.Context, groupID, reason string, invitedUserIDList []string) (err error) {
|
|
|
|
func (g *GroupNotificationSender) MemberInvitedNotification(ctx context.Context, groupID, reason string, invitedUserIDList []string) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
opUser, err := g.getGroupMember(ctx, groupID, mcontext.GetOpUserID(ctx))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -477,17 +401,14 @@ func (g *GroupNotificationSender) MemberInvitedNotification(ctx context.Context,
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tips := &sdkws.MemberInvitedTips{Group: group, OpUser: opUser, InvitedUserList: users}
|
|
|
|
tips := &sdkws.MemberInvitedTips{Group: group, InvitedUserList: users}
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.MemberInvitedNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.MemberInvitedNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) MemberEnterNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (err error) {
|
|
|
|
func (g *GroupNotificationSender) MemberEnterNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, req.GroupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, req.GroupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -501,40 +422,13 @@ func (g *GroupNotificationSender) MemberEnterNotification(ctx context.Context, r
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupDismissedNotification(ctx context.Context, tips *sdkws.GroupDismissedTips) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupDismissedNotification(ctx context.Context, tips *sdkws.GroupDismissedTips) (err error) {
|
|
|
|
//defer log.ZDebug(ctx, "return")
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
//defer func() {
|
|
|
|
return err
|
|
|
|
// if err != nil {
|
|
|
|
}
|
|
|
|
// log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}()
|
|
|
|
|
|
|
|
//group, err := g.getGroupInfo(ctx, req.GroupID)
|
|
|
|
|
|
|
|
//if err != nil {
|
|
|
|
|
|
|
|
// return err
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//users, err := g.getGroupMembers(ctx, req.GroupID, []string{mcontext.GetOpUserID(ctx)})
|
|
|
|
|
|
|
|
//if err != nil {
|
|
|
|
|
|
|
|
// return err
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//tips := &sdkws.GroupDismissedTips{Group: group}
|
|
|
|
|
|
|
|
//if len(users) > 0 {
|
|
|
|
|
|
|
|
// tips.OpUser = users[0]
|
|
|
|
|
|
|
|
//} else {
|
|
|
|
|
|
|
|
// tips.OpUser = &sdkws.GroupMemberFullInfo{
|
|
|
|
|
|
|
|
// GroupID: group.GroupID,
|
|
|
|
|
|
|
|
// UserID: mcontext.GetOpUserID(ctx),
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupDismissedNotification, tips)
|
|
|
|
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupDismissedNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupDismissedNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupMemberMutedNotification(ctx context.Context, groupID, groupMemberUserID string, mutedSeconds uint32) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupMemberMutedNotification(ctx context.Context, groupID, groupMemberUserID string, mutedSeconds uint32) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -545,16 +439,13 @@ func (g *GroupNotificationSender) GroupMemberMutedNotification(ctx context.Conte
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tips := &sdkws.GroupMemberMutedTips{Group: group, MutedSeconds: mutedSeconds,
|
|
|
|
tips := &sdkws.GroupMemberMutedTips{Group: group, MutedSeconds: mutedSeconds,
|
|
|
|
OpUser: user[mcontext.GetOpUserID(ctx)], MutedUser: user[groupMemberUserID]}
|
|
|
|
OpUser: user[mcontext.GetOpUserID(ctx)], MutedUser: user[groupMemberUserID]}
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberMutedNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberMutedNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupMemberCancelMutedNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupMemberCancelMutedNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -564,16 +455,13 @@ func (g *GroupNotificationSender) GroupMemberCancelMutedNotification(ctx context
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tips := &sdkws.GroupMemberCancelMutedTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], MutedUser: user[groupMemberUserID]}
|
|
|
|
tips := &sdkws.GroupMemberCancelMutedTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], MutedUser: user[groupMemberUserID]}
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberCancelMutedNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberCancelMutedNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupMutedNotification(ctx context.Context, groupID string) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupMutedNotification(ctx context.Context, groupID string) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -585,19 +473,14 @@ func (g *GroupNotificationSender) GroupMutedNotification(ctx context.Context, gr
|
|
|
|
tips := &sdkws.GroupMutedTips{Group: group}
|
|
|
|
tips := &sdkws.GroupMutedTips{Group: group}
|
|
|
|
if len(users) > 0 {
|
|
|
|
if len(users) > 0 {
|
|
|
|
tips.OpUser = users[0]
|
|
|
|
tips.OpUser = users[0]
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
tips.OpUser = &sdkws.GroupMemberFullInfo{UserID: mcontext.GetOpUserID(ctx), GroupID: groupID}
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMutedNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMutedNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupCancelMutedNotification(ctx context.Context, groupID string) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupCancelMutedNotification(ctx context.Context, groupID string) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -609,19 +492,14 @@ func (g *GroupNotificationSender) GroupCancelMutedNotification(ctx context.Conte
|
|
|
|
tips := &sdkws.GroupCancelMutedTips{Group: group}
|
|
|
|
tips := &sdkws.GroupCancelMutedTips{Group: group}
|
|
|
|
if len(users) > 0 {
|
|
|
|
if len(users) > 0 {
|
|
|
|
tips.OpUser = users[0]
|
|
|
|
tips.OpUser = users[0]
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
tips.OpUser = &sdkws.GroupMemberFullInfo{UserID: mcontext.GetOpUserID(ctx), GroupID: groupID}
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupCancelMutedNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupCancelMutedNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupMemberInfoSetNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupMemberInfoSetNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -631,16 +509,13 @@ func (g *GroupNotificationSender) GroupMemberInfoSetNotification(ctx context.Con
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tips := &sdkws.GroupMemberInfoSetTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], ChangedUser: user[groupMemberUserID]}
|
|
|
|
tips := &sdkws.GroupMemberInfoSetTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], ChangedUser: user[groupMemberUserID]}
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberInfoSetNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberInfoSetNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupMemberSetToAdminNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupMemberSetToAdminNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -650,16 +525,13 @@ func (g *GroupNotificationSender) GroupMemberSetToAdminNotification(ctx context.
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tips := &sdkws.GroupMemberInfoSetTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], ChangedUser: user[groupMemberUserID]}
|
|
|
|
tips := &sdkws.GroupMemberInfoSetTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], ChangedUser: user[groupMemberUserID]}
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToAdminNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToAdminNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (g *GroupNotificationSender) GroupMemberSetToOrdinaryUserNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) {
|
|
|
|
func (g *GroupNotificationSender) GroupMemberSetToOrdinaryUserNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) {
|
|
|
|
defer log.ZDebug(ctx, "return")
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
log.ZError(ctx, utils.GetFuncName(1)+" failed", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
group, err := g.getGroupInfo(ctx, groupID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -669,6 +541,9 @@ func (g *GroupNotificationSender) GroupMemberSetToOrdinaryUserNotification(ctx c
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tips := &sdkws.GroupMemberInfoSetTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], ChangedUser: user[groupMemberUserID]}
|
|
|
|
tips := &sdkws.GroupMemberInfoSetTips{Group: group, OpUser: user[mcontext.GetOpUserID(ctx)], ChangedUser: user[groupMemberUserID]}
|
|
|
|
|
|
|
|
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToOrdinaryUserNotification, tips)
|
|
|
|
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToOrdinaryUserNotification, tips)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|