-
Notifications
You must be signed in to change notification settings - Fork 148
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
Show replies as embeds #259
Conversation
src/matrixeventprocessor.ts
Outdated
@@ -14,6 +14,7 @@ const MaxFileSize = 8000000; | |||
const MIN_NAME_LENGTH = 2; | |||
const MAX_NAME_LENGTH = 32; | |||
const DISCORD_EMOJI_REGEX = /:(\w+):/g; | |||
const REPLY_REGEX = /> <(@.*:.*)> (.*)\n\n(.*)/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regex could be better, matching MXIDs rather than anything. Also it appears that the reply content is wrapped into ""
src/matrixeventprocessor.ts
Outdated
sourceEvent.content["m.relates_to"]["m.in_reply_to"]) { | ||
const sourceMatch = REPLY_REGEX.exec(sourceEvent.content.body); | ||
if (sourceMatch && sourceMatch.length === REPLY_MATCHES) { | ||
replyText = sourceMatch[INDEX_REPLY]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
message 1:
message 2: <reply to message 1>
message 3: <reply to message 2>
we are replying to message 2, though, and not message 1, so why bother to get that source?
src/matrixeventprocessor.ts
Outdated
this.SetEmbedAuthor( | ||
embed, | ||
sourceEvent.sender, | ||
await intent.getProfileInfo(sourceEvent.sender), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idea: short-circuit @_discord_uiserid:homeserver
MXIDs and somehow link their discord profile
No description provided.