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
Add option to display webpage titles by right clicking in chat #13724
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives players a simple way to (potentially unknowingly) reveal their IP addresses. However the setting is false
by default, so this may not be an issue.
I think this would be taken better care of by server-side mods: Simply use register_on_chat_message
, search messages for URLs and asynchronously request the pages using the HTTP API, then have the server send the title to everyone like ShadowBot in the Minetest IRC channel. This avoids (1) every client having to request the website just to show a title preview (2) players leaking their IP; the server's IP is known already.
However the UX may be considered slightly worse; titles would be sent by default rather than on-demand. It could also be implemented on-demand, but that would have to use chatcommands or formspec interactions.
While I agree that you can easily hand out your ip with this feature, like you said, you have to enable it by hand (like you said), AND the alternative would the be pressing ctrl and left click to open the link in the default broswer, which isn't any better in my opinion... Regarding the server side mod, to add to all the drawbacks you've already mentioned, as a user you would have to go to each sever you play on as a user and ask the owner to add a mod, and client side mods are usually disabled... |
return ""; | ||
} | ||
|
||
bool GUIChatConsole::weblinkClickOpen(s32 col, s32 row) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that this PR does not add this code, all it did to it was changing it's name (which should be fine as it's private), and separate a part of it, as the feature added requires that as well. That somehow confused the git diff
288e759
to
fddb363
Compare
fddb363
to
b59a286
Compare
b59a286
to
8591da5
Compare
(Note that I added this label because sfan5 started reviewing, so I assumed he supports this) |
To be clear I am neutral to this feature, but if it is merged the code should be corrected. |
From IRC:
|
This simple PR adds a setting that allows you to display the title of a webpage (like it would be displayed in your browser) by simply right-clicking them in chat. It does so by getting the website's HTML using cURL, and then extracting the title tag.
Why is this PR needed
While playing in multiplayer, players may come across links where it's not obvious where they lead you to. With this feature, you can find that out just with a single click, and without the need of opening a browser.
To do
This PR is a Ready for Review¹.
1: Since it compiled and works just fine I would mark this as "Ready for review" for now. However, due to this being my first PR to the minetest engine itself, I do expect tons of changes I'll have to implement before it's in a case where merging it is actually considered.
How to test