Commit graph

1294 commits

Author SHA1 Message Date
Reto Brunner 1e896a9672 plugins: prefix logger with the plugin name 2021-10-13 23:39:32 +02:00
William Boman 2693db4274
client/Mentions: change button copy to "Dismiss all" (#4322)
* client/Mentions: change button copy to "Dismiss all"

* s/hide/dismiss/g
2021-10-12 15:56:39 -07:00
Reto Brunner 02ccbc1f69 plugins: expose persistant data dir
Plugins need to be able to store persistant files, say settings or
databases or similar things.
Expose a standard location that gets created when the path is
accessed.
2021-10-12 23:24:06 +02:00
Reto Brunner bb4ab4f168 plugins: add Logger interface
Plugins need to be able to log messasages, say for errors.
2021-10-12 23:24:06 +02:00
Max Leiter beb5530c65
Revert "Support animated webp images" (#4287)
This reverts pull/4186.
2021-08-31 12:27:43 -07:00
Reto 8fcd079204
Properly track user modes for context menu (#4267)
* properly track user modes for context menu

The RPL_ISUPPORT response contains a PREFIX element, which not only tracks the
prefix chars ("@", "+" etc) but also their corresponding mode chars (+O, +v)
This commit changes the context menu to not rely on a hardcoded list but rather
user the one given in the prefix response by the server.

Co-authored-by: Max Leiter <maxwell.leiter@gmail.com>
2021-07-21 00:30:07 -07:00
Max Leiter 03d38812e3
Merge pull request #4275 from hellomouse/isupport-modes
Optimise modes based on ISUPPORT
2021-07-06 17:09:31 -07:00
JeDaYoshi d96704835a
Send all modes in case of no ISUPPORT 2021-07-06 15:48:01 +00:00
Max Leiter 75cf4445c4
Merge pull request #4277 from hellomouse/server-privmsg-fix
Fix nick-less messages from servers
2021-07-06 01:02:18 -07:00
JeDaYoshi bbda392c3d
Move clientCommands to client
This approach automatically imports the command names.
2021-07-04 02:15:33 +00:00
JeDaYoshi 69c37a535b
Only add /search when there's a message provider 2021-07-04 00:31:43 +00:00
JeDaYoshi e0e12c1960
Fix tests for mode shorthand commands 2021-07-03 21:20:28 +00:00
JeDaYoshi 16177eb9f4
Move server nick code to handleMessage 2021-07-03 21:06:16 +00:00
JeDaYoshi 6439afd5c6
Fix nick-less PRIVMSGs from servers 2021-07-03 15:27:08 +00:00
JeDaYoshi 4dacaa46f3
Optimise modes based on ISUPPORT
This will see the maximum allowed of modes that are allowed at once as sent in RPL_ISUPPORT
and will send multiple batches while using /op, /voice, etc.

This also fixes a minor issue where it would try sending an empty voice if it had an extra space on arguments
(such as using '/voice  ')
2021-07-03 03:50:22 +00:00
JeDaYoshi 426841e6b7
Add /umode support 2021-07-03 02:28:21 +00:00
Max Leiter d106889127
Merge branch 'master' into feature/socks-support 2021-06-29 22:48:00 -07:00
Bradley Shaw a2d23810bf
Differentiate WALLOPS from NOTICE 2021-06-22 11:50:22 +01:00
Max Leiter aa310fe877
Merge pull request #4260 from BradleyShaw/snotice-channel
Display server-originated notices to channels in the channel window
2021-06-22 00:30:42 -07:00
Max Leiter 6b852d14c8
Fix not overriding config options with -c 2021-06-22 00:00:41 -07:00
Bradley Shaw 38c0c343c3
Send server->channel notices to the relevant channel 2021-06-19 19:49:04 +01:00
Reto Brunner c5fcc5d72f install: allow installation of local packages
It may not be desirable to host all plugins on npm, allow for local packages to
be installed given a package name with a `file:` prefix.

This is still more restrictive than what yarn would support but allows us to still
verify the thelounge compatibility by reading the package.json file.

`yarn add` messes up with local filepaths and generates a lockfile that is
"outdated" as far as any other yarn commands go, which makes them error out.

For some reason `yarn install` fixes that and hence we run that after an install.
Here's the diff of yarn.lock between the broken state after `yarn add file:$path`
and `yarn install`
	--- yarn.lock.2.afterAdd	2021-06-02 00:10:52.365134018 +0200
	+++ yarn.lock.3.afterinstall	2021-06-02 00:13:27.122760442 +0200
	@@ -2194,7 +2194,7 @@
	     safe-buffer "^5.1.2"
	     yallist "^3.0.3"

	-thelounge-plugin-shortcuts@/home/reto/sourcecode/thelounge-plugin-shortcuts:
	+"thelounge-plugin-shortcuts@file:../../sourcecode/thelounge-plugin-shortcuts":
	   version "1.0.12"
	   dependencies:
	     thelounge "4.2.0"

The only thing it does is switch an absolute path to a relative one for whatever
reason.
2021-06-05 13:01:55 +02:00
Max Leiter 58217cffb1
Merge pull request #4219 from TheDecryptor/jpegxl_support
Add support for JPEG XL image previews
2021-05-25 21:36:37 -07:00
Max Leiter fc6c916e7c
Merge pull request #4213 from Nachtalb/na/search-command
Add new "/search query" command to open the search window
2021-05-25 21:31:17 -07:00
Mary Strodl df5befb60e
Merge remote-tracking branch 'origin/master' into feature/socks-support 2021-05-19 19:01:42 -04:00
Alex Jones dbf6ff064b Add support for JPEG XL mimetype 2021-05-08 18:10:45 +10:00
Nachtalb 24a738d521
Add new command to open the search window 2021-05-06 03:22:09 +02:00
Mary Strodl abcad094d1
network: add support for SOCKS (closes #1375) 2021-05-05 20:06:00 -04:00
Nachtalb 0bfcd955e3
Improve inline audio file support
Tested on latest Chromium / Firefox. In case of .m4a files they want audio/x-m4a and not audio/m4a, in case of .flac files they want audio/flac and not audio/x-flac. The module we useed to detect the types however detects them only as audio/x-m4a and audio/x-flac as they are not offical IANA supported mime types (not in IANA spec == "x-" prefix): https://www.iana.org/assignments/media-types/media-types.xhtml Though flac is not in the IANA spec many programs such as the file command (https://man7.org/linux/man-pages/man1/file.1.html) and Chromium (flac) / Firefox (x-flac and flac) support audio/flac only or both.
2021-05-06 02:02:23 +02:00
Max Leiter 26a38b12ab
Merge pull request #4197 from Nachtalb/richrd/message-search
Message Search: Re-Rebase + Fixes / Adjustments
2021-05-03 16:18:15 -07:00
Nachtalb e010fe47cc
Respect metadata removal switch 2021-04-13 20:45:16 +02:00
Nachtalb 89390b3fc5
Ensure proper error handling when processing of file fails 2021-04-13 20:41:30 +02:00
Nachtalb c2c66031c0
Auto rotate images based on exif orientation
This makes sure that the orientation of the images work in all viewrs.
2021-04-13 18:24:33 +02:00
Nachtalb 846da41b01
Rename uploadCanvas to a more appropriate removeImageMetadata
Including backwards compatibility
2021-04-13 18:24:33 +02:00
Nachtalb 3a6ac4e5ec
Support animated webp images
We need to remove the metadata without breaking the animation.
For that we use sharp which incooperates libvips (binaries for most common distros included).

This also decreases client side upload complexity as we remove the metadata on the serverside.

Sharp: https://sharp.pixelplumbing.com/
libvips: https://libvips.github.io/libvips/
2021-04-13 18:24:32 +02:00
Nachtalb d6a23061fc
Remove searchNicks for the time being
We should not have search implementation without a specced filter /
facet setup.
2021-04-12 23:23:04 +02:00
Nachtalb de86c144b5
Disable search if we have no message provider
If we have no message provider:
- Search input field not renderd
- Search endpoint retuns empty resultset

Also removed redundancy by setting a main message provider.
2021-04-12 23:12:11 +02:00
Mary Strodl 283ef445e5
Merge remote-tracking branch 'origin/master' into richrd/message-search 2021-04-12 22:00:49 +02:00
Nachtalb 3a42b5385e
Support inline flac audio 2021-04-11 15:43:42 +02:00
Nachtalb 14d76f8023
Add proper filename to the content-disposition header
By default we take the slug given in the request, if this is not set we try to give a filename from known types.
If we still have no filename we fallback to the previous method of setting no filename.

If the filename is non ascii we will only create the encoded "filename*" and not the ascii only "filename". This is to prevent other applications to save a file like "?????.png" if the filename contains non ascii chars.

For the browsers nothing will really change comapred to the behaviour before this change as good fallbacks if no content-disposition filename is set. But that is not the case for all application, thus it makes sense to include the proper way to set the filename.
2021-04-11 15:41:21 +02:00
Max Leiter 5329483a40
Merge pull request #4135 from brunnre8/master
Add prefetchMaxSearchSize to override limit for link previews
2021-03-16 18:18:31 -07:00
Max Leiter afe136fee8
Merge pull request #4171 from emilyst/patch-1
Configure server ping timeout to 60 seconds
2021-03-02 13:10:03 -08:00
Emily Strickland c782ca5b93
Configure server ping timeout to 60 seconds
The default socket.io server-side ping timeout was changed from 60 seconds to 5 seconds. In browsers based on Chrome, this is not enough time to respond when the browser is idle. The end result is that the server sets the user away and then back approximately once every minute if the client window is idle, which is undesirable.

This change restores the previous timeout value.

See https://github.com/socketio/socket.io/issues/3259#issuecomment-474523271.
2021-02-28 18:53:36 -08:00
Pavel Djundik e6fc726c91 Upgrade to socket.io v3 2021-02-28 15:30:44 -08:00
Reto Brunner 7c17662fea Add prefetchMaxSearchSize to override limit for link previews
YouTube puts the opengraph tags needed for the preview after ~300KB in the body
instead of the beginning of the <head> tag.
Instead of hardcoding the value, allow the server admin to set the policy as
they prefer.
2021-02-27 00:10:53 +01:00
Nachtalb 03377c6ced
Also use the networks specific leave message on quit 2020-12-18 10:53:40 +01:00
Nachtalb 877e4acf7d
Add network specific leave message 2020-12-18 10:53:37 +01:00
Yorick Bosman 651a7ac2e9 Add extended join information to join message. 2020-11-19 00:25:28 +01:00
Pavel Djundik a76e75f609 Do not generate and send client certificate unless SASL EXTERNAL is requested
Fixes #4092
2020-10-30 23:03:57 +02:00
Pavel Djundik a9fb563c01 Update mini-css-extract-plugin 2020-10-11 11:06:52 +03:00
Taavi Väänänen e790a72e59 Make add and reset CLI commands scriptable
Add CLI options `--password` and `--save-logs` (for `add` only) in
order to make adding users and changing user passwords scriptable.

Closes #3913
2020-10-07 09:00:00 +03:00
Pavel Djundik 3fde2aa7b9 Always use multi-prefix modes
Fixes #323
2020-09-01 11:45:08 +03:00
Pavel Djundik ac842108f3
Merge pull request #4047 from thelounge/xpaw/avif
Detect `image/avif` as an image
2020-08-24 11:54:14 +03:00
Pavel Djundik df115333ba
Merge pull request #4041 from thelounge/mcinkay/2333/version-compatibility
Add version support for packages.
2020-08-23 20:46:44 +03:00
Pavel Djundik c89dcca449 Detect image/avif as an image 2020-08-23 12:51:52 +03:00
Al McKinlay 86e570efb2 Add version support for packages. 2020-08-21 15:03:12 +01:00
Pavel Djundik 1e38262d69 Add missing return 2020-08-21 10:18:41 +03:00
Pavel Djundik 9e13694b21 Skip video/audio embeds if og:type exists but does not specify it 2020-08-21 10:16:54 +03:00
Jay2k1 b97b145df1 add highlight exceptions 2020-08-19 00:00:56 +02:00
Pavel Djundik 67e4a4bbb2 Sync changed network name to open clients 2020-08-17 12:57:37 +03:00
Pavel Djundik 5861ffadf2 Increase unread counter for HELP and INFO messages 2020-08-14 14:26:03 +03:00
Pavel Djundik 8bf55527ed Use lodash where possible 2020-08-07 19:52:50 +03:00
Pavel Djundik 8c6460b58a Disable link prefetching for urls with no schema specified 2020-08-04 20:21:12 +03:00
Pavel Djundik 40954c9a3a Fix mode message only making last nick clickable 2020-07-29 10:29:51 +03:00
Pavel Djundik ec65fd17af
Merge pull request #3983 from SRCF/audio
Add option to disable media preview.
2020-07-27 11:04:06 +03:00
Pavel Djundik 5a1963647e
Merge pull request #3962 from thelounge/xpaw/help-info-blocks
Implement generic monospace blocks for INFO and HELP numerics
2020-07-27 11:02:14 +03:00
Pavel Djundik a8a2bd7755
Merge pull request #3986 from thelounge/xpaw/upload-keepalive
Fix upload tokens expiring while uploading when TL is proxied
2020-07-27 11:01:44 +03:00
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 63a420ac21 Implement generic monospace blocks for INFO and MOTD numerics
Fixes #3961
2020-07-20 10:07:49 +03:00
Pavel Djundik 531ea920e0 Improvements to mentions window
- Add hide all button
- Only show overflow scroll when necessary
- Fix key in v-for loop
- Increase window height if browser size allows for it
2020-07-19 17:29:52 +03:00
Pavel Djundik b1115475bf Fix upload tokens expiring while uploading
Fixes #3982
2020-07-15 12:29:02 +03:00
Pavel Djundik 4becb152bb Changes for irc-framework update 2020-07-13 10:25:54 +03:00
Pavel Djundik c21ccad823 Allow changing network name in private mode with lockNetwork 2020-07-08 15:42:34 +03:00
Pavel Djundik b6bd869d5f
Merge pull request #3918 from ashwinikammar/ashwini/fix_username
Make usernames case-insensitive when logging in
2020-07-08 11:26:58 +03:00
Ashwini Kammar 9e8033e36e Fixing thelounge username case-sensitivity - issue#2943
Removing the duplicate user profiles
2020-06-23 13:01:06 +01:00
Pavel Djundik 72b7906949 Merge branch 'renovate/mocha-8.x' 2020-06-14 12:34:07 +03:00
Pavel Djundik d29f2fb251 Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized" 2020-06-14 12:32:08 +03:00
Richard Lewis f3236538a0 Fix searching channels with uppercase letters in name. 2020-06-03 14:17:53 +03:00
Richard Lewis b4d02c3c56 Fix context menus in search results. 2020-06-03 14:04:57 +03:00
Pavel Djundik dbc829b5f8 Reply to the server if that's where CTCP VERSION originated 2020-05-11 21:55:30 +03:00
Pavel Djundik 24d4276a7c Fix msg id order when loading from sqlite 2020-04-28 17:45:27 +03:00
Richard Lewis 9a1fb0c0a0 Search improvements. 2020-04-26 22:39:05 +03:00
Richard Lewis 2591ae9e8e Disable searching nicks. 2020-04-26 22:39:05 +03:00
Richard Lewis 0f3c292098 Message search WIP. 2020-04-26 22:39:05 +03:00
Pavel Djundik 96a983b310
Merge pull request #3875 from thelounge/xpaw/statusmsg-ui
Add an indicator to statusmsg messages
2020-04-24 14:07:48 +03:00
Pavel Djundik 53bd9c2f68
Merge pull request #3868 from thelounge/xpaw/mentions-fixes
Some fixes in mentions window
2020-04-24 14:07:40 +03:00
Pavel Djundik ad6569cf06 Add an indicator to statusmsg messages 2020-04-24 11:46:39 +03:00
Pavel Djundik 4ac25d4bc5
Merge pull request #3871 from ebardie/ebardie/dont_load_extinct_users
Filter user loading at startup for "advanced" LDAP
2020-04-24 10:21:42 +03:00
Jonathan Sambrook 878ac0d192 Filter user loading at startup for "advanced" LDAP
Users are loaded at startup. Currently when using "advanced" LDAP
authentication this is true even if they no longer have a
valid entry in the LDAP server.

This commit uses the existing LDAP filter (specified in config.js's searchDN
used by the "advanced" LDAP mechanism) to weed out any users that no
longer have the relevant LDAP entry.

Local and "simple" LDAP auth mechanisms continue to use the existing
load all users approach. In the "simple" LDAP case this is because we
only have access to the hashed password, and so can't bind to LDAP.
2020-04-23 15:54:09 +01:00
Jonathan Sambrook a0d10989ad Tidy up the auth plugin API mechanism to hide implementation details
The caller doesn't care which plugin is being used, so this commit
consolidates implementation details within auth.js

The motivation for this work is to prepare for extending the auth API
(to allow "advanced" LDAP to query user entry ontological state at start
up), by tidying up rather than duplicating the existing mechanism.
2020-04-23 15:11:35 +01:00
Pavel Djundik 2b0afcacf2 Safeguard nick randomizer up to allowed length 2020-04-22 15:18:55 +03:00
Pavel Djundik bcd2e7cb08 Some fixes in mentions window 2020-04-20 13:40:45 +03:00
Pavel Djundik 6ee71779d1 Combine displayNetwork into lockNetwork 2020-04-15 10:56:05 +03:00
Pavel Djundik 8a281bacd8 Preliminary SASL UI 2020-04-15 10:56:04 +03:00
Pavel Djundik f8f692af05 Generate client certificates and automatically do SASL EXTERNAL 2020-04-15 10:56:04 +03:00
Pavel Djundik 3900e9dd81 Consolidate irc-framework options 2020-04-15 10:56:03 +03:00
Pavel Djundik 1754c77517
Merge pull request #3857 from thelounge/xpaw/optimize-userlist-updates
Optimize user list updates for quit/part/kick events
2020-04-13 11:39:57 +03:00
Pavel Djundik bc4f9b5f51 Track mentions and add a window to view them 2020-04-11 12:49:42 +03:00
Pavel Djundik 487a438f02 Replace all uses of fs-extra with native methods 2020-03-22 20:42:16 +02:00
Pavel Djundik 4bf4b7baf0
Merge pull request #3797 from thelounge/xpaw/fix-changelog-check
Pass in client manager object in update checker
2020-03-22 20:41:39 +02:00