Commit graph

718 commits

Author SHA1 Message Date
Jérémie Astori 432023fc7e
Make sure existing packages (and themes) are not deleted when installing a new one on Node.js v8
- When installing a package on Node v8 (or whatever npm version ships with it - v5), all packages not listed in `package.json` are removed. Since we explicitly added `--no-save`, installing a theme would delete the previous one. I am now checking that the file already exists or not. This means that it will still happen to people the next time they run `thelounge install`, because the previous install did not save into `package.json` :/
- Adding `--save` to make sure that the same, correct behavior is done on Node v6 as well (npm v3)
- Adding `--save-exact` for good measure.
2018-01-16 20:25:35 -05:00
Jérémie Astori 42199eda29
Merge pull request #1978 from merlinthp/chpass_callback
Add missing execution of callback in ClientManager.updateUser
2018-01-13 18:47:01 -05:00
Howard Johnson 10d43f27ed Add missing executions of callback in ClientManager.updateUser
Signed-off-by: Howard Johnson <merlin@merlinthp.org>
2018-01-13 23:05:23 +00:00
Pavel Djundik 1aaa9391db
Merge pull request #1970 from thelounge/astorije/fix-themes
Fix local themes not being found in theme selector dropdown, and serve local themes using the themes route instead of the public folder
2018-01-13 23:09:55 +02:00
Jérémie Astori c49239b4f1
Fix themes not being found in theme selector dropdown 2018-01-13 13:45:30 -05:00
Jérémie Astori f8c66aa512
Merge pull request #1975 from thelounge/xpaw/fix-1902
Fix enabling push notifications on Firefox
2018-01-13 13:14:33 -05:00
Jérémie Astori 45dc52886e
Fix thelounge uninstall command
- Exit with code 1 when package was not installed
- Run a pre-step to check if package is installed before uninstalling. I have tried every possible way I could think of without that first `npm list` step based on output of `npm uninstall`, but different npm versions produce different outputs, so there is nothing reliable. This is a more robust way to do so anyway.
- Consolidate error handlers
2018-01-13 02:00:37 -05:00
Pavel Djundik 8d0bdfc200 Fix #1902 - unable to enable push notifications on Firefox 57 2018-01-12 12:04:04 +02:00
Pavel Djundik 98c3108bde
Merge pull request #1940 from thelounge/xpaw/fix-1934
Hash user tokens, increase token entropy
2018-01-11 13:34:14 +02:00
Jérémie Astori 40aadf7c95
Merge pull request #1619 from thelounge/1447-css-plugin
Allow custom css from plugins
2018-01-10 21:44:47 -05:00
Pavel Djundik eac092e661 Hash user tokens, increase token entropy
Fixes #1934
2018-01-10 15:54:52 +02:00
Jérémie Astori b3702b0550
Merge pull request #1938 from thelounge/astorije/uninstall-packages
Add a `thelounge uninstall` command to remove themes and packages
2018-01-09 00:51:27 -05:00
Pavel Djundik fc39a67e10 Only emit "more" history to the client that requested it 2018-01-07 15:06:59 +02:00
Jérémie Astori d2388dc623
Bail when uninstalling if package.json for TL packages does not exist
It is on purpose that the message is the same than when a package was not installed. From a user standpoint, it only matters that this specific package was not installed.
2018-01-06 12:12:10 -05:00
Jérémie Astori 3971ecff63
Customize a bit thelounge install|uninstall
- Hides progress bars that flash when installing/uninstalling as it does not bring real value here, at least for now
- Inform user if package being uninstalled was not actually installed
- Do not display npm outputs, mention which version was installed (this will probably need refining when installing packages with dependencies)
2018-01-06 12:12:10 -05:00
Jérémie Astori d9cb640c2a
Add a thelounge uninstall command to remove themes and packages 2018-01-06 12:12:09 -05:00
Al McKinlay 3510094665 Allow custom css from plugins 2018-01-05 17:40:47 +00:00
Pavel Djundik 4307bb0563
Fix nicknames in text logs 2018-01-05 15:41:03 +02:00
Pavel Djundik 6675ced196 Store images with correct file extension 2018-01-03 13:33:52 +02:00
Jérémie Astori 835236f8ac
Merge pull request #1901 from thelounge/xpaw/fix-nicks-match
Do not match nicknames incorrectly as part of a bigger word
2017-12-27 14:32:59 -05:00
Jérémie Astori dab4fc44ea
Make sure data URIs are allowed by CSP not to block video controls 2017-12-27 13:56:38 -05:00
Pavel Djundik 349136f172 Do not match nicknames incorrectly as part of a bigger word
Fixes #1776
Fixes #1885
2017-12-27 20:44:59 +02:00
Jérémie Astori 238e894377
Improve the version checking part of the changelog feature
- There is no client caching of the changelog/version anymore. Instead, server returns the expiration date of its cache, and that is used by the client as well.
- There is now a "Check now" button on the client that appears when data is stale. This means that info is fetched only once and never refreshed (it was refreshed every hour before) unless the user explicitly wants to check latest version, which in turn is as stale as server info is, i.e. 15 minutes max.
- Button style is shared with the "Join a channel" feature, `.btn-small` (not `.btn-sm` to be explicit that this is not a Bootstrap thing).
- Version checker content is now centralized in the `version_checker` template, instead of being partially in the checker template, partially in the Help template,  and partially in the code.
- A "Try again" button lets user attempt to fetch info instead of forcing them to reload the page.
- Use Flexbox to display a nicer version checker: icon is slightly bigger, and button is always aligned on the right.
- Changelog logic has been removed from `lounge.js` and moved into the component file.
- Changelog template is only passed what it needs instead of everything the server gives us.
- Public version now displays version checker, since server is caching things.
- Cleaner code overall.
2017-12-25 17:44:53 -05:00
Jérémie Astori 32a95c4d75
Merge pull request #1327 from thelounge/xpaw/view-changelog
Changelog viewer and updater checker in the client
2017-12-23 16:13:29 -05:00
Jérémie Astori 57c24704af
Cache changelog information on the server for 15 minutes 2017-12-23 13:37:33 -05:00
Pavel Djundik 6377e0de66 Fix #1883: message gaps when reconnecting 2017-12-23 11:36:52 +02:00
Jérémie Astori 9691df67e3
Improve UI of the About section and changelog viewer
- Keep consistent width between the Help page and Changelog (which is already different from other windows 😠)
- Add icons to the About links
- Make sure `li` elements (i.e. all the lists in changelogs) are consistent in size with rest of the client
- Display version and release notes link on the "About The Lounge" header line, smaller, pushed to the right
- Check new releases when opening the Help window in order to display it without having to open the release notes. Release notes are being fed to the Changelog page at that moment to avoid fetching twice.
- Re-check version/fetch release notes after 24h. Since The Lounge can now run 24/7, reconnect when losing the network, we have to assume an "always-on" usage.
- Change icon, animate background color when getting response from GitHub to avoid flashing.
- Combine click handlers with our wonderful window management. These were the same handler, even with similar checks (`target` exists, etc.), just in 2 different places. This is necessary for the next item.
- Combine "Open release notes" and "Go back to Help" button behaviors with window management handlers. The window management code is gross as ever, and is in desperate need of a refactor, but at least there is no duplicated code for the same behavior + history management. This fixes the "Next" history behavior (however reloading the app while viewing the notes does not load on the notes, but this is a bug for a different PR!).
- Added a rule in the history management thingy: if a link we want to add history handling to has an `id`, store that in the state
- Added a button to go back to the Help window
- Fixed links to releases
- Send user to the GitHub issues *list* instead of *new issue form* because if they do not have a GitHub account, they will be redirected to the login page, which is a rather unpleasant experience when you are already confused...
- Fixed a bug that would return data about a new release in `latest` even though it is already the `current`. It was showing the current version as "The Lounge v... is now available".
- Added https://user-images.githubusercontent.com to the CSP rule when prefetch storage is enabled, because that is where we have stored screenshots in the changelog so far. Meh (we can improve that later if we decide to have a dedicated place for screenshots).
- Fetch changelog info even in public mode because users in public mode can access the release notes. They do not see the result of the version checker however.
2017-12-22 22:46:11 -05:00
Pavel Djundik df858a5aaf
Add changelog viewing and update checking 2017-12-22 16:26:12 -05:00
Pavel Djundik dc8c10f461 Correctly fix from field in messages
This should have been in #1859
2017-12-20 13:45:17 +02:00
Pavel Djundik ce5d18c4fa Fix possible issues with from in messages 2017-12-19 13:45:33 +02:00
Pavel Djundik c06fb9a275 Clear storage folder after successful start and graceful exit 2017-12-18 16:59:05 +02:00
Max Leiter d4ad60c11d Support video file previews 2017-12-13 17:52:07 -08:00
Pavel Djundik ccd37aba8f
Merge pull request #1725 from keegan/master
Stop LDAP Auth from succeeding without password
2017-12-13 20:20:10 +02:00
Pavel Djundik 7dcab09516
Merge pull request #1806 from MaxLeiter/sound
Support audio file previews
2017-12-13 11:03:04 +02:00
Max Leiter ad1114ccfe Support audio file previews 2017-12-12 11:29:13 -08:00
Jérémie Astori d89112173d
Fix command line index parsing options (--home and --config) twice 2017-12-11 23:53:51 -05:00
Jérémie Astori 6547d18e7f
Color all references to deprecations in bold red 2017-12-11 23:48:52 -05:00
Jérémie Astori 07a01b0547
Deprecate existing options of thelounge start in favor or -c, --config 2017-12-11 23:48:52 -05:00
Jérémie Astori df2787d3e9
Add a --config / -c option to the start CLI command to arbitrarily override any configuration key
The biggest caveat is that JS code (such as functions) will not be interpreted as such, on purpose, for security precautions. If such thing is needed, then a configuration file must be used.
2017-12-11 23:48:52 -05:00
Jérémie Astori b90c224a99
Define a raw logger to avoid using console.log, use it in extra help for environment variables, and add a test for this
This has multiple benefits:

- Respects the "Do not mock what you do not own" principle, instead we mock `log.raw` when necessary
- Lets us not re-assign `console.log`, which breaks as Mocha uses `console.log` as well
- Save and restore initial `log.raw` in test hooks (before/after), otherwise this would break Mocha/Chai
2017-12-11 23:48:51 -05:00
Erik Vosseberg 33d865501d
Add whois and conversation as action to user contextmenu
Add Op specific actions to contextMenu

Show context menu when left clicking user

Switch to using data attributes as selectors

remove ban as possible action

Move `isOpInChannel()` to utils.js

Capitalize strings

use CSS.escape for `ownNick`

use string interpolation

properly point to findCurrentNetworkChan

Move context menu item actions to command pattern

add icons for context menu actions

Make list in context menu always list.

remove empty lines in style.css

use info circle instead of question circle

change context menu labels.

change contextMenuActions.execute to more explicit method.
2017-12-11 23:04:29 -05:00
Jérémie Astori c0869b05a3
Merge pull request #1807 from thelounge/astorije/users-commands
Do not load user commands or display them on `--help` if public mode or using LDAP
2017-12-10 14:24:55 -05:00
Jérémie Astori 206ded55ff
Warn if user configuration being loaded is empty 2017-12-10 01:03:00 -05:00
Jérémie Astori c21aee3d4a
Do not load user commands or display them on --help if public mode or using LDAP 2017-12-09 01:51:08 -05:00
Jérémie Astori c038935b96
Move user commands to their own subfolder 2017-12-09 01:38:52 -05:00
Jérémie Astori 844ca1fbe6
Merge pull request #1811 from thelounge/astorije/improve-helper
Clean up path helpers, expand defaults location in `thelounge --help`, add tests for `expandHome`
2017-12-08 21:53:14 -05:00
Jérémie Astori 22237658cb
Add some unit tests for Helper.expandHome 2017-12-08 19:50:32 -05:00
Jérémie Astori 52d5cb2311
Expand home shorthand in CLI help around THELOUNGE_HOME environment variable 2017-12-07 23:03:40 -05:00
Jérémie Astori 0482747781
Only use helpers and not shared variables around path helpers
This refactor has a few benefits, for example there cannot be a rogue update of `Helper.CONFIG_PATH` or something.
2017-12-07 23:02:32 -05:00
Pavel Djundik fb0f68f8a5 Harden content security policy even further 2017-12-07 20:45:45 +02:00