Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun

pull/232/head
wangchuxiao 2 years ago
commit ad497b7386

@ -17,6 +17,7 @@ import (
pbUser "Open_IM/pkg/proto/user"
"Open_IM/pkg/utils"
"context"
"math/big"
"net"
"strconv"
"strings"
@ -101,9 +102,13 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
groupId := req.GroupInfo.GroupID
if groupId == "" {
groupId = utils.Md5(strconv.FormatInt(time.Now().UnixNano(), 10))
groupId = utils.Md5(req.OperationID + strconv.FormatInt(time.Now().UnixNano(), 10))
bi := big.NewInt(0)
bi.SetString(groupId[0:8], 16)
groupId = bi.String()
}
//to group
groupInfo := db.Group{}
utils.CopyStructFields(&groupInfo, req.GroupInfo)
groupInfo.CreatorUserID = req.OpUserID

Loading…
Cancel
Save