mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-12 13:05:58 +08:00
Merge remote-tracking branch 'origin/v2.3.0release' into v2.3.0release
This commit is contained in:
@@ -9,5 +9,5 @@ type CallbackBeforeAddFriendReq struct {
|
||||
}
|
||||
|
||||
type CallbackBeforeAddFriendResp struct {
|
||||
*CommonCallbackResp
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
@@ -1,9 +1,27 @@
|
||||
package call_back_struct
|
||||
|
||||
import (
|
||||
commonPb "Open_IM/pkg/proto/sdk_ws"
|
||||
)
|
||||
|
||||
type CallbackBeforeCreateGroupReq struct {
|
||||
CommonCallbackReq
|
||||
CallbackCommand string `json:"callbackCommand"`
|
||||
commonPb.GroupInfo
|
||||
}
|
||||
|
||||
type CallbackAfterCreateGroupResp struct {
|
||||
type CallbackBeforeCreateGroupResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
GroupID *string `json:"groupID"`
|
||||
GroupName *string `json:"groupName"`
|
||||
Notification *string `json:"notification"`
|
||||
Introduction *string `json:"introduction"`
|
||||
FaceURL *string `json:"faceURL"`
|
||||
OwnerUserID *string `json:"ownerUserID"`
|
||||
Ex *string `json:"ex"`
|
||||
Status *int32 `json:"status"`
|
||||
CreatorUserID *string `json:"creatorUserID"`
|
||||
GroupType *int32 `json:"groupType"`
|
||||
NeedVerification *int32 `json:"needVerification"`
|
||||
LookMemberInfo *int32 `json:"lookMemberInfo"`
|
||||
ApplyMemberFriend *int32 `json:"applyMemberFriend"`
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package call_back_struct
|
||||
|
||||
import sdk_ws "Open_IM/pkg/proto/sdk_ws"
|
||||
|
||||
type CallbackBeforeSendSingleMsgReq struct {
|
||||
CommonCallbackReq
|
||||
RecvID string `json:"recvID"`
|
||||
}
|
||||
|
||||
type CallbackBeforeSendSingleMsgResp struct {
|
||||
*CommonCallbackResp
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterSendSingleMsgReq struct {
|
||||
@@ -15,7 +17,7 @@ type CallbackAfterSendSingleMsgReq struct {
|
||||
}
|
||||
|
||||
type CallbackAfterSendSingleMsgResp struct {
|
||||
*CommonCallbackResp
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackBeforeSendGroupMsgReq struct {
|
||||
@@ -24,7 +26,7 @@ type CallbackBeforeSendGroupMsgReq struct {
|
||||
}
|
||||
|
||||
type CallbackBeforeSendGroupMsgResp struct {
|
||||
*CommonCallbackResp
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterSendGroupMsgReq struct {
|
||||
@@ -33,14 +35,31 @@ type CallbackAfterSendGroupMsgReq struct {
|
||||
}
|
||||
|
||||
type CallbackAfterSendGroupMsgResp struct {
|
||||
*CommonCallbackResp
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackWordFilterReq struct {
|
||||
type CallbackMsgModifyCommandReq struct {
|
||||
CommonCallbackReq
|
||||
}
|
||||
|
||||
type CallbackWordFilterResp struct {
|
||||
*CommonCallbackResp
|
||||
Content string `json:"content"`
|
||||
type CallbackMsgModifyCommandResp struct {
|
||||
CommonCallbackResp
|
||||
Content *string `json:"content"`
|
||||
RecvID *string `json:"recvID"`
|
||||
GroupID *string `json:"groupID"`
|
||||
ClientMsgID *string `json:"clientMsgID"`
|
||||
ServerMsgID *string `json:"serverMsgID"`
|
||||
SenderPlatformID *int32 `json:"senderPlatformID"`
|
||||
SenderNickname *string `json:"senderNickname"`
|
||||
SenderFaceURL *string `json:"senderFaceURL"`
|
||||
SessionType *int32 `json:"sessionType"`
|
||||
MsgFrom *int32 `json:"msgFrom"`
|
||||
ContentType *int32 `json:"contentType"`
|
||||
Status *int32 `json:"status"`
|
||||
Options *map[string]bool `json:"options"`
|
||||
OfflinePushInfo *sdk_ws.OfflinePushInfo `json:"offlinePushInfo"`
|
||||
AtUserIDList *[]string `json:"atUserIDList"`
|
||||
MsgDataList *[]byte `json:"msgDataList"`
|
||||
AttachedInfo *string `json:"attachedInfo"`
|
||||
Ex *string `json:"ex"`
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ type CallbackBeforePushReq struct {
|
||||
}
|
||||
|
||||
type CallbackBeforePushResp struct {
|
||||
*CommonCallbackResp
|
||||
CommonCallbackResp
|
||||
UserIDList []string `json:"userIDList"`
|
||||
OfflinePushInfo *commonPb.OfflinePushInfo `json:"offlinePushInfo"`
|
||||
}
|
||||
@@ -33,7 +33,7 @@ type CallbackBeforeSuperGroupOnlinePushReq struct {
|
||||
}
|
||||
|
||||
type CallbackBeforeSuperGroupOnlinePushResp struct {
|
||||
*CommonCallbackResp
|
||||
CommonCallbackResp
|
||||
UserIDList []string `json:"userIDList"`
|
||||
OfflinePushInfo *commonPb.OfflinePushInfo `json:"offlinePushInfo"`
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ type config struct {
|
||||
CallbackAfterSendSingleMsg callBackConfig `yaml:"callbackAfterSendSingleMsg"`
|
||||
CallbackBeforeSendGroupMsg callBackConfig `yaml:"callbackBeforeSendGroupMsg"`
|
||||
CallbackAfterSendGroupMsg callBackConfig `yaml:"callbackAfterSendGroupMsg"`
|
||||
CallbackWordFilter callBackConfig `yaml:"callbackWordFilter"`
|
||||
CallbackMsgModify callBackConfig `yaml:"callbackMsgModify"`
|
||||
CallbackUserOnline callBackConfig `yaml:"callbackUserOnline"`
|
||||
CallbackUserOffline callBackConfig `yaml:"callbackUserOffline"`
|
||||
CallbackUserKickOff callBackConfig `yaml:"callbackUserKickOff"`
|
||||
@@ -290,6 +290,7 @@ type config struct {
|
||||
CallbackOnlinePush callBackConfig `yaml:"callbackOnlinePush"`
|
||||
CallbackBeforeSuperGroupOnlinePush callBackConfig `yaml:"callbackSuperGroupOnlinePush"`
|
||||
CallbackBeforeAddFriend callBackConfig `yaml:"callbackBeforeAddFriend"`
|
||||
CallbackBeforeCreateGroup callBackConfig `yaml:"callbackBeforeCreateGroup"`
|
||||
} `yaml:"callback"`
|
||||
Notification struct {
|
||||
///////////////////////group/////////////////////////////
|
||||
|
||||
@@ -200,7 +200,7 @@ const (
|
||||
CallbackAfterSendSingleMsgCommand = "callbackAfterSendSingleMsgCommand"
|
||||
CallbackBeforeSendGroupMsgCommand = "callbackBeforeSendGroupMsgCommand"
|
||||
CallbackAfterSendGroupMsgCommand = "callbackAfterSendGroupMsgCommand"
|
||||
CallbackWordFilterCommand = "callbackWordFilterCommand"
|
||||
CallbackMsgModifyCommand = "callbackMsgModifyCommand"
|
||||
CallbackUserOnlineCommand = "callbackUserOnlineCommand"
|
||||
CallbackUserOfflineCommand = "callbackUserOfflineCommand"
|
||||
CallbackUserKickOffCommand = "callbackUserKickOffCommand"
|
||||
@@ -208,6 +208,7 @@ const (
|
||||
CallbackOnlinePushCommand = "callbackOnlinePushCommand"
|
||||
CallbackSuperGroupOnlinePushCommand = "callbackSuperGroupOnlinePushCommand"
|
||||
CallbackBeforeAddFriendCommand = "callbackBeforeAddFriendCommand"
|
||||
CallbackBeforeCreateGroupCommand = "callbackBeforeCreateGroup"
|
||||
|
||||
//callback actionCode
|
||||
ActionAllow = 0
|
||||
|
||||
@@ -370,6 +370,9 @@ func (d *DataBases) GetMsgBySeqListMongo2(uid string, seqList []uint32, operatio
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(hasSeqList) == 0 {
|
||||
return nil, errors.New("pull message is null")
|
||||
}
|
||||
if len(hasSeqList) != len(seqList) {
|
||||
var diff []uint32
|
||||
diff = utils.Difference(hasSeqList, seqList)
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
urlLib "net/url"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -34,6 +35,7 @@ func Post(url string, data interface{}, timeOutSecond int) (content []byte, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -54,7 +56,10 @@ func Post(url string, data interface{}, timeOutSecond int) (content []byte, err
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func PostReturn(url string, input, output interface{}, timeOut int) error {
|
||||
func CallBackPostReturn(url, callbackCommand string, input, output interface{}, timeOut int) error {
|
||||
v := urlLib.Values{}
|
||||
v.Set("callbackCommand", callbackCommand)
|
||||
url = url + "?" + v.Encode()
|
||||
b, err := Post(url, input, timeOut)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user