-
Notifications
You must be signed in to change notification settings - Fork 5
[codex] Add mautrix iMessage bridge #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
batuhan
wants to merge
7
commits into
main
Choose a base branch
from
batuhan/add-imessage-bridge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ce06d84
Add mautrix iMessage bridge
batuhan 31f1e32
Add bridgev2 iMessage integration commands and sync fixes
batuhan aafa6b3
Add bridgev2 iMessage login permissions flow
batuhan 18576c5
Update iMessage agent instructions
batuhan 64978ec
Request Messages Data before falling back to Full Disk Access
batuhan 4f7a8b0
Update AGENTS instructions to start with readme
batuhan 21bc4af
Fix iMessage group chat portal reconciliation
batuhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # mautrix-imessage bridgev2 | ||
|
|
||
| This repo includes a bridgev2 Matrix bridge entrypoint at `cmd/mautrix-imessage`. | ||
|
|
||
| The bridge is integrated with the Swift iMessage runtime through `IMessageBridgeKit`, a Swift dynamic library with a C ABI. It does not shell out to `imessage-cli`. | ||
|
|
||
| ## Build | ||
|
|
||
| ```sh | ||
| swift build --product IMessageBridgeKit | ||
| swift_bin="$(swift build --show-bin-path)" | ||
| CGO_LDFLAGS="-L${swift_bin} -Wl,-rpath,${swift_bin}" \ | ||
| go build -tags nocrypto ./cmd/mautrix-imessage | ||
| ``` | ||
|
|
||
| The `nocrypto` tag avoids linking mautrix's optional libolm dependency while still keeping cgo enabled for the Swift bridge library. | ||
|
|
||
| The bridge currently supports local-login, startup chat/message sync, live state-sync events, Matrix text/file sends, replies, edits, unsend, reactions, read receipts, and typing. | ||
|
|
||
| It must run on macOS with the usual platform-imessage permissions for Messages data and UI automation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "maunium.net/go/mautrix/bridgev2/matrix/mxmain" | ||
|
|
||
| "github.com/beeper/platform-imessage/pkg/connector" | ||
| ) | ||
|
|
||
| var ( | ||
| Tag = "unknown" | ||
| Commit = "unknown" | ||
| BuildTime = "unknown" | ||
| ) | ||
|
|
||
| var m = mxmain.BridgeMain{ | ||
| Name: "mautrix-imessage", | ||
| URL: "https://github.com/beeper/platform-imessage", | ||
| Description: "A Matrix-iMessage bridge using platform-imessage and mautrix bridgev2.", | ||
| Version: "0.1.0", | ||
| Connector: &connector.Connector{}, | ||
| } | ||
|
|
||
| func main() { | ||
| m.InitVersion(Tag, Commit, BuildTime) | ||
| m.Run() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| module github.com/beeper/platform-imessage | ||
|
|
||
| go 1.25.0 | ||
|
|
||
| toolchain go1.26.2 | ||
|
|
||
| require ( | ||
| github.com/rs/zerolog v1.35.1 | ||
| go.mau.fi/util v0.9.9-0.20260511124621-9241e81bdf25 | ||
| maunium.net/go/mautrix v0.27.1-0.20260513120123-5fba7e3afae4 | ||
| ) | ||
|
|
||
| require ( | ||
| filippo.io/edwards25519 v1.2.0 // indirect | ||
| github.com/coder/websocket v1.8.14 // indirect | ||
| github.com/coreos/go-systemd/v22 v22.7.0 // indirect | ||
| github.com/lib/pq v1.12.3 // indirect | ||
| github.com/mattn/go-colorable v0.1.14 // indirect | ||
| github.com/mattn/go-isatty v0.0.20 // indirect | ||
| github.com/mattn/go-sqlite3 v1.14.44 // indirect | ||
| github.com/petermattis/goid v0.0.0-20260330135022-df67b199bc81 // indirect | ||
| github.com/rs/xid v1.6.0 // indirect | ||
| github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect | ||
| github.com/tidwall/gjson v1.18.0 // indirect | ||
| github.com/tidwall/match v1.1.1 // indirect | ||
| github.com/tidwall/pretty v1.2.1 // indirect | ||
| github.com/tidwall/sjson v1.2.5 // indirect | ||
| github.com/yuin/goldmark v1.8.2 // indirect | ||
| go.mau.fi/zeroconfig v0.2.0 // indirect | ||
| golang.org/x/crypto v0.50.0 // indirect | ||
| golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect | ||
| golang.org/x/net v0.53.0 // indirect | ||
| golang.org/x/sync v0.20.0 // indirect | ||
| golang.org/x/sys v0.43.0 // indirect | ||
| golang.org/x/text v0.36.0 // indirect | ||
| gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | ||
| gopkg.in/yaml.v3 v3.0.1 // indirect | ||
| maunium.net/go/mauflag v1.0.0 // indirect | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= | ||
| filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= | ||
| github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= | ||
| github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= | ||
| github.com/coder/websocket v1.8.14 h1:9L0p0iKiNOibykf283eHkKUHHrpG7f65OE3BhhO7v9g= | ||
| github.com/coder/websocket v1.8.14/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg= | ||
| github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA= | ||
| github.com/coreos/go-systemd/v22 v22.7.0/go.mod h1:xNUYtjHu2EDXbsxz1i41wouACIwT7Ybq9o0BQhMwD0w= | ||
| github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
| github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
| github.com/lib/pq v1.12.3 h1:tTWxr2YLKwIvK90ZXEw8GP7UFHtcbTtty8zsI+YjrfQ= | ||
| github.com/lib/pq v1.12.3/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA= | ||
| github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= | ||
| github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= | ||
| github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= | ||
| github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= | ||
| github.com/mattn/go-sqlite3 v1.14.44 h1:3VSe+xafpbzsLbdr2AWlAZk9yRHiBhTBakioXaCKTF8= | ||
| github.com/mattn/go-sqlite3 v1.14.44/go.mod h1:pjEuOr8IwzLJP2MfGeTb0A35jauH+C2kbHKBr7yXKVQ= | ||
| github.com/petermattis/goid v0.0.0-20260330135022-df67b199bc81 h1:WDsQxOJDy0N1VRAjXLpi8sCEZRSGarLWQevDxpTBRrM= | ||
| github.com/petermattis/goid v0.0.0-20260330135022-df67b199bc81/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= | ||
| github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
| github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
| github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= | ||
| github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= | ||
| github.com/rs/zerolog v1.35.1 h1:m7xQeoiLIiV0BCEY4Hs+j2NG4Gp2o2KPKmhnnLiazKI= | ||
| github.com/rs/zerolog v1.35.1/go.mod h1:EjML9kdfa/RMA7h/6z6pYmq1ykOuA8/mjWaEvGI+jcw= | ||
| github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0= | ||
| github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M= | ||
| github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= | ||
| github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= | ||
| github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= | ||
| github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= | ||
| github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= | ||
| github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= | ||
| github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= | ||
| github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= | ||
| github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= | ||
| github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= | ||
| github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= | ||
| github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= | ||
| github.com/yuin/goldmark v1.8.2 h1:kEGpgqJXdgbkhcOgBxkC0X0PmoPG1ZyoZ117rDVp4zE= | ||
| github.com/yuin/goldmark v1.8.2/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= | ||
| go.mau.fi/util v0.9.9-0.20260511124621-9241e81bdf25 h1:YPEmc+li7TF6C9AdRTcSLMb6yCHdF27/wNT7kFLIVNg= | ||
| go.mau.fi/util v0.9.9-0.20260511124621-9241e81bdf25/go.mod h1:jE9FfhbgEgAwxei6lomO9v8zdCIATcquONUu4vjRwSs= | ||
| go.mau.fi/zeroconfig v0.2.0 h1:e/OGEERqVRRKlgaro7E6bh8xXiKFSXB3eNNIud7FUjU= | ||
| go.mau.fi/zeroconfig v0.2.0/go.mod h1:J0Vn0prHNOm493oZoQ84kq83ZaNCYZnq+noI1b1eN8w= | ||
| golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= | ||
| golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= | ||
| golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM= | ||
| golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80= | ||
| golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= | ||
| golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= | ||
| golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= | ||
| golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= | ||
| golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
| golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= | ||
| golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= | ||
| golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= | ||
| golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= | ||
| gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
| gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
| gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= | ||
| gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= | ||
| 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.27.1-0.20260513120123-5fba7e3afae4 h1:zNC9eVAhw8FhKpM3AxNAh/iy75UEYX91uJUvqqAYlvo= | ||
| maunium.net/go/mautrix v0.27.1-0.20260513120123-5fba7e3afae4/go.mod h1:3sOGhXi3P1V6/NruTA0gujkvTypXVUraWktCuTGyDuM= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| package connector | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/beeper/platform-imessage/pkg/imessage" | ||
| "github.com/beeper/platform-imessage/pkg/imessageid" | ||
| "maunium.net/go/mautrix/bridgev2" | ||
| "maunium.net/go/mautrix/bridgev2/database" | ||
| "maunium.net/go/mautrix/bridgev2/networkid" | ||
| ) | ||
|
|
||
| var _ bridgev2.BackfillingNetworkAPI = (*Client)(nil) | ||
|
|
||
| func (c *Client) FetchMessages(ctx context.Context, params bridgev2.FetchMessagesParams) (*bridgev2.FetchMessagesResponse, error) { | ||
| threadID := string(params.Portal.ID) | ||
| pagination := backfillPagination(params) | ||
| page, err := c.IM.Messages(threadID, pagination) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| messages := make([]*bridgev2.BackfillMessage, 0, len(page.Items)) | ||
| for i := len(page.Items) - 1; i >= 0; i-- { | ||
| msg := page.Items[i] | ||
| if msg.ThreadID == "" { | ||
| msg.ThreadID = threadID | ||
| } | ||
| converted, err := c.convertMessageFromIMessage(ctx, params.Portal, c.Main.Bridge.Bot, msg) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| reactions := make([]*bridgev2.BackfillReaction, 0, len(msg.Reactions)) | ||
| for _, reaction := range msg.Reactions { | ||
| reactions = append(reactions, &bridgev2.BackfillReaction{ | ||
| Sender: bridgev2.EventSender{Sender: imessageid.MakeUserID(reaction.ParticipantID)}, | ||
| EmojiID: networkid.EmojiID(reaction.ID), | ||
| Emoji: reaction.ReactionKey, | ||
| }) | ||
| } | ||
| messages = append(messages, &bridgev2.BackfillMessage{ | ||
| ConvertedMessage: converted, | ||
| Sender: c.sender(msg), | ||
| ID: imessageid.MakeMessageID(msg.ID), | ||
| TxnID: networkid.TransactionID(msg.ID), | ||
| Timestamp: messageTimestamp(msg), | ||
| StreamOrder: msg.Timestamp, | ||
| Reactions: reactions, | ||
| }) | ||
| } | ||
|
|
||
| return &bridgev2.FetchMessagesResponse{ | ||
| Messages: messages, | ||
| Cursor: networkid.PaginationCursor(nextBackfillCursor(page, messages)), | ||
| HasMore: page.HasMore, | ||
| Forward: params.Forward, | ||
| }, nil | ||
| } | ||
|
|
||
| func backfillPagination(params bridgev2.FetchMessagesParams) *imessage.Pagination { | ||
| cursor := string(params.Cursor) | ||
| if cursor == "" { | ||
| cursor = cursorFromMessage(params.AnchorMessage) | ||
| } | ||
| if cursor == "" { | ||
| return nil | ||
| } | ||
| direction := "before" | ||
| if params.Forward { | ||
| direction = "after" | ||
| } | ||
| return &imessage.Pagination{ | ||
| Cursor: cursor, | ||
| Direction: direction, | ||
| } | ||
| } | ||
|
|
||
| func cursorFromMessage(msg *database.Message) string { | ||
| if msg == nil { | ||
| return "" | ||
| } | ||
| if meta, ok := msg.Metadata.(*imessageid.MessageMetadata); ok && meta.Cursor != "" { | ||
| return meta.Cursor | ||
| } | ||
| return string(msg.ID) | ||
| } | ||
|
|
||
| func nextBackfillCursor(page *imessage.Page[imessage.Message], messages []*bridgev2.BackfillMessage) string { | ||
| if page == nil { | ||
| return "" | ||
| } | ||
| if page.OldestCursor != "" { | ||
| return page.OldestCursor | ||
| } | ||
| if len(messages) == 0 { | ||
| return "" | ||
| } | ||
| return string(messages[0].ID) | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| package connector | ||
|
|
||
| import ( | ||
| "context" | ||
| "time" | ||
|
|
||
| "go.mau.fi/util/jsontime" | ||
| "go.mau.fi/util/ptr" | ||
| "maunium.net/go/mautrix/bridgev2" | ||
| "maunium.net/go/mautrix/event" | ||
| ) | ||
|
|
||
| const maxTextLength = 200_000 | ||
| const maxFileSize = 100 * 1024 * 1024 | ||
|
|
||
| var generalCaps = &bridgev2.NetworkGeneralCapabilities{ | ||
| ImplicitReadReceipts: true, | ||
| Provisioning: bridgev2.ProvisioningCapabilities{ | ||
| ResolveIdentifier: bridgev2.ResolveIdentifierCapabilities{ | ||
| CreateDM: true, | ||
| AnyPhone: true, | ||
| ContactList: true, | ||
| Search: true, | ||
| }, | ||
| }, | ||
| } | ||
|
|
||
| func (c *Connector) GetCapabilities() *bridgev2.NetworkGeneralCapabilities { | ||
| return generalCaps | ||
| } | ||
|
|
||
| func (c *Connector) GetBridgeInfoVersion() (info, capabilities int) { | ||
| return 1, 1 | ||
| } | ||
|
|
||
| var roomCaps = &event.RoomFeatures{ | ||
| ID: "com.beeper.imessage.capabilities.2026_06_04", | ||
| Formatting: map[event.FormattingFeature]event.CapabilitySupportLevel{ | ||
| event.FmtBold: event.CapLevelDropped, | ||
| event.FmtItalic: event.CapLevelDropped, | ||
| event.FmtStrikethrough: event.CapLevelDropped, | ||
| event.FmtInlineLink: event.CapLevelDropped, | ||
| event.FmtUserLink: event.CapLevelDropped, | ||
| }, | ||
| File: map[event.CapabilityMsgType]*event.FileFeatures{ | ||
| event.MsgImage: { | ||
| MimeTypes: map[string]event.CapabilitySupportLevel{"*/*": event.CapLevelFullySupported}, | ||
| Caption: event.CapLevelDropped, | ||
| MaxSize: maxFileSize, | ||
| }, | ||
| event.MsgVideo: { | ||
| MimeTypes: map[string]event.CapabilitySupportLevel{"*/*": event.CapLevelFullySupported}, | ||
| Caption: event.CapLevelDropped, | ||
| MaxSize: maxFileSize, | ||
| }, | ||
| event.MsgAudio: { | ||
| MimeTypes: map[string]event.CapabilitySupportLevel{"*/*": event.CapLevelFullySupported}, | ||
| Caption: event.CapLevelDropped, | ||
| MaxSize: maxFileSize, | ||
| }, | ||
| event.MsgFile: { | ||
| MimeTypes: map[string]event.CapabilitySupportLevel{"*/*": event.CapLevelFullySupported}, | ||
| Caption: event.CapLevelDropped, | ||
| MaxSize: maxFileSize, | ||
| }, | ||
| }, | ||
| MaxTextLength: maxTextLength, | ||
| Reply: event.CapLevelFullySupported, | ||
| Edit: event.CapLevelFullySupported, | ||
| EditMaxAge: ptr.Ptr(jsontime.S(15 * time.Minute)), | ||
| Delete: event.CapLevelFullySupported, | ||
| DeleteForMe: false, | ||
| DeleteMaxAge: ptr.Ptr(jsontime.S(2 * time.Minute)), | ||
| Reaction: event.CapLevelFullySupported, | ||
| ReactionCount: 1, | ||
| ReadReceipts: true, | ||
| TypingNotifications: true, | ||
| MarkAsUnread: true, | ||
| DeleteChat: true, | ||
| } | ||
|
|
||
| func (c *Client) GetCapabilities(ctx context.Context, portal *bridgev2.Portal) *event.RoomFeatures { | ||
| return roomCaps.Clone() | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.