Skip to content

Commit

Permalink
event/capabilities: add max text length field
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jan 10, 2025
1 parent 2851065 commit bbcb190
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions event/capabilities.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export interface RoomFeatures {
*/
file?: Record<CapabilityMsgType, FileFeatures>

/** Maximum length of normal text messages. */
max_text_length?: integer

/** Whether location messages (`m.location`) are supported. */
location_message?: CapabilitySupportLevel
/** Whether polls are supported. */
Expand Down
4 changes: 4 additions & 0 deletions event/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bbcb190

Please sign in to comment.