From bbcb1904e268a9ba4ab11308ea64c75967ee11da Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 10 Jan 2025 17:40:22 +0200 Subject: [PATCH] event/capabilities: add max text length field --- event/capabilities.d.ts | 3 +++ event/capabilities.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/event/capabilities.d.ts b/event/capabilities.d.ts index 1c5d533d..4cf29de7 100644 --- a/event/capabilities.d.ts +++ b/event/capabilities.d.ts @@ -17,6 +17,9 @@ export interface RoomFeatures { */ file?: Record + /** Maximum length of normal text messages. */ + max_text_length?: integer + /** Whether location messages (`m.location`) are supported. */ location_message?: CapabilitySupportLevel /** Whether polls are supported. */ diff --git a/event/capabilities.go b/event/capabilities.go index 6a9b0b56..9c9eb09a 100644 --- a/event/capabilities.go +++ b/event/capabilities.go @@ -30,6 +30,8 @@ type RoomFeatures struct { Formatting FormattingFeatureMap `json:"formatting,omitempty"` File FileFeatureMap `json:"file,omitempty"` + MaxTextLength int `json:"max_text_length,omitempty"` + LocationMessage CapabilitySupportLevel `json:"location_message,omitempty"` Poll CapabilitySupportLevel `json:"poll,omitempty"` Thread CapabilitySupportLevel `json:"thread,omitempty"` @@ -215,6 +217,8 @@ func (rf *RoomFeatures) Hash() []byte { hashMap(hasher, "formatting", rf.Formatting) hashMap(hasher, "file", rf.File) + hashInt(hasher, "max_text_length", rf.MaxTextLength) + hashValue(hasher, "location_message", rf.LocationMessage) hashValue(hasher, "poll", rf.Poll) hashValue(hasher, "thread", rf.Thread)