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

Conversation

Projects
None yet
2 participants
@Half-Shot
Copy link
Owner

commented Oct 25, 2018

No description provided.

Half-Shot added some commits Oct 24, 2018

@Half-Shot

This comment has been minimized.

Copy link
Owner Author

commented Oct 25, 2018

Fixes #238 #187

@Half-Shot Half-Shot requested a review from Sorunome Oct 25, 2018

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

This comment has been minimized.

Copy link
@Sorunome

Sorunome Oct 25, 2018

Collaborator

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];

This comment has been minimized.

Copy link
@Sorunome

Sorunome Oct 25, 2018

Collaborator

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),

This comment has been minimized.

Copy link
@Sorunome

Sorunome Oct 25, 2018

Collaborator

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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@Half-Shot Half-Shot deleted the hs/replies branch Oct 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.