mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 11:06:43 +08:00
Merge branch 'v2.3.0release' into superGroup
This commit is contained in:
commit
9e885c2379
@ -65,7 +65,7 @@ func SetPassword(c *gin.Context) {
|
|||||||
//userID := utils.Base64Encode(account)
|
//userID := utils.Base64Encode(account)
|
||||||
var userID string
|
var userID string
|
||||||
if params.UserID == "" {
|
if params.UserID == "" {
|
||||||
userID := utils.Md5(params.OperationID + strconv.FormatInt(time.Now().UnixNano(), 10))
|
userID = utils.Md5(params.OperationID + strconv.FormatInt(time.Now().UnixNano(), 10))
|
||||||
bi := big.NewInt(0)
|
bi := big.NewInt(0)
|
||||||
bi.SetString(userID[0:8], 16)
|
bi.SetString(userID[0:8], 16)
|
||||||
userID = bi.String()
|
userID = bi.String()
|
||||||
@ -82,6 +82,7 @@ func SetPassword(c *gin.Context) {
|
|||||||
openIMRegisterReq.Secret = config.Config.Secret
|
openIMRegisterReq.Secret = config.Config.Secret
|
||||||
openIMRegisterReq.FaceURL = params.FaceURL
|
openIMRegisterReq.FaceURL = params.FaceURL
|
||||||
openIMRegisterResp := api.UserRegisterResp{}
|
openIMRegisterResp := api.UserRegisterResp{}
|
||||||
|
log.NewDebug(params.OperationID, utils.GetSelfFuncName(), "register req:", openIMRegisterReq)
|
||||||
bMsg, err := http2.Post(url, openIMRegisterReq, 2)
|
bMsg, err := http2.Post(url, openIMRegisterReq, 2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(params.OperationID, "request openIM register error", account, "err", err.Error())
|
log.NewError(params.OperationID, "request openIM register error", account, "err", err.Error())
|
||||||
|
@ -233,7 +233,7 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(onlineFailedUserIDList) > 0 {
|
||||||
callbackResp := callbackOfflinePush(pushMsg.OperationID, onlineFailedUserIDList[0], pushMsg.MsgData)
|
callbackResp := callbackOfflinePush(pushMsg.OperationID, onlineFailedUserIDList[0], pushMsg.MsgData)
|
||||||
log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp")
|
log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp")
|
||||||
if callbackResp.ErrCode != 0 {
|
if callbackResp.ErrCode != 0 {
|
||||||
@ -258,6 +258,8 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
|
|||||||
log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData)
|
log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetOfflinePushOpts(pushMsg *pbPush.PushMsgReq) (opts push.PushOpts, err error) {
|
func GetOfflinePushOpts(pushMsg *pbPush.PushMsgReq) (opts push.PushOpts, err error) {
|
||||||
|
@ -183,7 +183,16 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv
|
|||||||
n.SendID = sendID
|
n.SendID = sendID
|
||||||
if groupID != "" {
|
if groupID != "" {
|
||||||
n.RecvID = groupID
|
n.RecvID = groupID
|
||||||
|
group, err := imdb.GetGroupInfoByGroupID(groupID)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(operationID, "GetGroupInfoByGroupID failed ", err.Error(), groupID)
|
||||||
|
}
|
||||||
|
switch group.GroupType {
|
||||||
|
case constant.NormalGroup:
|
||||||
n.SessionType = constant.GroupChatType
|
n.SessionType = constant.GroupChatType
|
||||||
|
default:
|
||||||
|
n.SessionType = constant.SuperGroupChatType
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
n.RecvID = recvUserID
|
n.RecvID = recvUserID
|
||||||
n.SessionType = constant.SingleChatType
|
n.SessionType = constant.SingleChatType
|
||||||
|
@ -163,7 +163,7 @@ const (
|
|||||||
//GroupType
|
//GroupType
|
||||||
NormalGroup = 0
|
NormalGroup = 0
|
||||||
SuperGroup = 1
|
SuperGroup = 1
|
||||||
DepartmentGroup = 2
|
WorkingGroup = 2
|
||||||
|
|
||||||
GroupBaned = 3
|
GroupBaned = 3
|
||||||
GroupBanPrivateChat = 4
|
GroupBanPrivateChat = 4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user