forked from Mirrors/gomuks
web/api: add mark read method
This commit is contained in:
parent
ec165d171c
commit
11aa2eabf1
4 changed files with 9 additions and 3 deletions
2
go.mod
2
go.mod
|
@ -13,7 +13,7 @@ require (
|
|||
golang.org/x/crypto v0.27.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
maunium.net/go/mauflag v1.0.0
|
||||
maunium.net/go/mautrix v0.21.1-0.20241012151422-226144ca9f85
|
||||
maunium.net/go/mautrix v0.21.1-0.20241013141433-5cccf93cdc6a
|
||||
)
|
||||
|
||||
require (
|
||||
|
|
4
go.sum
4
go.sum
|
@ -66,5 +66,5 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
|||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M=
|
||||
maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA=
|
||||
maunium.net/go/mautrix v0.21.1-0.20241012151422-226144ca9f85 h1:nX9wlCdRTyIdweQPde+XBOn9uyXhd1VfQB9cIp7jC2k=
|
||||
maunium.net/go/mautrix v0.21.1-0.20241012151422-226144ca9f85/go.mod h1:yIs8uVcl3ZiTuDzAYmk/B4/z9dQqegF0rcOWV4ncgko=
|
||||
maunium.net/go/mautrix v0.21.1-0.20241013141433-5cccf93cdc6a h1:faC83lFuKSS9wTrR2pa1mm0JZkUHa5NA6eA0LVQSrDs=
|
||||
maunium.net/go/mautrix v0.21.1-0.20241013141433-5cccf93cdc6a/go.mod h1:yIs8uVcl3ZiTuDzAYmk/B4/z9dQqegF0rcOWV4ncgko=
|
||||
|
|
|
@ -24,6 +24,7 @@ import type {
|
|||
RPCCommand,
|
||||
RPCEvent,
|
||||
RawDBEvent,
|
||||
ReceiptType,
|
||||
RoomID,
|
||||
TimelineRowID,
|
||||
UserID,
|
||||
|
@ -117,6 +118,10 @@ export default abstract class RPCClient {
|
|||
return this.request("send_event", { room_id, type, content })
|
||||
}
|
||||
|
||||
markRead(room_id: RoomID, event_id: EventID, receipt_type: ReceiptType = "m.read"): Promise<boolean> {
|
||||
return this.request("mark_read", { room_id, event_id, receipt_type })
|
||||
}
|
||||
|
||||
ensureGroupSessionShared(room_id: RoomID): Promise<boolean> {
|
||||
return this.request("ensure_group_session_shared", { room_id })
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ export type DeviceID = string
|
|||
export type EventType = string
|
||||
export type ContentURI = string
|
||||
export type RoomAlias = string
|
||||
export type ReceiptType = "m.read" | "m.read.private"
|
||||
export type RoomVersion = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11"
|
||||
export type RoomType = "" | "m.space"
|
||||
export type RelationType = "m.annotation" | "m.reference" | "m.replace" | "m.thread"
|
||||
|
|
Loading…
Add table
Reference in a new issue