Skip to content

feat: ✨ bridge LINE Flex message fallbacks#180

Merged
highesttt merged 1 commit into
beeper:mainfrom
clins1994:caio/flex-message-fallback
Jun 11, 2026
Merged

feat: ✨ bridge LINE Flex message fallbacks#180
highesttt merged 1 commit into
beeper:mainfrom
clins1994:caio/flex-message-fallback

Conversation

@clins1994

@clins1994 clins1994 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Treat LINE content type 22 as bridgeable
  • Bridge Flex/bot messages as Matrix notices that tell users to check LINE for full details
  • Include ALT_TEXT as a preview when LINE provides it

Fixes #126

Testing

  • go test ./pkg/connector
  • git diff --check

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added support for LINE Flex messages in the Matrix bridge. Flex messages are now properly recognized and converted to a readable text format, including alternative text previews when available.

Walkthrough

This PR adds support for bridging LINE Flex/rich messages (content_type=22) to Matrix. It defines a new ContentFlex constant, updates message validation to accept the type, routes Flex messages to a new conversion handler, and implements fallback conversion using ALT_TEXT metadata or a default notice.

Changes

Flex Message Bridging

Layer / File(s) Summary
Content type constant definition
pkg/connector/consts.go
ContentFlex constant added to ContentType enum with value 22.
Message routing and handler integration
pkg/connector/handle_message.go
isBridgeableContentType now includes ContentFlex in supported types; convertLineMessage dispatch adds case to route ContentFlex to h.ConvertFlex(...).
Flex message conversion handler
pkg/connector/handlers/flex.go
ConvertFlex method converts LINE Flex messages to Matrix fallback ConvertedMessage using trimmed ALT_TEXT from metadata or default "LINE rich message" notice.

Sequence Diagram

sequenceDiagram
  participant LineMessage as LINE Message
  participant MessageHandler as convertLineMessage
  participant BridgeCheck as isBridgeableContentType
  participant FlexConverter as ConvertFlex
  participant MatrixMessage as Matrix Message

  LineMessage->>MessageHandler: receive with ContentFlex
  MessageHandler->>BridgeCheck: check if ContentFlex is supported
  BridgeCheck-->>MessageHandler: returns true
  MessageHandler->>FlexConverter: route ContentFlex
  FlexConverter-->>MatrixMessage: build fallback with ALT_TEXT or notice
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • #126: feat: ✨ Bridge LINE Flex/bot messages — This PR directly implements the feature request to bridge LINE content_type=22 Flex messages by adding ContentFlex constant, routing logic, and fallback conversion using ALT_TEXT metadata, which matches the primary objective to stop dropping these messages and provide a text fallback.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: bridging LINE Flex messages as fallbacks to Matrix.
Description check ✅ Passed The description is directly related to the changeset, outlining the three key changes and testing steps.
Linked Issues check ✅ Passed The PR fully addresses issue #126 by making content_type=22 bridgeable and converting Flex messages to Matrix notices with ALT_TEXT preview when available.
Out of Scope Changes check ✅ Passed All changes are directly scoped to bridging LINE Flex messages: adding a constant, marking it bridgeable, and implementing conversion logic with ALT_TEXT fallback.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@clins1994 clins1994 force-pushed the caio/flex-message-fallback branch from 2efdb01 to 53fd82d Compare June 11, 2026 04:12
@clins1994

Copy link
Copy Markdown
Contributor Author

Currently this is what happens

image

image

The fix will return a best effort preview and a check line for more details

@highesttt highesttt merged commit e1fd206 into beeper:main Jun 11, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

feat: ✨ Bridge LINE Flex/bot messages

2 participants