mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
This commit is contained in:
commit
e91f2b89df
@ -479,7 +479,7 @@ func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.G
|
|||||||
member.UserID = req.FromUserID
|
member.UserID = req.FromUserID
|
||||||
member.RoleLevel = constant.GroupOrdinaryUsers
|
member.RoleLevel = constant.GroupOrdinaryUsers
|
||||||
member.OperatorUserID = req.OpUserID
|
member.OperatorUserID = req.OpUserID
|
||||||
member.FaceUrl = user.FaceURL
|
member.FaceURL = user.FaceURL
|
||||||
member.Nickname = user.Nickname
|
member.Nickname = user.Nickname
|
||||||
|
|
||||||
err = imdb.InsertIntoGroupMember(member)
|
err = imdb.InsertIntoGroupMember(member)
|
||||||
@ -596,7 +596,7 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf
|
|||||||
if group.Introduction != req.GroupInfo.Introduction && req.GroupInfo.Introduction != "" {
|
if group.Introduction != req.GroupInfo.Introduction && req.GroupInfo.Introduction != "" {
|
||||||
changedType = changedType | (1 << 2)
|
changedType = changedType | (1 << 2)
|
||||||
}
|
}
|
||||||
if group.FaceUrl != req.GroupInfo.FaceURL && req.GroupInfo.FaceURL != "" {
|
if group.FaceURL != req.GroupInfo.FaceURL && req.GroupInfo.FaceURL != "" {
|
||||||
changedType = changedType | (1 << 3)
|
changedType = changedType | (1 << 3)
|
||||||
}
|
}
|
||||||
//only administrators can set group information
|
//only administrators can set group information
|
||||||
|
@ -54,12 +54,19 @@ func setGroupInfo(groupID string, groupInfo *open_im_sdk.GroupInfo) error {
|
|||||||
|
|
||||||
func setGroupMemberInfo(groupID, userID string, groupMemberInfo *open_im_sdk.GroupMemberFullInfo) error {
|
func setGroupMemberInfo(groupID, userID string, groupMemberInfo *open_im_sdk.GroupMemberFullInfo) error {
|
||||||
groupMember, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, userID)
|
groupMember, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, userID)
|
||||||
|
if err == nil {
|
||||||
|
return utils.Wrap(utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, groupMember), "")
|
||||||
|
}
|
||||||
|
|
||||||
|
user, err := imdb.GetUserByUserID(userID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return utils.Wrap(err, "")
|
return utils.Wrap(err, "")
|
||||||
}
|
}
|
||||||
if err = utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, groupMember); err != nil {
|
groupMemberInfo.GroupID = groupID
|
||||||
return utils.Wrap(err, "")
|
groupMemberInfo.UserID = user.UserID
|
||||||
}
|
groupMemberInfo.Nickname = user.Nickname
|
||||||
|
groupMemberInfo.AppMangerLevel = user.AppMangerLevel
|
||||||
|
groupMemberInfo.FaceURL = user.FaceURL
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +302,7 @@ func GroupOwnerTransferredNotification(req *pbGroup.TransferGroupOwnerReq) {
|
|||||||
log.Error(req.OperationID, "setGroupMemberInfo failed", req.GroupID, req.NewOwnerUserID)
|
log.Error(req.OperationID, "setGroupMemberInfo failed", req.GroupID, req.NewOwnerUserID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
groupNotification(constant.GroupOwnerTransferredNotification, &GroupOwnerTransferredTips, req.OpUserID, "", req.NewOwnerUserID, req.OperationID)
|
groupNotification(constant.GroupOwnerTransferredNotification, &GroupOwnerTransferredTips, req.OpUserID, req.GroupID, "", req.OperationID)
|
||||||
}
|
}
|
||||||
|
|
||||||
//message MemberKickedTips{
|
//message MemberKickedTips{
|
||||||
|
@ -73,7 +73,7 @@ type Group struct {
|
|||||||
GroupName string `gorm:"column:name;size:255" json:"groupName"`
|
GroupName string `gorm:"column:name;size:255" json:"groupName"`
|
||||||
Notification string `gorm:"column:notification;size:255" json:"notification"`
|
Notification string `gorm:"column:notification;size:255" json:"notification"`
|
||||||
Introduction string `gorm:"column:introduction;size:255" json:"introduction"`
|
Introduction string `gorm:"column:introduction;size:255" json:"introduction"`
|
||||||
FaceUrl string `gorm:"column:face_url;size:255" json:"faceUrl"`
|
FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"`
|
||||||
CreateTime time.Time `gorm:"column:create_time"`
|
CreateTime time.Time `gorm:"column:create_time"`
|
||||||
Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"`
|
Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"`
|
||||||
Status int32 `gorm:"column:status"`
|
Status int32 `gorm:"column:status"`
|
||||||
@ -97,7 +97,7 @@ type GroupMember struct {
|
|||||||
GroupID string `gorm:"column:group_id;primary_key;size:64"`
|
GroupID string `gorm:"column:group_id;primary_key;size:64"`
|
||||||
UserID string `gorm:"column:user_id;primary_key;size:64"`
|
UserID string `gorm:"column:user_id;primary_key;size:64"`
|
||||||
Nickname string `gorm:"column:nickname;size:255"`
|
Nickname string `gorm:"column:nickname;size:255"`
|
||||||
FaceUrl string `gorm:"column:user_group_face_url;size:255"`
|
FaceURL string `gorm:"column:user_group_face_url;size:255"`
|
||||||
RoleLevel int32 `gorm:"column:role_level"`
|
RoleLevel int32 `gorm:"column:role_level"`
|
||||||
JoinTime time.Time `gorm:"column:join_time"`
|
JoinTime time.Time `gorm:"column:join_time"`
|
||||||
JoinSource int32 `gorm:"column:join_source"`
|
JoinSource int32 `gorm:"column:join_source"`
|
||||||
|
@ -64,9 +64,9 @@ func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName strin
|
|||||||
//keepalive
|
//keepalive
|
||||||
kresp, err := cli.KeepAlive(ctx, resp.ID)
|
kresp, err := cli.KeepAlive(ctx, resp.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("keepalive faild, errmsg:%v, lease id:%d", err, resp.ID)
|
return fmt.Errorf("keepalive failed, errmsg:%v, lease id:%d", err, resp.ID)
|
||||||
}
|
}
|
||||||
|
fmt.Println("RegisterEtcd ok")
|
||||||
go func() {
|
go func() {
|
||||||
FLOOP:
|
FLOOP:
|
||||||
for {
|
for {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user