Skip to content

Commit

Permalink
capabilities: fix allowed video and image types
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Feb 5, 2025
1 parent ab29149 commit e22588b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/connector/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ func (tc *TwitterConnector) GetCapabilities() *bridgev2.NetworkGeneralCapabiliti
}

func (tc *TwitterConnector) GetBridgeInfoVersion() (info, caps int) {
return 1, 1
return 1, 2
}

const MaxTextLength = 10000

func (tc *TwitterClient) GetCapabilities(_ context.Context, _ *bridgev2.Portal) *event.RoomFeatures {
return &event.RoomFeatures{
ID: "fi.mau.twitter.capabilities.2025_01_10",
ID: "fi.mau.twitter.capabilities.2025_02_05",
//Formatting: map[event.FormattingFeature]event.CapabilitySupportLevel{
// event.FmtUserLink: event.CapLevelFullySupported,
//},
Expand All @@ -48,13 +48,17 @@ func (tc *TwitterClient) GetCapabilities(_ context.Context, _ *bridgev2.Portal)
"image/jpeg": event.CapLevelFullySupported,
"image/png": event.CapLevelFullySupported,
"image/gif": event.CapLevelFullySupported,
"image/webp": event.CapLevelFullySupported,
},
Caption: event.CapLevelFullySupported,
MaxCaptionLength: MaxTextLength,
MaxSize: 5 * 1024 * 1024,
},
event.MsgVideo: {
MimeTypes: map[string]event.CapabilitySupportLevel{},
MimeTypes: map[string]event.CapabilitySupportLevel{
"video/mp4": event.CapLevelFullySupported,
"video/quicktime": event.CapLevelFullySupported,
},
Caption: event.CapLevelFullySupported,
MaxCaptionLength: MaxTextLength,
MaxSize: 15 * 1024 * 1024,
Expand Down

0 comments on commit e22588b

Please sign in to comment.