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 a preview of long messages on IRC #529

Closed
wants to merge 4 commits into from

Conversation

14mRh4X0r
Copy link
Contributor

This gives users on the IRC side an idea what the long message is about, without flooding the channel with text. This solves an issue some people have where IRC users aren't willing to click to content they can't see, and is more in line with other services.

@silkeh
Copy link
Contributor

silkeh commented Feb 7, 2018

How does this handle pure code blocks?

Edit: to elaborate, a message containing only a code block (starting and ending with ```) could be linked as the content of that code block, along with a different message (eg: code: <link>, or even c++ code: <link>).

@Half-Shot
Copy link
Contributor

This will need rebasing onto the current develop because we dropped node 4 :(.

Also, unit tests on the behavior would be good.

@Half-Shot
Copy link
Contributor

Thanking you, will review.

@@ -133,6 +133,56 @@ function Client(addr, nick, opts) {
return this.chans[channel];
}

// Copied over from irc.js and modified slightly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a huge fan of this, but it looks like the IRC lib for some reason contains code that really aught to be split out. I'll allow it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, crazy idea. Could we put these two functions in a new class in util/MessageFormatting.js or something rather than using the unsafeClient version. I think it would be better than reimplementing them in a mock.

msgtype: "m.text",
body: messagePreview + truncatedMsg
};
}
}
else {
req.log.warn("Sending truncated message");
Copy link
Contributor

@Half-Shot Half-Shot Jul 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small complaint: This should probably be info rather than warn. I know you didn't write the code, but it's just annoying me 😆

@Half-Shot
Copy link
Contributor

I think this is looking very promising, if we fix these up I'll take another look and hopefully merge :)

@Half-Shot
Copy link
Contributor

Since our move to Typescript, this PR will no longer cleanly merge into the codebase. I'm going to close this rather than request changes. Feel free to re-open the PR if you want to continue to work on it.

@tadzik
Copy link
Contributor

tadzik commented Jul 22, 2021

Bringing this back in #1430 since it's still an annoying issue for IRC users. Thanks for contributing it, @14mRh4X0r!

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.

4 participants