Skip to content
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

[Feature Request] Detect formatting from Matrix client and pass through to hangups #26

Closed
bobpaul opened this issue Jun 14, 2020 · 2 comments · Fixed by #39
Closed

[Feature Request] Detect formatting from Matrix client and pass through to hangups #26

bobpaul opened this issue Jun 14, 2020 · 2 comments · Fixed by #39

Comments

@bobpaul
Copy link

bobpaul commented Jun 14, 2020

Steps

  1. Mark some text as bold, italics, and strike through in Riot. Eg: Send the message:
    **bold** _italics_ <del>strike</del>
  2. Note these are all formatting options supported in hangouts: https://support.google.com/chat/answer/7649118?hl=en
  3. Open https://hangouts.google.com and notice the message text is not displayed as bold, italics, and strike-through but rather as the exact text **bold** _italics_ <del>strike</del>

Expected Behavior
mautrix-hangouts should parse **foo** as bold, _bar_ as italics, and <del>baz</del> as strikethrough. mautrix-hangouts should divide the message into segments and apply formatting to each segment.

@bobpaul
Copy link
Author

bobpaul commented Jun 14, 2020

Message formatting can also be used to insert hyperlinks, which would fix #9

@meyerrj
Copy link

meyerrj commented Oct 6, 2020

It looks like there's some examples here:

https://github.com/tdryer/hangups/blob/master/hangups/test/test_message_parser.py

https://github.com/tdryer/hangups/blob/33f1b1cbb1c6b22ef074ce17b848f9b469d31838/hangups/conversation_event.py#L99

Just guessing, but could the fix be something like changing this:

message_content=hangouts.MessageContent(
	segment=[hangups.ChatMessageSegment(text).serialize()],
),

To this?

message_content=hangouts.MessageContent(
	segment = [hangups.ChatMessageSegment(seg.text, **seg.params).serialize() for seg in ChatMessageParser.parse(text)],
),

Assuming ChatMessageParser is imported as-is...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants