|
|
@@ -10,6 +10,7 @@ import ( |
|
|
|
"gim/pkg/db" |
|
|
|
"gim/pkg/grpclib" |
|
|
|
"gim/pkg/pb" |
|
|
|
"strings" |
|
|
|
) |
|
|
|
|
|
|
|
type groupApp struct{} |
|
|
@@ -38,13 +39,19 @@ func (*groupApp) GetGroup(ctx context.Context, groupId int64) (*pb.Group, error) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
masterId, err := grpclib.GetCtxMasterId(ctx) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
userId, _, err := grpclib.GetCtxData(ctx) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
for _, member := range group.Members { |
|
|
|
if member.UserId == userId && member.MemberType != int(pb.MemberType_GMT_ADMIN) { |
|
|
|
group.Name = "我的推荐人群" |
|
|
|
if !strings.Contains(group.Name, "官方") && masterId == "68823769" { |
|
|
|
for _, member := range group.Members { |
|
|
|
if member.UserId == userId && member.MemberType != int(pb.MemberType_GMT_ADMIN) { |
|
|
|
group.Name = "我的推荐人群" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return group.ToProto(), nil |
|
|
|