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

Correctly handle inline channels in messages #128

Merged
merged 1 commit into from
Mar 4, 2016
Merged

Correctly handle inline channels in messages #128

merged 1 commit into from
Mar 4, 2016

Conversation

xPaw
Copy link
Member

@xPaw xPaw commented Feb 29, 2016

Moves inline channel parser into Handlebars, which means it is parsed before parsing colours and links, should fix a couple of parser related bugs.

@astorije
Copy link
Member

Sadly, I am 👎 on this. One of the networks I'm on almost exclusively uses &channels (it's not a personal/small IRC network btw).
Are there any other alternatives we could explore?

Commit was amended after the fact, my comment does not hold anymore.

@xPaw
Copy link
Member Author

xPaw commented Feb 29, 2016

What network does that? I might have a better fix for this in mind, will try.

@astorije
Copy link
Member

What network does that?

irc.w3.org :P

@tguild
Copy link

tguild commented Feb 29, 2016

W3C is following this project and strongly contemplating replacing our qwebirc instance

@astorije
Copy link
Member

I might have a better fix for this in mind, will try.

If you do, might want to consider closing and opening a new PR instead of amending commit to keep change history :-)

@xPaw xPaw changed the title Fix #15: Do not try to parse channel names starting with & Correctly handle inline channels in messages Feb 29, 2016
@xPaw
Copy link
Member Author

xPaw commented Feb 29, 2016

Okay, pushed a proper fix.

@dgw
Copy link
Contributor

dgw commented Feb 29, 2016

Wouldn't it be better to parse the CHANTYPES sent by the server? Maybe not in this PR, but eventually.

@xPaw
Copy link
Member Author

xPaw commented Feb 29, 2016

Wouldn't it be better to parse the CHANTYPES sent by the server? Maybe not in this PR, but eventually.

Yes, that's not a terrible idea. #24

@@ -48,6 +38,12 @@ function uri(text) {
});
}

function channels(text) {
return text.replace(
Copy link
Member

Choose a reason for hiding this comment

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

Could you re-add here the comment you deleted below please?

// Channels names are strings (beginning with a '&' or '#' character)
// of length up to 200 characters.
// See https://tools.ietf.org/html/rfc1459#section-1.3

@astorije astorije self-assigned this Mar 1, 2016
@astorije astorije added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label Mar 1, 2016
@astorije
Copy link
Member

astorije commented Mar 1, 2016

@xPaw, looks nice at first glance, I'll give it a deeper review and an actual test.

Could you comment your code a bit, to be nice with future ourselves, please?
If you also add some details to the commit message on top of the comment, well that would be truly terrific :-)

@xPaw
Copy link
Member Author

xPaw commented Mar 1, 2016

I've pushed a fix to correctly handle characters that cannot be in the channel name before the # (like commas).

@maxpoulin64
Copy link
Member

Code looks good to me and it works very well. Also fixes a whole world of broken link parsing so I like it. 👍

@astorije
Copy link
Member

astorije commented Mar 4, 2016

👍

astorije added a commit that referenced this pull request Mar 4, 2016
Correctly handle inline channels in messages
@astorije astorije merged commit 83baeee into thelounge:master Mar 4, 2016
maxpoulin64 added a commit to maxpoulin64/thelounge that referenced this pull request Mar 6, 2016
This one should be really hard to break/unbreakable. It should be just as complete as the old one and address thelounge#15, thelounge#128, thelounge#129 and possibly various other unexpected breakages.

It solves the problem by making it so when a parser matches, it is responsible for recalling the parser with what it allowed to be parsed further.
maxpoulin64 added a commit to maxpoulin64/thelounge that referenced this pull request Mar 6, 2016
This one should be really hard to break/unbreakable. It should be just as complete as the old one and address thelounge#15, thelounge#128, thelounge#129 and possibly various other unexpected breakages.

It solves the problem by making it so when a parser matches, it is responsible for recalling the parser with what it allowed to be parsed further.
maxpoulin64 added a commit to maxpoulin64/thelounge that referenced this pull request Mar 6, 2016
This one should be really hard to break/unbreakable. It should be just as complete as the old one and address thelounge#15, thelounge#128, thelounge#129 and possibly various other unexpected breakages.

It solves the problem by making it so when a parser matches, it is responsible for recalling the parser with what it allowed to be parsed further.
maxpoulin64 added a commit to maxpoulin64/thelounge that referenced this pull request Mar 6, 2016
This one should be really hard to break/unbreakable. It should be just as complete as the old one and address thelounge#15, thelounge#128, thelounge#129 and possibly various other unexpected breakages.

It solves the problem by making it so when a parser matches, it is responsible for recalling the parser with what it allowed to be parsed further.
maxpoulin64 added a commit to maxpoulin64/thelounge that referenced this pull request Mar 6, 2016
This one should be really hard to break/unbreakable. It should be just as complete as the old one and address thelounge#15, thelounge#128, thelounge#129 and possibly various other unexpected breakages.

It solves the problem by making it so when a parser matches, it is responsible for recalling the parser with what it allowed to be parsed further.
maxpoulin64 added a commit to maxpoulin64/thelounge that referenced this pull request Mar 6, 2016
This one should be really hard to break/unbreakable. It should be just as complete as the old one and address thelounge#15, thelounge#128, thelounge#129 and possibly various other unexpected breakages.

It solves the problem by making it so when a parser matches, it is responsible for recalling the parser with what it allowed to be parsed further.
@xPaw xPaw deleted the fix-chan-parse branch March 7, 2016 17:17
@astorije astorije added this to the 1.3.1 milestone Apr 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants