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

No prefetch URLs unless are messages #812

Merged
merged 1 commit into from
Jan 23, 2017
Merged

No prefetch URLs unless are messages #812

merged 1 commit into from
Jan 23, 2017

Conversation

birkof
Copy link
Contributor

@birkof birkof commented Dec 18, 2016

No description provided.

@astorije
Copy link
Member

What made you open this?
Did you notice a message type that causes a prefetch? It would be unfortunate that parts/quits trigger a prefetch.

I just tried with a /me (ACTION) message and it did not prefetch, which is something we should do.

@birkof
Copy link
Contributor Author

birkof commented Dec 18, 2016

I've found that URIs in notice are parsed on server window

@xPaw
Copy link
Member

xPaw commented Dec 18, 2016

@astorije Introduced in 62d4cd8, as it previously only worked in privmsg, and it goes via a common function to parse messages, notices, wallops...

@astorije
Copy link
Member

Gotcha @xPaw. What about allowing Msg.Type.ACTION as well?

@xPaw
Copy link
Member

xPaw commented Dec 18, 2016

@astorije Dunno, IRC rfc tends to say that actions should not be acted upon anyhow.

@astorije
Copy link
Member

Hmm, odd. In terms of UX, as a user, I would expect that "I love that picture: URL" and "/me loves this picture: URL" are being expanded the same in The Lounge.

@@ -91,6 +91,9 @@ module.exports = function(irc, network) {
});
chan.pushMessage(client, msg, !self);

LinkPrefetch(client, chan, msg);
// No prefetch URLs unless are simple messages.
if (data.type === Msg.Type.MESSAGE) {
Copy link
Member

Choose a reason for hiding this comment

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

I would add Msg.Type.ACTION here. If strong opinion against this, I'll change my mind, but as a user I'd expect that.

Copy link
Member

Choose a reason for hiding this comment

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

Action is "/me", yeah? I agree that prefetch should work with those as well.

Copy link
Member

Choose a reason for hiding this comment

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

Correct.

Copy link
Member

Choose a reason for hiding this comment

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

if (data.type === Msg.Type.MESSAGE || data.type === Msg.Type.ACTION) {

would probably do the trick.

Copy link
Member

Choose a reason for hiding this comment

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

Filter out notices instead?

Copy link
Member

Choose a reason for hiding this comment

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

@xPaw, I'd rather not. I'd prefer a whitelist than a blacklist, at least at this stage and for v2.2.
That would mean filtering out topics as well probably, parts, quits, aways, etc.

@astorije
Copy link
Member

astorije commented Jan 4, 2017

@xPaw, @birkof, ping? I really think Msg.Type.ACTION should allow for prefetching as well, along with URL parsing, channel parsing, etc.

@astorije
Copy link
Member

astorije commented Jan 4, 2017

BTW, this is a regression introduced after 2.1.0 so I'm tagging this one as required for 2.2.0 😢

@astorije astorije added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label Jan 4, 2017
@astorije astorije added this to the 2.2.0 milestone Jan 4, 2017
@astorije astorije added priority and removed priority labels Jan 4, 2017
@birkof
Copy link
Contributor Author

birkof commented Jan 4, 2017

Hey guys. Sorry for delay. In my opinion, I think it is irrelevant to the user to have notices prefetched on Lobby window (just my 2 cents) that's why i've request this merge

@astorije
Copy link
Member

astorije commented Jan 5, 2017

@birkof, I believe we all agree on this :)
ACTION represents messages starting with /me:

screen shot 2017-01-04 at 21 03 21

Could you add this change here please?
Thanks!

@astorije
Copy link
Member

@birkof, mind doing this small change so we can put this behind us and get one step closer to the super-near v2.2.0? :))

@AlMcKinlay
Copy link
Member

@birkof If you won't have time in the next few weeks, can you let us know, so we can either push it to the next release or update it ourselves. I don't think this is something we want to hold up the release for.

@birkof
Copy link
Contributor Author

birkof commented Jan 13, 2017

I've also added the ACTION type to prefetching condition.

@astorije
Copy link
Member

Woops, looks like you missed your rebase seeing the massive commit list and changes. If you make sure that the "Allow maintainers to make changes" checkbox is checked on the top right section of this page and agree with it, I can fix your branch.

@xPaw
Copy link
Member

xPaw commented Jan 14, 2017 via email

@birkof
Copy link
Contributor Author

birkof commented Jan 17, 2017

@xPaw look at message.js file. it handles messages and actions.
image

@birkof
Copy link
Contributor Author

birkof commented Jan 17, 2017

@astorije I allowed edits from maintainers. My mistake was to not make a new branch with this fix, and put it into master.

ACTION & MESSAGE type messages should be prefetched by default
Copy link
Member

@astorije astorije left a comment

Choose a reason for hiding this comment

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

I have fixed your branch (there is nothing a git rebase cannot clean up :P) as well as squashed the commits. I've also took the liberty to one-line your if statement, 6 lines was too much for me :D

I'm good with it now, what do @xPaw and @YaManicKill say?

Copy link
Member

@AlMcKinlay AlMcKinlay left a comment

Choose a reason for hiding this comment

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

Yeah, looks good to me.

@AlMcKinlay AlMcKinlay merged commit ba165de into thelounge:master Jan 23, 2017
@birkof
Copy link
Contributor Author

birkof commented Jan 23, 2017

Peeeeerfect! Thanks

matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
No prefetch URLs unless are messages
@astorije
Copy link
Member

Hey @birkof, we have sticker packs for our contributors now!
If you're interested, go fill the form at https://goo.gl/forms/f5usqAEp5DWoeXC92 🙂

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.

4 participants