mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
Add custom fields to set room and event ID when sending
This commit is contained in:
parent
79a4b6d54d
commit
74a27d5925
2 changed files with 7 additions and 0 deletions
|
|
@ -894,6 +894,8 @@ func (cli *Client) SetRoomAccountData(roomID id.RoomID, name string, data interf
|
|||
type ReqSendEvent struct {
|
||||
Timestamp int64
|
||||
TransactionID string
|
||||
|
||||
MeowEventID id.EventID
|
||||
}
|
||||
|
||||
// SendMessageEvent sends a message event into a room. See https://spec.matrix.org/v1.2/client-server-api/#put_matrixclientv3roomsroomidsendeventtypetxnid
|
||||
|
|
@ -915,6 +917,9 @@ func (cli *Client) SendMessageEvent(roomID id.RoomID, eventType event.Type, cont
|
|||
if req.Timestamp > 0 {
|
||||
queryParams["ts"] = strconv.FormatInt(req.Timestamp, 10)
|
||||
}
|
||||
if req.MeowEventID != "" {
|
||||
queryParams["fi.mau.event_id"] = req.MeowEventID.String()
|
||||
}
|
||||
|
||||
urlData := ClientURLPath{"v3", "rooms", roomID, "send", eventType.String(), txnID}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,8 @@ type ReqCreateRoom struct {
|
|||
RoomVersion string `json:"room_version,omitempty"`
|
||||
|
||||
PowerLevelOverride *event.PowerLevelsEventContent `json:"power_level_content_override,omitempty"`
|
||||
|
||||
MeowRoomID id.RoomID `json:"fi.mau.room_id,omitempty"`
|
||||
}
|
||||
|
||||
// ReqRedact is the JSON request for https://spec.matrix.org/v1.2/client-server-api/#put_matrixclientv3roomsroomidredacteventidtxnid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue