mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
client: add wrapper method for MSC2815
This commit is contained in:
parent
e879ad19cc
commit
1cc073cde6
3 changed files with 17 additions and 5 deletions
|
|
@ -2013,6 +2013,14 @@ func (cli *Client) GetEvent(ctx context.Context, roomID id.RoomID, eventID id.Ev
|
|||
return
|
||||
}
|
||||
|
||||
func (cli *Client) GetUnredactedEventContent(ctx context.Context, roomID id.RoomID, eventID id.EventID) (resp *event.Event, err error) {
|
||||
urlPath := cli.BuildURLWithQuery(ClientURLPath{"v3", "rooms", roomID, "event", eventID}, map[string]string{
|
||||
"fi.mau.msc2815.include_unredacted_content": "true",
|
||||
})
|
||||
_, err = cli.MakeRequest(ctx, http.MethodGet, urlPath, nil, &resp)
|
||||
return
|
||||
}
|
||||
|
||||
func (cli *Client) MarkRead(ctx context.Context, roomID id.RoomID, eventID id.EventID) (err error) {
|
||||
return cli.SendReceipt(ctx, roomID, eventID, event.ReceiptTypeRead, nil)
|
||||
}
|
||||
|
|
|
|||
3
error.go
3
error.go
|
|
@ -71,6 +71,9 @@ var (
|
|||
MBadStatus = RespError{ErrCode: "M_BAD_STATUS"}
|
||||
MConnectionTimeout = RespError{ErrCode: "M_CONNECTION_TIMEOUT"}
|
||||
MConnectionFailed = RespError{ErrCode: "M_CONNECTION_FAILED"}
|
||||
|
||||
MUnredactedContentDeleted = RespError{ErrCode: "FI.MAU.MSC2815_UNREDACTED_CONTENT_DELETED"}
|
||||
MUnredactedContentNotReceived = RespError{ErrCode: "FI.MAU.MSC2815_UNREDACTED_CONTENT_NOT_RECEIVED"}
|
||||
)
|
||||
|
||||
// HTTPError An HTTP Error response, which may wrap an underlying native Go Error.
|
||||
|
|
|
|||
11
versions.go
11
versions.go
|
|
@ -60,11 +60,12 @@ type UnstableFeature struct {
|
|||
}
|
||||
|
||||
var (
|
||||
FeatureAsyncUploads = UnstableFeature{UnstableFlag: "fi.mau.msc2246.stable", SpecVersion: SpecV17}
|
||||
FeatureAppservicePing = UnstableFeature{UnstableFlag: "fi.mau.msc2659.stable", SpecVersion: SpecV17}
|
||||
FeatureAuthenticatedMedia = UnstableFeature{UnstableFlag: "org.matrix.msc3916.stable", SpecVersion: SpecV111}
|
||||
FeatureMutualRooms = UnstableFeature{UnstableFlag: "uk.half-shot.msc2666.query_mutual_rooms"}
|
||||
FeatureUserRedaction = UnstableFeature{UnstableFlag: "org.matrix.msc4194"}
|
||||
FeatureAsyncUploads = UnstableFeature{UnstableFlag: "fi.mau.msc2246.stable", SpecVersion: SpecV17}
|
||||
FeatureAppservicePing = UnstableFeature{UnstableFlag: "fi.mau.msc2659.stable", SpecVersion: SpecV17}
|
||||
FeatureAuthenticatedMedia = UnstableFeature{UnstableFlag: "org.matrix.msc3916.stable", SpecVersion: SpecV111}
|
||||
FeatureMutualRooms = UnstableFeature{UnstableFlag: "uk.half-shot.msc2666.query_mutual_rooms"}
|
||||
FeatureUserRedaction = UnstableFeature{UnstableFlag: "org.matrix.msc4194"}
|
||||
FeatureViewRedactedContent = UnstableFeature{UnstableFlag: "fi.mau.msc2815"}
|
||||
|
||||
BeeperFeatureHungry = UnstableFeature{UnstableFlag: "com.beeper.hungry"}
|
||||
BeeperFeatureBatchSending = UnstableFeature{UnstableFlag: "com.beeper.batch_sending"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue