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

Show replies as embeds #259

Merged
merged 12 commits into from
Oct 25, 2018
Merged

Show replies as embeds #259

merged 12 commits into from
Oct 25, 2018

Conversation

Half-Shot
Copy link
Contributor

No description provided.

@Half-Shot
Copy link
Contributor Author

Fixes #238 #187

@@ -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(.*)/;
Copy link
Collaborator

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 ""

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];
Copy link
Collaborator

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?

this.SetEmbedAuthor(
embed,
sourceEvent.sender,
await intent.getProfileInfo(sourceEvent.sender),
Copy link
Collaborator

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

@Half-Shot Half-Shot merged commit a9df83e into develop Oct 25, 2018
@Half-Shot Half-Shot deleted the hs/replies branch October 30, 2018 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants