Commit graph

112 commits

Author SHA1 Message Date
Dexter Chua 2f434be75d Add option to disable media preview.
This disables image previews iff prefetchStorage is disabled. This
stops the client from making any requests to third-party sites.
2020-07-21 08:52:02 +08:00
Pavel Djundik d29f2fb251 Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized" 2020-06-14 12:32:08 +03:00
Pavel Djundik 881b3eda19 Run format after updating to prettier 2.0 2020-03-21 22:55:36 +02:00
Pavel Djundik 63fd0def6c Improve wav audio file support 2020-02-26 10:07:40 +02:00
Pavel Djundik d2932ccea8 Correctly track user toggle of previews 2019-12-23 12:26:57 +02:00
Pavel Djundik 769585e72d Collapse prefetch errors by default 2019-12-23 12:15:23 +02:00
Pavel Djundik 7a350ac69a
Merge pull request #3602 from thelounge/xpaw/ua
Pretend to be facebook and twitter bots in link prefetcher
2019-12-19 15:25:39 +02:00
Pavel Djundik 72a954b865 Add preview for text/plain urls 2019-12-19 15:12:02 +02:00
Pavel Djundik c108c20c91 Pretend to be facebook and twitter bots 2019-12-17 22:35:15 +02:00
Pavel Djundik 0486f43f9f
Merge pull request #3557 from thelounge/xpaw/premature-close
Fix "premature close" on link previews
2019-12-14 22:45:49 +02:00
Pavel Djundik bbf92f1aa0 Assign preview.thumb only after it is processed 2019-12-13 11:43:13 +02:00
Pavel Djundik e9cbea9569 Update link prefetch stream handling
Fixes #3564
2019-12-09 21:05:33 +02:00
Pavel Djundik fc1c9568e2 Rename helpers folder, move some vue filters 2019-11-25 20:12:58 +02:00
Raqbit 95cc9a47fb Add file size to link preview 2019-11-07 16:58:28 +01:00
Pavel Djundik 5a94727d79 Bump minimum node version to v10 2019-09-04 22:50:25 +03:00
Alistair McKinlay 133e7bf710 Format js/vue with prettier 2019-07-19 11:27:40 +01:00
Pavel Djundik 54a4085b68 Store ip and language in a separate object in user file 2019-07-16 13:00:29 +03:00
Pavel Djundik cdcd7df425
Remove bogus prefetch limit 2019-05-25 15:40:55 +03:00
Pavel Djundik fe68f2a1ee Replace request with got 2019-05-13 10:30:43 +03:00
Pavel Djundik 595915fefd Render link previews in Vue 2019-02-12 12:48:42 +02:00
Alexandre Oliveira 619b054b95 Add X-Purpose header to link prefetcher 2018-08-07 21:10:03 -03:00
Pavel Djundik 0d48c596c8 Fix multiple <title> tags being concatenated 2018-06-11 11:32:32 +03:00
Pavel Djundik 4e2523060b De-duplicate link fetching to one request at once 2018-06-11 10:38:03 +03:00
Pavel Djundik a663993d0b If a preview fails to load, remove the link from msg object
Fixes #2438
2018-06-03 12:25:01 +03:00
Pavel Djundik d4fa6bbcb0 Use WHATWG URL parser in link prefetcher 2018-05-23 16:31:02 +03:00
Pavel Djundik 629ae8bfa4 Fix protocol-aware urls, add better link validation in previews 2018-05-23 16:31:02 +03:00
Pavel Djundik 1ddc617b79 Fix lint issue 2018-03-24 22:53:02 +02:00
Pavel Djundik ca96d09a23 Send Accept header
Closes #2277
2018-03-23 20:17:03 +02:00
Jérémie Astori 00bca229f0
Enforce object literal shorthand syntax with ESLint 2018-03-15 00:22:09 -04:00
Pavel Djundik 351a203acd Fix some URLs not being sent as-is to the client 2018-03-13 22:08:19 +02:00
Pavel Djundik f475cc39ef Normalize unicode URLs in link prefetcher
Fixes #1644
2018-03-08 19:43:39 +02:00
Pavel Djundik 58d9490c2a Try to find og:video and og:audio on html pages 2018-03-07 12:53:56 +02:00
Pavel Djundik 6c6168e80a
Merge pull request #2164 from thelounge/xpaw/remove-maxlisteners
Remove setMaxListeners
2018-03-07 09:19:04 +02:00
Pavel Djundik 6fa48d3acf Remove setMaxListeners
Reverts 2cee0ea6ef as this no longer causes the EventEmitter warning due to `maxRedirects` being set to 5 on our end.

Ref: https://github.com/request/request/issues/311#issuecomment-153507416
2018-03-07 09:13:06 +02:00
Pavel Djundik 827310a645 Apply ECDH curve fix only on affected version
Fixes #2162
2018-03-07 08:44:22 +02:00
Pavel Djundik 501730f2ca Fix default ecdh curve for better compatibility 2018-03-06 15:11:42 +02:00
Pavel Djundik 59ec07be87
Update all links to thelounge repository 2018-02-21 22:47:52 -05:00
William Boman acb6179b30 relay client's preferred language in link preview requests
Closes #1440.
2018-02-21 10:35:33 +01:00
Pavel Djundik 37c61e2413 Report server errors when preview fetch fails 2018-02-20 11:33:42 +02:00
Pavel Djundik c733e72e7a Auto-fix code for padding-line-between-statements rule 2018-02-20 09:28:04 +02:00
Pavel Djundik a3e448acf5 Enable no-var rule
Fixes #1961
2018-02-19 19:49:39 +02:00
Jérémie Astori 91e3ca88bb
UI for "Image too large" errors 2018-02-01 21:14:37 -05:00
Al McKinlay 335bd803af
Show error if image is greater than max prefetch size 2018-02-01 21:09:45 -05:00
Pavel Djundik 6675ced196 Store images with correct file extension 2018-01-03 13:33:52 +02:00
Max Leiter d4ad60c11d Support video file previews 2017-12-13 17:52:07 -08:00
Max Leiter ad1114ccfe Support audio file previews 2017-12-12 11:29:13 -08:00
Jérémie Astori b53f1719eb
Merge pull request #1749 from thelounge/astorije/avoid-escape-quotes
Avoid escaping quotes whenever possible
2017-11-27 12:57:55 -05:00
Pavel Djundik 4e45820235
Detect image/webp as an image 2017-11-27 15:50:35 +02:00
Jérémie Astori 287c3a8223
Avoid escaping quotes whenever possible
Our `.eslintrc.yml` configuration file already allows for avoiding escape (see [ESLint doc for `avoidEscape`](https://eslint.org/docs/rules/quotes#avoidescape)) so we might as well use it. We already use this in a few places I believe.
2017-11-26 17:34:28 -05:00
Pavel Djundik 727021be68 Call callback on fetch error 2017-11-25 20:59:12 +02:00