quassel.git
7 years agoKeep old clients from removing message rate delay
Shane Synan [Thu, 22 Sep 2016 01:24:48 +0000 (20:24 -0500)]
Keep old clients from removing message rate delay

Add a guard against zero message delay in setMessageRateDelay,
following the error-checking of setMessageRateBurstSize.  This blocks
old clients from setting message rate delay to 0 seconds for newly-
created networks, improperly overriding the default of 2.2 seconds.

This affects creating a network in an old client, switching to a new
client, then enabling custom rate-limits.

The supported method for removing rate limits by setting Unlimited to
true still works.

Resolves GH-252.

7 years agoDefault to sqlite backend in core creation wizard
Ben Rosser [Mon, 19 Sep 2016 04:41:21 +0000 (00:41 -0400)]
Default to sqlite backend in core creation wizard

This introduces the notion of a "default" storage backend into
the core by adding a function (Core::isStorageBackendDefault),
which returns true if a given Storage object is 'default' and
false if not. This information is then added to the BackendInfo
dictionary passed through the protocol to the user interface,
which ensures the backend that is default will always be the
one displayed by default.

This change was prompted by conversation in IRC with [Saint]
and @digitalcircuit about making core creation slightly more
intuitive.

This allows us to, potentially, change the default storage
backend shown at core creation time should at some point
another backend be introduced, without having to modify
the interface.

It is a little weird having "isDefault" be an attribute of
*each* storage backend, but this was the simplest way to do
it without modifying the handshake. (Whichever is the last
storage backend to claim to be the default will win).

(As an aside, should this be merged and should #170 be merged
I'll implement something similar for authenticators in a
separate PR).

Resolves GH-250.

7 years agodcc: Add settings page for DCC configuration dcc
Manuel Nickschas [Sat, 8 Oct 2016 15:06:13 +0000 (17:06 +0200)]
dcc: Add settings page for DCC configuration

7 years agodcc: Add persistent settings for core-side DCC
Manuel Nickschas [Fri, 7 Oct 2016 22:40:46 +0000 (00:40 +0200)]
dcc: Add persistent settings for core-side DCC

This introduces a new syncable object DccConfig that holds core-side
DCC settings, such as the network configuration. The configuration
is persisted as a per-user setting in the database.

The CoreSession's DccConfig instance is synced to connected clients
and accessible via the Client singleton.

7 years agodcc: Clean up TransferManager a bit
Manuel Nickschas [Fri, 7 Oct 2016 22:30:03 +0000 (00:30 +0200)]
dcc: Clean up TransferManager a bit

7 years agocommon: Work around SFINAE issues in MSVC
Manuel Nickschas [Thu, 6 Oct 2016 17:42:38 +0000 (19:42 +0200)]
common: Work around SFINAE issues in MSVC

MSVC 2015 still has... issues with SFINAE, so the usual way to use
std::enable_if doesn't compile. So let's try and SFINAE this in a
different way until MS fixes their compiler.

7 years agodcc: Name TransferManager object for syncing
Manuel Nickschas [Wed, 5 Oct 2016 17:29:19 +0000 (19:29 +0200)]
dcc: Name TransferManager object for syncing

This magically fixes older clients who try to sync an unnamed
TransferManager with unknown data types.

7 years agocommon: Remove unused Exception type
Manuel Nickschas [Tue, 4 Oct 2016 21:01:40 +0000 (23:01 +0200)]
common: Remove unused Exception type

Also fix a typo in docs.

7 years agocommon: Add generic stream operators for enum types
Manuel Nickschas [Tue, 4 Oct 2016 20:53:01 +0000 (22:53 +0200)]
common: Add generic stream operators for enum types

These operators use the underlying type of a given enum to
(de)serialize to and from QDataStream.

7 years agodcc: Retrieve transfer list on TransferManager change
Manuel Nickschas [Mon, 3 Oct 2016 23:25:18 +0000 (01:25 +0200)]
dcc: Retrieve transfer list on TransferManager change

If TransferModel is given a new manager, it should retrieve the
list of transfers just in case (even though, in practice, the manager
should not hold any transfers right after sync).

7 years agodcc: Always clean up if a transfer completed or failed
Manuel Nickschas [Thu, 29 Sep 2016 19:23:03 +0000 (21:23 +0200)]
dcc: Always clean up if a transfer completed or failed

7 years agodcc: Properly sync TransferManager
Manuel Nickschas [Wed, 28 Sep 2016 21:04:17 +0000 (23:04 +0200)]
dcc: Properly sync TransferManager

Existing transfers were not synced to the client. With this commit,
the list of transfer IDs is marked as a Q_PROPERTY and thus synced
automatically.
Also provides the necessary serialization support.

7 years agodcc: Only show file receive dialog for new transfers
Manuel Nickschas [Wed, 28 Sep 2016 21:03:27 +0000 (23:03 +0200)]
dcc: Only show file receive dialog for new transfers

... and not for ones that have been around on the core already
prior to syncing.

7 years agodcc: Protect DCC file transfer support by a feature flag
Manuel Nickschas [Wed, 28 Sep 2016 21:02:50 +0000 (23:02 +0200)]
dcc: Protect DCC file transfer support by a feature flag

7 years agodcc: Add rudimentary view for file transfers
Manuel Nickschas [Fri, 10 Jun 2016 22:10:33 +0000 (00:10 +0200)]
dcc: Add rudimentary view for file transfers

For now this is just a stock QTableView for visualizing the
TransferModel. Will be replaced by a proper view later.

7 years agodcc: Introduce TransferModel for DCC file transfers
Manuel Nickschas [Wed, 8 Jun 2016 20:18:14 +0000 (22:18 +0200)]
dcc: Introduce TransferModel for DCC file transfers

This model serves as input for a yet-to-come widget for displaying
the current list of transfers.

7 years agoUse override in a few more places to avoid compiler warnings
Manuel Nickschas [Tue, 27 Sep 2016 21:03:30 +0000 (23:03 +0200)]
Use override in a few more places to avoid compiler warnings

Clang complains about inconsistent use of virtual and override, and
for some reason the only offender when building against Qt 5 was
multilineedit.h. This commit fixes the ungodly amount of warnings that
that one header produced.

When building against Qt 4 we still get warnings from the various
application classes; however fixing them triggers a million new
warnings related to Q_OBJECT which is beyond our control, so we'll
just have to wait until we can finally deprecate support for Qt 4
for good...

7 years agoAvoid deprecation warnings with Qt 5.7
Manuel Nickschas [Tue, 27 Sep 2016 20:28:46 +0000 (22:28 +0200)]
Avoid deprecation warnings with Qt 5.7

The versioned QStyleOption derivatives are deprecated in Qt 5,
and Qt 5.7 actually gets noisy about that. So remove these by
the unversioned class names.

7 years agoFix my AboutData entry
Michael Marley [Mon, 19 Sep 2016 21:59:21 +0000 (17:59 -0400)]
Fix my AboutData entry

My PPAs only work for Ubuntu, not Debian.

Resolves GH-251.

7 years agoUpdate ThanksTo in the AboutDlg
Manuel Nickschas [Tue, 20 Sep 2016 21:06:10 +0000 (23:06 +0200)]
Update ThanksTo in the AboutDlg

This was pretty outdated and mentioned companies that no longer exist.
Bring the content of that tab into the present. Add new icons, remove
old.

Also modernize the code a tiny bit, and ease the life of translators
by factoring out most of the RichText stuff.

7 years agoUpdates old links/urls in the about dialog
Bernhard Scheirle [Thu, 15 Sep 2016 11:11:34 +0000 (13:11 +0200)]
Updates old links/urls in the about dialog

7 years agoUpdate ChangeLog
Manuel Nickschas [Mon, 19 Sep 2016 21:18:39 +0000 (23:18 +0200)]
Update ChangeLog

7 years agoUpdate AboutData
Manuel Nickschas [Mon, 19 Sep 2016 21:17:50 +0000 (23:17 +0200)]
Update AboutData

New contributors, and one new author!

7 years agoUse Qt::AA_UseHighDpiPixmaps
Hannah von Reth [Thu, 8 Sep 2016 11:30:26 +0000 (13:30 +0200)]
Use Qt::AA_UseHighDpiPixmaps

This will fix some issues... and introduce new ones:

* Some pixmaps are now cut
* Old banner pixmap still pixelated
* Overall looks much less pixelated

Resolves GH-248.

7 years agoBuild with Qt5 by default
Michael Marley [Wed, 7 Sep 2016 21:34:20 +0000 (17:34 -0400)]
Build with Qt5 by default

This basically reverses the old default behavior.  Now, Qt5 is used
by default if neither USE_QT4 nor USE_QT5 is set or if they are
both set.

Resolves GH-246.

7 years agoUse case-insensitive match for buffer search
Shane Synan [Tue, 6 Sep 2016 09:49:16 +0000 (04:49 -0500)]
Use case-insensitive match for buffer search

When filtering buffers via the quick search bar (Ctrl-S), use
case-insensitive matching.  This allows typing lowercase to find
proper names, makes randomly hitting shift not matter, etc.  This
mimics the default behavior of the Ctrl-F find bar.

Resolves GH-245.

7 years agoEnable Nick Toolbar
romibi [Thu, 19 Nov 2015 17:55:00 +0000 (18:55 +0100)]
Enable Nick Toolbar

Nick Toolbar not visible by default.

Resolves GH-243.

7 years agoOnly load the `EnableSpellCheck` setting for KDE4 users.
Bernhard Scheirle [Fri, 19 Aug 2016 06:06:40 +0000 (08:06 +0200)]
Only load the `EnableSpellCheck` setting for KDE4 users.

Others either have no spell checking at all or use KF5 Sonnet with
its own settings / settings page.

Resolves GH-242.

7 years agoPrevent the spelling highlighter from disabling itself
Bernhard Scheirle [Fri, 19 Aug 2016 06:15:03 +0000 (08:15 +0200)]
Prevent the spelling highlighter from disabling itself

Resolves GH-241.

7 years agoFix multiline textedit not expanding on OS X
A. V. Lukyanov [Thu, 11 Aug 2016 07:57:27 +0000 (10:57 +0300)]
Fix multiline textedit not expanding on OS X

Fixes #1212. Resolves GH-240.

7 years agoOn OS X restore from both dock and tray
A. V. Lukyanov [Wed, 3 Aug 2016 18:47:26 +0000 (21:47 +0300)]
On OS X restore from both dock and tray

7 years agoOn OS X restore from dock
A. V. Lukyanov [Wed, 3 Aug 2016 02:16:29 +0000 (05:16 +0300)]
On OS X restore from dock

7 years agoOn OS X allow minimize on close
A. V. Lukyanov [Tue, 2 Aug 2016 18:34:56 +0000 (21:34 +0300)]
On OS X allow minimize on close

7 years agoQueryBufferItem disconnect IrcUser when removing
Shane Synan [Wed, 27 Jul 2016 06:53:53 +0000 (02:53 -0400)]
QueryBufferItem disconnect IrcUser when removing

Add call to disconnect() when removing IrcUser from QueryBufferItem,
preventing _ircUser from triggering removeIrcUser() again when it's
destroyed by going out of scope.  Additionally, limit dataChanged()
to when IrcUser is removed.  May offer slight speed benefits.

Fixes at least one case of the client showing some nicknames as
offline when they're actually available (e.g. restarting the client
without restarting the core reveals them as online).

Test case from Bitlbee - receive following (no delay between AWAYs):
:nick!name@gmail.com JOIN :&bitlbee
:nick!name@gmail.com AWAY :Away (Testing)
:nick!name@gmail.com QUIT :Leaving...
:nick!name@gmail.com AWAY :User is offline

Before, 'nick' was wrongly shown as not available.  After, 'nick' is
shown as away with the message "User is offline".

(Bitlbee does this as GTalk/XMPP allow for messaging offline users)

Resolves GH-239.

7 years agoShow IRC server error messages when unexpected
Shane Synan [Tue, 6 Sep 2016 21:33:58 +0000 (16:33 -0500)]
Show IRC server error messages when unexpected

Handle ERROR replies from IRC servers, displaying the error message
in the status buffer.

Add method 'disconnectExpected' to CoreNetwork to expose when a
disconnect is expected.  As we're expecting a server error message
when issuing QUIT, hide it to avoid showing redundant information.

This fixes users getting disconnected by the server without any way
to find out why.

Resolves GH-238.

7 years agoFix disconnected networks not collapsing on login
Shane Synan [Tue, 26 Jul 2016 21:42:45 +0000 (17:42 -0400)]
Fix disconnected networks not collapsing on login

Remove call to expandAll() - later calls to setExpandedState() should
automatically expand connected networks.

Before, Qt4 would collapse disconnected networks and expand connected
networks, but Qt5 would always expand both.  After, both collapse
disconnected and expand connected.

Resolves GH-237.

7 years agoUse Qt5.7 for appveyor.
Hannah von Reth [Sat, 9 Jul 2016 18:04:59 +0000 (20:04 +0200)]
Use Qt5.7 for appveyor.

Also use gcc 5.3 shipped by Qt.

Resolves GH-231.

7 years agoAdd popup to "(Dis-)Connect from/to IRC" to prevent unwanted action
romibi [Sun, 28 Aug 2016 12:05:38 +0000 (14:05 +0200)]
Add popup to "(Dis-)Connect from/to IRC" to prevent unwanted action

Resolves GH-160.

7 years agoAdd function to "(Dis-)Connect from/to all" in connection dropdown
romibi [Sun, 14 Feb 2016 10:50:44 +0000 (11:50 +0100)]
Add function to "(Dis-)Connect from/to all" in connection dropdown

If I'm not mistaken there needs to be one ActionType per different
button layout (with icon/text only)...

7 years agoChange Icons
romibi [Thu, 19 Nov 2015 13:06:01 +0000 (14:06 +0100)]
Change Icons

7 years agoAdd "Connect to Core" and "Disconnect from Core" buttons to main toolbar
romibi [Thu, 19 Nov 2015 13:04:56 +0000 (14:04 +0100)]
Add "Connect to Core" and "Disconnect from Core" buttons to main toolbar

7 years agoRemove CoreInfo from the ClientRegistered handshake message
Manuel Nickschas [Tue, 13 Sep 2016 22:46:07 +0000 (00:46 +0200)]
Remove CoreInfo from the ClientRegistered handshake message

This string was only used by pre-0.5 clients, and even then only
for displaying information on the connection dialog during the
handshake phase, so it is safe to remove. This prevents the core
from leaking information about itself before a successful login.

7 years agoSkip rate limit for login, capability negotiation
Shane Synan [Wed, 7 Sep 2016 05:35:48 +0000 (00:35 -0500)]
Skip rate limit for login, capability negotiation

Disable message rate limit during nick registration and capability
negotiation (Network::Initializing).  Once network initialization
is complete (Network::Initialized), re-apply configured rate limits.

Helps fix connection timeouts during login on servers with SASL
enabled, multiple capabilities negotiated, and a strict 10s login
time.

Add flag 'forceUnlimited' to updateRateLimiting() which temporarily
overrides user preferences to skip all rate limiting.  User
preferences can be applied afterwards by calling updateRateLimiting()
without setting 'forceUnlimited'.

Resolves GH-236.

7 years agoImplement custom rate limits
Shane Synan [Mon, 5 Sep 2016 21:26:44 +0000 (16:26 -0500)]
Implement custom rate limits

Add custom rate limits flag and settings.
> In database, add 'usecustommessagerate', 'messagerateburstsize',
'messageratedelay', and 'unlimitedmessagerate' to 'network' table,
defaulting to the values already used.  This modifies schema,
requiring a version bump, changes to migration scripts, etc.
Use 4 upgrade scripts as SQLite does not support adding multiple
columns at once.
> In protocol, add 'useCustomMessageRate', 'msgRateBurstSize',
'msgRateMessageDelay', and 'unlimitedMessageRate' to Network,
configuring custom rate limits.

Add 'CustomRateLimits' feature flag so the client can tell users
about needing to upgrade their core to get this feature.

If rate limits set to unlimited, disable the token bucket timer and
send messages immediately.  Otherwise, modify the existing token
bucket variables according to the new limits.  The defaults are
unchanged.

Add "Use Custom Rate Limits" checkbox to network "Connection" tab
with an explanatory tooltip warning against setting too low of rate
limits.  Tooltip is modified and checkbox disabled if the core does
not support the feature.

Testing:
> Database schema handling
SQLite new install - works
SQLite upgrade - works
SQLite migrate to Postgres - works
Postgres new install - works
Postgres upgrade - works

> Client/core connections
New client, new core - works
New client, old core - works, custom rates grayed out
Old client, new core - works, custom rates reset + disabled on edit
(Unfortunately there's no way to use a boolean and tell if the client
 is old, or actually disabling custom rate limits.  Would need the
 work-in-progress ClientFeature system 'esainane' designed)

7 years agoFix snapcraft version
Manuel Nickschas [Tue, 13 Sep 2016 21:44:46 +0000 (23:44 +0200)]
Fix snapcraft version

The previous commit was originally destined for the 0.12 branch, so
the version needs to be adapted.

7 years agoSnapcraft packaging for quasselcore
Christian [Sat, 16 Jul 2016 14:48:10 +0000 (16:48 +0200)]
Snapcraft packaging for quasselcore

Resolves GH-235.

7 years agoUpdate INSTALL for WebEngine/WebKit
Manuel Nickschas [Wed, 7 Sep 2016 23:40:09 +0000 (01:40 +0200)]
Update INSTALL for WebEngine/WebKit

WebEngine is a new feature, and WebKit is deprecated and unmaintained.
Update INSTALL to reflect the changes.

7 years agoMake Breeze the default icon theme
Manuel Nickschas [Wed, 7 Sep 2016 23:31:19 +0000 (01:31 +0200)]
Make Breeze the default icon theme

Also fix some related UI issues.

7 years agoAdapt macosx_makePackage.sh for svg icon support
romibi [Sat, 16 Jul 2016 13:02:12 +0000 (15:02 +0200)]
Adapt macosx_makePackage.sh for svg icon support

Resolves GH-234.

7 years agoEnable Breeze on Appveyor
romibi [Fri, 15 Jul 2016 20:24:32 +0000 (22:24 +0200)]
Enable Breeze on Appveyor

7 years agoAdd Settings option to choose from bundled Icon Themes
romibi [Fri, 15 Jul 2016 19:37:03 +0000 (21:37 +0200)]
Add Settings option to choose from bundled Icon Themes
or system default

7 years agoAdd and Initialize Icon Themes
romibi [Fri, 15 Jul 2016 19:35:44 +0000 (21:35 +0200)]
Add and Initialize Icon Themes

7 years agoAdd Icons from Breeze and Breeze Dark
romibi [Fri, 15 Jul 2016 19:33:47 +0000 (21:33 +0200)]
Add Icons from Breeze and Breeze Dark

7 years agoFix Icon Theme Import Script
romibi [Fri, 15 Jul 2016 19:31:32 +0000 (21:31 +0200)]
Fix Icon Theme Import Script

7 years agoAdd spacers to Chat & Nick Lists settings page
Shane Synan [Wed, 13 Jul 2016 14:51:11 +0000 (10:51 -0400)]
Add spacers to Chat & Nick Lists settings page

Add horizontal and vertical spacers to Use Custom Colors and
Custom Nick List toggles on Chat & Nick Lists settings page.  Adjust
the grid layout to maintain similar spacing as prior.

This keeps it from stretching across the entire screen when the
settings dialog is very wide (e.g. maximized).

Resolves GH-232.

7 years agoAdd horizontal spacer to Appearance settings page
Shane Synan [Wed, 13 Jul 2016 14:27:37 +0000 (10:27 -0400)]
Add horizontal spacer to Appearance settings page

Add horizontal spacer to Message Redirection toggles on Appearance
settings page.  Adjust the grid layout to maintain similar spacing as
prior.

This keeps it from stretching across the entire screen when the
settings dialog is very wide (e.g. maximized).

7 years agoAuto-resize Settings to fit wide widgets
Shane Synan [Wed, 13 Jul 2016 15:27:43 +0000 (11:27 -0400)]
Auto-resize Settings to fit wide widgets

Add check for settingsTree width.  If it's not at the maximum width,
resize the Settings dialog to fit it.  Qt should keep the dialog
within bounds of the screen, and the user can always resize the
dialog if needed.

This fixes the Settings dialog squashing the settings tree with the
Sonnet spell-checking widget, Ubuntu 16.04 on en_US, and a 1920×1080
screen.

7 years agoEnable Qt's high-DPI scaling introduced in Qt5.6
romibi [Thu, 14 Jul 2016 09:36:07 +0000 (11:36 +0200)]
Enable Qt's high-DPI scaling introduced in Qt5.6

Resolves GH-233.

7 years agoFix cmd+Q invalidating the layout somehow
romibi [Sat, 9 Jul 2016 16:30:44 +0000 (18:30 +0200)]
Fix cmd+Q invalidating the layout somehow

On Mac OSX Qt Applications (with Frameworks packaged) receive the
CloseEvent twice. (See https://bugreports.qt.io/browse/QTBUG-43344)
This triggers a bug where Quassels Main-Window stays hidden and all
Layout states get reset on next launch.
Workaround by checking if event already received...

Resolves GH-230.

7 years agoFix Mac Deploy scripts for newer Xcode and git
romibi [Tue, 5 Jul 2016 19:39:39 +0000 (21:39 +0200)]
Fix Mac Deploy scripts for newer Xcode and git

Resolves GH-229.

7 years agoEnable OSX dmg deployment on Travis
romibi [Tue, 5 Jul 2016 19:33:42 +0000 (21:33 +0200)]
Enable OSX dmg deployment on Travis

Resolves GH-228.

7 years agoDisable webkit by default
Martin T. H. Sandsmark [Sat, 2 Jul 2016 16:24:05 +0000 (18:24 +0200)]
Disable webkit by default

Qt WebKit is deprecated and a bit of a walking security hole, so it
makes sense to disable by default.

Resolves GH-225.

7 years agoProperly handle 0 seconds in secondsToString()
Michael Marley [Sat, 2 Jul 2016 14:20:58 +0000 (10:20 -0400)]
Properly handle 0 seconds in secondsToString()

Previously if 0 seconds was passed in, an empty string would be
returned.  Instead, "0 sec" should be returned.

Resolves GH-223.

7 years agoAllow client-side channel buffer merges, and associated changes.
selabnayr [Fri, 24 Jun 2016 21:38:04 +0000 (14:38 -0700)]
Allow client-side channel buffer merges, and associated changes.

networkmodel.cpp: Mark ChannelBufferItems as being a drop target, to
allow for channel buffer merging.

bufferviewfilter.cpp: Rework BufferViewFilter::flags() to make it more
clear what's going on, and remove the restriction that made
QueryBuffers the only merge-able buffers.

bufferview.cpp: Rework BufferView::dropEvent() to add a bunch of
comments, and allow ChannelBuffers to be merged as well as QueryBuffers.
ChannelBuffers can only be the source for a merge if they are not
currently joined, to prevent UI weirdness of being in a channel but not
having any associated UI elements.

Resolves GH-220.

7 years agoAllow core-side channel buffer merges
selabnayr [Fri, 24 Jun 2016 21:20:50 +0000 (14:20 -0700)]
Allow core-side channel buffer merges

Also fix a typo in the warning for a merge that fails the tests.

7 years agoSimplify FindExecInfo
Rolf Eike Beer [Fri, 1 Jul 2016 17:04:06 +0000 (19:04 +0200)]
Simplify FindExecInfo

* Do not set EXECINFO_INCLUDES to empty it it is NOTFOUND, it is only
  used when EXECINFO_FOUND is set, which is the expected behavior
* Simplify checking for the find_path() and find_library() result,
  CMake considers a variable false if its value is VARNAME-NOTFOUND

Resolves GH-222.

7 years agoDrop QT_PATH from CMake code
Rolf Eike Beer [Fri, 1 Jul 2016 16:54:51 +0000 (18:54 +0200)]
Drop QT_PATH from CMake code

If one wants a specific Qt version then simply set QT_QMAKE_EXECUTABLE
to the correct binary. This has less possible side effects.

7 years agoRemove arguments of CMake's else() and endif() commands
Rolf Eike Beer [Fri, 1 Jul 2016 16:50:36 +0000 (18:50 +0200)]
Remove arguments of CMake's else() and endif() commands

The need for them is long gone, but they are still permitted. Remove the
remaining instances to make the code more consistent.

7 years agoSimplify CMake code
Rolf Eike Beer [Fri, 1 Jul 2016 16:47:06 +0000 (18:47 +0200)]
Simplify CMake code

7 years agoBatch request capabilities during negotiation
Shane Synan [Tue, 6 Sep 2016 08:56:52 +0000 (03:56 -0500)]
Batch request capabilities during negotiation

Split apart capability queue into individual and bundled groups.
Request capabilities one-at-a-time in the individual queue, and as
many as will fit within length limits in the bundled queue.  Use a
length limit of 100 characters to follow minimum number of characters
that IRC servers must return in CAP NAK replies, also meaning CAP NAK
replies will contain the full list of denied capabilities.

Individually request SASL and other capabilities requiring
configuration to avoid conflicts with requesting new capabilities
while still setting up the current capability.

Retry bundled capability requests individually when failed.  This
prevents one failing capability from blocking others.  Unfortunately
there's no way to avoid blindly re-requesting as CAP NAK does not
specify which capability failed.

Show a warning when retrying capabilities individually to explain the
added delay in logging in and to ease troubleshooting.

Fix documentation regarding capability handling.

Resolves GH-221.

7 years agoNetwork::clearCaps only sync when caps removed
Shane Synan [Sun, 28 Aug 2016 21:49:07 +0000 (16:49 -0500)]
Network::clearCaps only sync when caps removed

Add check for if _caps and _capsEnabled contain any capabilities.  If
not, return from the clearCaps call without issuing a network SYNC.

Fixes needless clearCaps calls when reconnecting to a network that's
failing to connect.

This may cause inconsistency if clients miss some sync calls.. but
Quassel protocol currently depends on all sync calls being propogated
anyways.

7 years agoRemove redundant parameter check from IrcEventCap
Shane Synan [Mon, 11 Jul 2016 11:14:28 +0000 (07:14 -0400)]
Remove redundant parameter check from IrcEventCap

Remove the prior direct check of parameter count now that
checkParamCount is used.  checkParamCount is preferred due to logging
a warning when not enough parameters are supplied.

7 years agoTry to recover from some bad CAP replies, docs
Shane Synan [Mon, 11 Jul 2016 11:04:54 +0000 (07:04 -0400)]
Try to recover from some bad CAP replies, docs

Modify CAP ACK and CAP NAK commands to try to continue when possible
rather than getting stuck.

Fix related documentation.

7 years agoHandle IRCv3 servers without any capabilities
Shane Synan [Mon, 11 Jul 2016 10:44:16 +0000 (06:44 -0400)]
Handle IRCv3 servers without any capabilities

When servers implement CAP LS but do not offer any capabilities, end
negotiation and continue connecting as usual.

Modify processIrcEventCap to allow for commands with two parameters.
CAP LS and CAP LIST can have empty replies to signify no
capabilities are available/active.

Add a dedicated 'endCapNegotiation' function to avoid code
duplication.

Fixes repeated connection timeouts for IRCv3-compliant servers that
don't have any capabilities to offer.

7 years agoSort IRCv3 capabilities before negotiation
Shane Synan [Wed, 29 Jun 2016 21:26:56 +0000 (17:26 -0400)]
Sort IRCv3 capabilities before negotiation

Sort capabilities before requesting for consistency among networks.
This may avoid unexpected cases when some networks offer capabilities
in a different order than others.  It also looks nicer in logs.

7 years agoHandle caps with multiple key-value pairs
Shane Synan [Mon, 11 Jul 2016 11:12:07 +0000 (07:12 -0400)]
Handle caps with multiple key-value pairs

Include everything after the first '=' in the capability value.  This
fixes support for future IRCv3 capabilities with multiple key-value
pairs, e.g. "sts=duration=31536000,port=6697"

Current IRCv3 capabilities are handled as before.

7 years agoHandle non-standard missing event parameters
Shane Synan [Wed, 29 Jun 2016 21:16:42 +0000 (17:16 -0400)]
Handle non-standard missing event parameters

Improve 'IrcEventAway', 'IrcEvent330', and 'IrcEvent403' to be more
resilient to missing parameters.  We don't need all of the parameters
to get the needed information.

These event handlers were introduced as part of the IRCv3 changes and
shouldn't modify how 0.12.4 handled commands.

7 years agoSet account on extended-join, simplify, fix docs
Shane Synan [Wed, 29 Jun 2016 21:11:37 +0000 (17:11 -0400)]
Set account on extended-join, simplify, fix docs

Now that account tracking exists, update extended-join to set account
data, too.  This was accidentally left out of the IRCv3 fix-up pull
request.

Simplify account tracking in 'processIrcEventAccount'.  No need to
check for '*' when that's used internally to represent logged-out.

Update documentation to mention 'extended-join' in WHOX and
IrcEventAccount handling.

7 years agoFix joins for non-spec servers with extended-join
Shane Synan [Wed, 29 Jun 2016 21:19:44 +0000 (17:19 -0400)]
Fix joins for non-spec servers with extended-join

Some IRC servers don't always send extended-join data despite
capability negotiation.  Rather than dropping the join entirely,
treat it as a normal join.  Fixes missing joins on some networks for
host changes.

7 years agoDon't redefine activated signal.
Hannah von Reth [Fri, 24 Jun 2016 06:55:22 +0000 (08:55 +0200)]
Don't redefine activated signal.

Resolves GH-219.

7 years agoOnly register deregister quassel with snore if it wasn't done yet.
Hannah von Reth [Fri, 24 Jun 2016 06:54:57 +0000 (08:54 +0200)]
Only register deregister quassel with snore if it wasn't done yet.

7 years agoAdd AppData metadata for quassel, quasselclient.
Ben Rosser [Wed, 15 Jun 2016 22:18:27 +0000 (18:18 -0400)]
Add AppData metadata for quassel, quasselclient.

The freedesktop.org AppData standard defines metadata for GUI
applications that wish to show up in various graphical software
centers, such as GNOME Software. See the specification for
more details: https://people.freedesktop.org/~hughsient/appdata/

Applications without metadata will not show up in GNOME Software,
and possibly other graphical package managers. As GNOME Software
is the recommended way on Fedora Workstation to install software,
this means that without these files users won't be able to find
quassel or quasselclient.

Fixes #1400. Resolves GH-216.

7 years agoReload SSL certificates on signal SIGHUP
Shane Synan [Mon, 5 Sep 2016 19:19:03 +0000 (14:19 -0500)]
Reload SSL certificates on signal SIGHUP

Catch SIGHUP, use it to reload configuration (SSL certs), similar to
nginx and other server programs.  This allows easy automation of
reloading certificates, an important factor with services such as
Let's Encrypt.

If reloading certificates fails, the old certificates are kept to
avoid disrupting new connections until the situation is sorted out.

Resolves GH-208.

7 years agoDisconnect CoreSession _networks before delete
Shane Synan [Mon, 5 Sep 2016 19:09:17 +0000 (14:09 -0500)]
Disconnect CoreSession _networks before delete

Explicitly call disconnect for each CoreNetwork, process events, then
wait for each network to disconnect before deleting it.

This overwrides the automatic cleanup in CoreNetwork to handle
shutting down tens of networks at once.  This allows all CoreNetworks
to start disconnecting at once before waiting for each to individually
shut down.

Resolves GH-207.

7 years agoProcess events when destroying CoreNetwork
Shane Synan [Mon, 5 Sep 2016 19:07:51 +0000 (14:07 -0500)]
Process events when destroying CoreNetwork

During shutdown, process events in CoreNetwork, and wait for the
socket to disconnect.  This fixes the QUIT command not getting sent
to IRC networks.

Examples
[Unreal 3.2]
> Before
<-- dcircuit_dev (quasseldev@hostmask.IP) has quit (Input/output error)
> After
<-- dcircuit_dev (quasseldev@hostmask.IP) has quit (Quit: My Message!)
[Freenode]
> Before
<-- dcircuit_dev (~quasselde@hostmask) has quit (Remote host closed the connection)
> After
<-- dcircuit_dev (~quasselde@hostmask) has quit (Quit: My Message!)

Where "My Message!" is specified in Configure Quassel -> IRC
-> Identities -> Advanced -> Quit Reason

Note: Freenode hides quit messages from clients that disconnect soon
after connecting.  Stay connected ~10 minutes before testing QUIT.

7 years agoDon't log socket error when disconnecting
Shane Synan [Tue, 7 Jun 2016 09:43:38 +0000 (05:43 -0400)]
Don't log socket error when disconnecting

Add flag _disconnectExpected, set to true in disconnectFromIrc() in
order to ignore RemoteHostClosed socket errors.  It's not really an
error when it's expected behavior, no?

7 years agoAdd spacers to Chat View Colors settings page
Shane Synan [Wed, 13 Jul 2016 15:13:02 +0000 (11:13 -0400)]
Add spacers to Chat View Colors settings page

Add horizontal and vertical spacers to Custom Colors and
Use Sender Coloring on Chat View Colors settings page.  Adjust the
grid layout to maintain similar spacing as prior.

This keeps it from stretching across the entire screen when the
settings dialog is very wide (e.g. maximized).

Resolves GH-185.

7 years agoMove Chat View colors to new settings page
Shane Synan [Wed, 29 Jun 2016 06:10:40 +0000 (02:10 -0400)]
Move Chat View colors to new settings page

Add new settings page Chat View Colors for "allowMircColors",
"useCustomColors", "useSenderColors", and related color buttons.

Remove the above settings from the general Chat View settings page.
Add missing tab stops for "autoMarkerLineOnLostFocus" and
"webSearchUrlFormat".

This reduces visual clutter, improves organization, and saves
vertical space, helpful for smaller screens.
(~54 pixels saved vs 0.12.4, ~112 pixels saved vs all options in one)

7 years agoSettings upgrade logic, classic for old installs
Shane Synan [Mon, 27 Jun 2016 23:54:21 +0000 (19:54 -0400)]
Settings upgrade logic, classic for old installs

Add "VersionMinor" to Settings for backwards/forwards-compatible
changes.  Existing installs without this setting are distinguished by
checking if other settings keys exist.

Add upgrade logic to QtUiApplication to preserve previous settings
when changing defaults.  This avoids unwanted surprises if someone
likes the defaults, doesn't save them, then upgrades their client.
Otherwise, Qt would only save settings when changed.

(Core currently does not need version-compatible settings migration
 logic, but it can be added in the future if needed.)

Add a method to settings to check if a key exists, used when checking
if a non-default value was chosen.

Upgrading settings to version 2 will preserve Quassel's UI for those
with the classic look, but new installs default to modern style.  In
the future, this can be used to implement any other default changes.

7 years agoDefault nick/action color on, sender brackets off
Shane Synan [Mon, 27 Jun 2016 23:53:31 +0000 (19:53 -0400)]
Default nick/action color on, sender brackets off

Add default sender colors in a QList accessible to the stylesheet
generator to allow for enabling colors by default.  This complements
removing sender brackets by default.

Generate a default stylesheet on first run so stylesheet-dependent
defaults such as sender colors will be applied.

Enable both sender and action colors, disable sender brackets by
default when not otherwise selected.

7 years agoOptionally color sender nicks in Action messages
Shane Synan [Mon, 27 Jun 2016 23:51:48 +0000 (19:51 -0400)]
Optionally color sender nicks in Action messages

Add checkbox to ChatViewSettings to color sender/nick of action
messages, using the same sender colors as regular messages.

This -significantly- improves readability for long action messages,
such as those on story-telling channels.

7 years agoCalculate senderHash for Action messages
Shane Synan [Fri, 17 Jun 2016 01:16:40 +0000 (21:16 -0400)]
Calculate senderHash for Action messages

Fixes stylesheets not being able to reference sender hashes in Qss
selectors.

Allows the following to work:
ChatLine::nick#action[sender="00"]   { foreground: #e90d7f; }

Just like this currently works:
ChatLine::nick#plain[sender="00"] { foreground: #e90d7f; }

7 years agoAdd brackets to timestamp when copying if hidden
Shane Synan [Tue, 28 Jun 2016 02:33:35 +0000 (22:33 -0400)]
Add brackets to timestamp when copying if hidden

Add brackets around timestamp if ShowSenderBrackets is disabled -and-
the timestamp format does not contain brackets.  This matches all
common types of brackets using a regular expression.

Remove any leading and trailing space from timestamp format before
copying if above conditions met, to avoid having [ 11:04:32] or some
such.  This might be unexpected, but if someone has specific needs
for the bracket arrangement, they can toggle to always show sender
brackets.

Examples with show sender brackets disabled:
" hh:mm:ss"     -> "[hh:mm:ss]"
" h:mm:ss ap"   -> "[h:mm:ss ap]"
"<hh mm ss"     -> "[<hh mm ss]"
"[hh:mm:ss]"    -> unchanged
"<hh mm ss>"    -> unchanged
"{hh:mm:ss:ss>" -> unchanged (and I won't ask why you're doing this)

For regular expression debugging and explanations,
See: https://regex101.com/

7 years agoMake sender brackets configurable, on by default
Shane Synan [Tue, 28 Jun 2016 02:32:30 +0000 (22:32 -0400)]
Make sender brackets configurable, on by default

Add a toggle to Settings -> Interface -> Chat View so sender brackets
can be enabled and disabled as desired.  Keeping with the timestamp
change, brackets are disabled by default but can be easily reenabled.

Revert Chat Monitor to include ':' as a separator between the
network:buffer:sender line, for otherwise it can be hard to read.

7 years agoRemove displayed brackets around sender nicks
Daniel Albers [Tue, 28 Jun 2016 02:47:21 +0000 (22:47 -0400)]
Remove displayed brackets around sender nicks

Remove brackets around nick names for the display role.

Add brackets around sender when copying ChatLines.  Only apply when
Message::Type == Plain, though.

Remove brackets from default timestamp setting

7 years agoFix crash if topic has a CarriageReturn
romibi [Thu, 16 Jun 2016 22:50:40 +0000 (00:50 +0200)]
Fix crash if topic has a CarriageReturn

Resolves GH-218.

7 years agoDocument schema changes, tidy up upgrade script
Shane Synan [Fri, 17 Jun 2016 23:12:23 +0000 (19:12 -0400)]
Document schema changes, tidy up upgrade script

Add copyright header, simplified from the usual since shell scripts
don't fold header comments by default.

Add a lengthy comment about how to manage schema changes, including
an example of adding the column 'test' to the 'ircserver' table.

Add some quotes to directory variables to handle spaces, comment some
of the commands.

Resolves GH-217.

7 years agoUpdate preset networks to include SSL variants
Shane Synan [Wed, 15 Jun 2016 20:00:17 +0000 (16:00 -0400)]
Update preset networks to include SSL variants

Update the bundled networks.ini to use SSL variants when possible.
Non-SSL versions are still included by default to reduce risk of
breaking new setups.

Preset networks don't have SSL verification enabled by default since
including non-SSL variants in the preset defeats the point.

7 years agoSync default port with Use encrypted connection
Shane Synan [Thu, 16 Jun 2016 19:35:42 +0000 (15:35 -0400)]
Sync default port with Use encrypted connection

Change the preselected port from 6667 to 6697 when enabling
"Use encrypted connection" and change back from 6697 to 6667 when
disabling "Use encrypted connection".  The port number can be
manually changed, stopping the link between checkbox and port.
Existing networks are unmodified.

Add loosely-standardized default IRC server ports to network.h to
provide a central place to manage it.  This should only be used when
first adding a server.

See https://freenode.net/news/port-6697-irc-via-tlsssl

7 years agoOptionally verify SSL connection to IRC servers
Shane Synan [Wed, 13 Jul 2016 23:17:30 +0000 (19:17 -0400)]
Optionally verify SSL connection to IRC servers

Add SSL verify flag.
> In database, add 'sslverify' to 'server' table, defaulting to
false so upgrades won't break existing setups.  This modifies
schema, requiring a version bump, changes to migration scripts, etc.
> In protocol, add 'sslVerify' to Network::Server, configuring if
SSL errors should be ignored or result in disconnect.

Add 'VerifyServerSSL' feature flag so the client can tell users about
needing to upgrade their core to get this feature.

If SSL verification fails and...
> SSL verify enabled:  disconnect and trigger a retry, logging the
error message in the status buffer
> SSL verify disabled: log the error message at Info level and
continue connecting anyways

Add "Verify connection security" checkbox to network add/edit dialogs
with an explanatory tooltip.  Tooltip is modified and checkbox
disabled if the core does not support the feature.  Connections are
verified by default when "Use encrypted connection" is checked.

Change "Use SSL" and "Use secure connection" to
"Use encrypted connection" to better reflect what the option does.

Fix tooltips and other strings in network editing dialogs.

Testing:
> Database schema handling
SQLite new install - works
SQLite upgrade - works
SQLite migrate to Postgres - works
Postgres new install - works
Postgres upgrade - works

> Client/core connections
New client, new core - works
New client, old core - works, verify SSL grayed out
Old client, new core - works, verify SSL reset to false on edit
(Unfortunately there's no way to use a boolean and tell if the client
 is old, or actually setting verify SSL to false.  Would need the
 work-in-progress ClientFeature system 'esainane' designed)

(Not using '@mention' since that notifies on EVERY commit push)