mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-28 04:48:44 +08:00
notification
This commit is contained in:
parent
1dad0b06d1
commit
833c052cea
@ -134,8 +134,13 @@ func (m *MsgClient) PullMessageBySeqList(ctx context.Context, req *sdkws.PullMes
|
|||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type NotificationElem struct {
|
||||||
|
Detail interface{} `json:"detail,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
func (c *MsgClient) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, opts ...utils.OptionsOpt) error {
|
func (c *MsgClient) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, opts ...utils.OptionsOpt) error {
|
||||||
content, err := json.Marshal(m)
|
n := NotificationElem{Detail: m}
|
||||||
|
content, err := json.Marshal(n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ZError(ctx, "MsgClient Notification json.Marshal failed", err, "sendID", sendID, "recvID", recvID, "contentType", contentType, "msg", m)
|
log.ZError(ctx, "MsgClient Notification json.Marshal failed", err, "sendID", sendID, "recvID", recvID, "contentType", contentType, "msg", m)
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user