2 years agouisupport: Also fix doubleclick in nick views
Manuel Nickschas [Tue, 27 Feb 2018 09:59:52 +0000 (10:59 +0100)]
uisupport: Also fix doubleclick in nick views

Since the Q_WS_* macros no longer exist in Qt5, replace them by the
appropriate Q_OS_* macros. Remove some needless ones, too.

2 years agouisupport: Join channels on doubleclick on all but Windows and OSX
Manuel Nickschas [Tue, 27 Feb 2018 09:23:39 +0000 (10:23 +0100)]
uisupport: Join channels on doubleclick on all but Windows and OSX

The Q_WS_* macros no longer exist in Qt5, so the OS detection for
the click behavior in bufferviews didn't work correctly. Use the
correct Q_OS_* macros to ensure that a doubleclick is required on
platforms other than Windows and OSX.

2 years agoclient: Fix Chat Monitor missing sender brackets
Shane Synan [Fri, 22 Sep 2017 23:56:49 +0000 (18:56 -0500)]
client: Fix Chat Monitor missing sender brackets

Always re-add hidden sender brackets for the Chat Monitor as the
normal sender prefixes get replaced with Network, Buffer, and Sender

Sender brackets shown:
> Copy-pasted
  Chat Monitor: <Bitlbee:#channel> digitalcircuit does things
  Channel:      -*- digitalcircuit does things

> Copy-pasted with sender brackets hidden (wrong)
  Chat Monitor: Bitlbee:#channel digitalcircuit does things
  Channel:      -*- digitalcircuit does things

> Copy-pasted with sender brackets hidden (correct)
  Chat Monitor: <Bitlbee:#channel> digitalcircuit does things
  Channel:      -*- digitalcircuit does things

Closes GH-314.

2 years agoPackage bearer plugin on OSX
romibi [Fri, 2 Feb 2018 11:45:09 +0000 (12:45 +0100)]
Package bearer plugin on OSX

Fixes #1442. Closes GH-324.

2 years agoFix OSX compile and deploy
romibi [Fri, 1 Sep 2017 08:06:10 +0000 (10:06 +0200)]
Fix OSX compile and deploy

Set additional compile flag
Fix FindLdap.cmake for OSX
Fix DMG creation (sometimes fails if no volume size is provided)

Closes GH-304.

2 years agocommon: Fix typo in Network::capAvailable() docs
Shane Synan [Sun, 17 Sep 2017 17:54:05 +0000 (12:54 -0500)]
common: Fix typo in Network::capAvailable() docs

In Network::capAvailable(), fix typo of "guarentee" -> "guarantee".
This doesn't have any impact on running code, but should still be

Thanks to @justJanne for finding this.

Closes GH-300.

2 years agocore: Stop ratelimiting log spam with old client
Shane Synan [Fri, 18 Aug 2017 20:34:38 +0000 (15:34 -0500)]
core: Stop ratelimiting log spam with old client

Downgrade invalid 'setMessageRateBurstSize' and 'setMessageRateDelay'
warning messages to debugging level.  This happens any time an older
client tries to configure a network for a newer core and in most
cases can be ignored.

Should an issue arise, the log level can be set to debug.

2 years agoRemove old 'remove buffer' KeyPress code
genius3000 [Thu, 27 Jul 2017 08:00:05 +0000 (02:00 -0600)]
Remove old 'remove buffer' KeyPress code

Since commit 9f33f6e4 a 'hide current buffer' shortcut is available.
This is the global application shortcut like Sput referenced in

Keeping a hard-coded KeyPress event doing the same seems unnecessary.
Users have also expressed dislike in the use of 'Backspace' for this
buffer removal. Unintentional buffer removals are often for some.

This commit removes the 'KeyPress' event and cleans up the
'hideCurrentBuffer' code, removing commented (un-needed) code.

Reference: http://bugs.quassel-irc.org/issues/1403
Fixes #1403. Closes GH-299.

2 years agocore: connectToIrc: Add clarifying comment on DNS lookups
Albert S [Mon, 21 Aug 2017 19:35:41 +0000 (21:35 +0200)]
core: connectToIrc: Add clarifying comment on DNS lookups

Closes GH-298.

2 years agocore: connectToIrc: Prevent DNS leaks on connection when using proxy
Albert S [Mon, 24 Jul 2017 13:51:56 +0000 (15:51 +0200)]
core: connectToIrc: Prevent DNS leaks on connection when using proxy

96fe7e713 introduced a call to QHostInfo::fromName() in order to avoid
problems related to the caching of DNS queries. It however is also called
when the user has specified that a proxy should be used. This behavior
therefore introduces a DNS leak.

This commit ensures that QHostInfo::fromName() is not called when
a proxy has been specified.

2 years agoExplicitly disable printing signatures when running git
Daniel Albers [Wed, 3 Jan 2018 00:41:41 +0000 (01:41 +0100)]
Explicitly disable printing signatures when running git

Make sure version parsing doesn't fail when a signed commit is at the tip and
log.showsignature is enabled.

2 years agocore: Add SQLite backlog idx: bufferid, messageid
Sven Anderson [Fri, 22 Sep 2017 21:10:51 +0000 (16:10 -0500)]
core: Add SQLite backlog idx: bufferid, messageid

Connecting to the core with a big sqlite storage (>500MB) can become
extremely slow or even time out.  Adding an index over the tuples
(bufferid, messageid) speeds up the connection significantly, because
at connection time a lot of queries over these two values are

Modified by @digitalcircuit from original commit to add a new schema

Closes GH-313 and GH-244.

2 years agoOnly enable sender prefix option if the core supports the feature
Manuel Nickschas [Thu, 21 Dec 2017 12:44:56 +0000 (13:44 +0100)]
Only enable sender prefix option if the core supports the feature

Closes GH-309.

2 years agoMinor cleanups
Manuel Nickschas [Thu, 21 Dec 2017 12:44:30 +0000 (13:44 +0100)]
Minor cleanups

2 years agoImplement UI and serialization logic for sender modes
Janne Koschinski [Wed, 20 Dec 2017 02:22:31 +0000 (03:22 +0100)]
Implement UI and serialization logic for sender modes

2 years agoReplace Protocol::Handler enum with enum class
Janne Koschinski [Wed, 20 Dec 2017 02:12:35 +0000 (03:12 +0100)]
Replace Protocol::Handler enum with enum class

2 years agoMinor cleanups for core-side highlight feature
Manuel Nickschas [Wed, 20 Dec 2017 22:16:52 +0000 (23:16 +0100)]
Minor cleanups for core-side highlight feature

Also remove some accidental fallthroughs, and fix the Qt4 build.

Closes GH-303.

2 years agoStore the HighlightNickType as int instead of custom enum
Janne Koschinski [Wed, 20 Dec 2017 02:30:36 +0000 (03:30 +0100)]
Store the HighlightNickType as int instead of custom enum

2 years agoFix an issue where the table headers were invisible
Janne Koschinski [Wed, 20 Dec 2017 00:17:49 +0000 (01:17 +0100)]
Fix an issue where the table headers were invisible

2 years agoRedesign the core highlight settings page
Janne Koschinski [Tue, 19 Dec 2017 23:38:50 +0000 (00:38 +0100)]
Redesign the core highlight settings page

2 years agoImplement sender matching for highlight rules
Janne Koschinski [Tue, 5 Sep 2017 16:11:51 +0000 (18:11 +0200)]
Implement sender matching for highlight rules

- Implements configuration, sync, and matching behavior for
  sender-based matching in highlight rules
- The match type (regexp or wildcard) is the same as configured for
  the message itself.
- The sender rule has to match exactly

2 years agoImplement inverse highlight rules
Janne Koschinski [Tue, 5 Sep 2017 15:18:57 +0000 (17:18 +0200)]
Implement inverse highlight rules

- Implements configuration, sync, and matching behavior for inverse
- If a message matches a positive rule (or nick), and an inverse rule,
  the inverse rule takes precedence, and no highlight is generated
- Implements an "inverse rule" checkbox in the core-side highlight
  rule configuration dialog.

2 years agoFix an issue with QStringList being declared differently on Qt4
Janne Koschinski [Fri, 1 Sep 2017 11:51:35 +0000 (13:51 +0200)]
Fix an issue with QStringList being declared differently on Qt4

2 years agoFix a potential crash
Janne Koschinski [Fri, 1 Sep 2017 03:45:33 +0000 (05:45 +0200)]
Fix a potential crash

2 years agoImplement UI for core-side highlights
Janne Koschinski [Fri, 1 Sep 2017 03:11:45 +0000 (05:11 +0200)]
Implement UI for core-side highlights

2 years agoImplement core-side highlights
Janne Koschinski [Fri, 1 Sep 2017 01:11:39 +0000 (03:11 +0200)]
Implement core-side highlights

2 years agoAdd 'twitch.tv/membership' capability for Twitch.tv
Florent Castelli [Thu, 22 Jun 2017 16:39:12 +0000 (18:39 +0200)]
Add 'twitch.tv/membership' capability for Twitch.tv

Twitch.tv implementation doesn't send NAMES list automatically
unless supported by the client as they can be quite big.

See: https://dev.twitch.tv/docs/v5/guides/irc/#twitch-irc-capability-membership

Closes GH-296.

2 years agoOnly install the application icon if the client is being built
Adriaan de Groot [Sat, 29 Apr 2017 15:04:57 +0000 (17:04 +0200)]
Only install the application icon if the client is being built

The icon should not be installed as part of a core-only build.

Closes GH-292.

2 years agocmake: Use unquoted variables
Manuel Nickschas [Tue, 19 Dec 2017 22:22:17 +0000 (23:22 +0100)]
cmake: Use unquoted variables

Apparently, CMP0054 sometimes warns about this.

2 years agoDon't return const refs from methods
Manuel Nickschas [Tue, 19 Dec 2017 21:53:53 +0000 (22:53 +0100)]
Don't return const refs from methods

This is dangerous and should be avoided where possible.

Closes GH-302.

2 years agoImplement changes requested in review
Janne Koschinski [Tue, 19 Dec 2017 19:18:20 +0000 (20:18 +0100)]
Implement changes requested in review

- Make Peer::_connectedSince, Peer::_buildDate, Peer::_clientVersion
  private, add getters/setters
- Correct parameter naming in doxygen comment for
- Remove SignalProxy::_peers
- Initialize SignalProxy::_sourcePeer to nullptr
- Add Q_UNUSED for peer parameter for CoreSession::changePassword
- Correct indentation in src/qtui/CMakeLists
- Use pragma in src/qtui/coresessionwidget.h
- Fix header ordering in src/qtui/coresessionwidget.h
- Fix header ordering in src/qtui/coresessionwidget.cpp

2 years agoRemove the session area when empty; improved dialog UI code
Janne Koschinski [Mon, 28 Aug 2017 17:15:44 +0000 (19:15 +0200)]
Remove the session area when empty; improved dialog UI code

2 years agoAdd a header that MSVC requires
Janne Koschinski [Mon, 28 Aug 2017 13:42:19 +0000 (15:42 +0200)]
Add a header that MSVC requires

2 years agoImprovements to fix the build and for Doxygen
Janne Koschinski [Mon, 28 Aug 2017 13:01:42 +0000 (15:01 +0200)]
Improvements to fix the build and for Doxygen

2 years agoImplement a fallback for Qt4
Janne Koschinski [Mon, 28 Aug 2017 02:47:29 +0000 (04:47 +0200)]
Implement a fallback for Qt4

2 years agoRemove debug message
Janne Koschinski [Mon, 28 Aug 2017 02:21:25 +0000 (04:21 +0200)]
Remove debug message

2 years agoMigrate password change RPC to the new target restriction system
Janne Koschinski [Mon, 28 Aug 2017 02:17:45 +0000 (04:17 +0200)]
Migrate password change RPC to the new target restriction system

2 years agoImplement peer-specific signal sending
Janne Koschinski [Mon, 28 Aug 2017 01:56:41 +0000 (03:56 +0200)]
Implement peer-specific signal sending

2 years agoMake the UI actually emit the required signal
Janne Koschinski [Mon, 28 Aug 2017 01:56:23 +0000 (03:56 +0200)]
Make the UI actually emit the required signal

2 years agoImplement RPC call to gracefully disconnect a client
Janne Koschinski [Mon, 28 Aug 2017 01:55:55 +0000 (03:55 +0200)]
Implement RPC call to gracefully disconnect a client

2 years agoImplement a basic UI for showing connected clients
Janne Koschinski [Sun, 27 Aug 2017 22:52:32 +0000 (00:52 +0200)]
Implement a basic UI for showing connected clients

2 years agoAdd initial implementation for showing and kicking connected clients
Janne Koschinski [Sun, 27 Aug 2017 02:29:53 +0000 (04:29 +0200)]
Add initial implementation for showing and kicking connected clients

Adds the possibility to show a list of connected clients, and allow
to kick other (or your own) clients of the same user.

2 years agoqa: Add [[fallthrough]] annotations where appropriate
Manuel Nickschas [Tue, 19 Dec 2017 21:37:45 +0000 (22:37 +0100)]
qa: Add [[fallthrough]] annotations where appropriate

Newer GCCs start to warn about this, so add attributes or rearrange
code as appropriate.

While the [[fallthrough]] attribute has only been standardized in
C++17, it should simply be ignored by older compilers (and it does
shut up GCC even when compiling with -std=c++11).

2 years agocmake: Output build type information; add policy
Manuel Nickschas [Tue, 19 Dec 2017 21:05:14 +0000 (22:05 +0100)]
cmake: Output build type information; add policy

CMake 3.10 added a new policy that triggers warnings when running
automoc on generated files.

2 years agocore: Fix inconsistent override/virtual usage
Manuel Nickschas [Tue, 19 Dec 2017 20:28:46 +0000 (21:28 +0100)]
core: Fix inconsistent override/virtual usage

Avoid compiler warnings due to this.

Closes GH-301.

2 years agoInitialize new buffers in the UI with their activity
Janne Koschinski [Tue, 19 Dec 2017 18:17:22 +0000 (19:17 +0100)]
Initialize new buffers in the UI with their activity

- Make Client::bufferSyncer public
- Load activity in NetworkItem::bufferItem from BufferSyncer::activity

2 years agoMake clearing flags more explicit
Janne Koschinski [Tue, 19 Dec 2017 17:30:48 +0000 (18:30 +0100)]
Make clearing flags more explicit

2 years agoImplement changes requested in review
Janne Koschinski [Tue, 19 Dec 2017 16:43:32 +0000 (17:43 +0100)]
Implement changes requested in review

2 years agocore: Fix Postgres bufferActivities() query typo
Shane Synan [Sat, 23 Sep 2017 22:39:08 +0000 (17:39 -0500)]
core: Fix Postgres bufferActivities() query typo

In PostgreSqlStorage::bufferActivities() use query
"select_buffer_bufferactivities" instead of the query for singular
buffer activity, "select_buffer_bufferactivity".

Fixes buffer activity state being lost on core restart.

2 years agoFix test for if the core supports activity sync
Janne Koschinski [Sat, 23 Sep 2017 09:29:27 +0000 (11:29 +0200)]
Fix test for if the core supports activity sync

2 years agoFix buffer activity sync between old core and new client
Janne Koschinski [Sat, 23 Sep 2017 08:34:41 +0000 (10:34 +0200)]
Fix buffer activity sync between old core and new client

A combination of an old core and new client would not show all
buffer activity that was expected.

2 years agoFix syntax error in SQL
Janne Koschinski [Sat, 23 Sep 2017 08:33:09 +0000 (10:33 +0200)]
Fix syntax error in SQL

Migration failed because of a syntax error in an SQL file.
13 columns were to be written to, but only 11 placeholders

2 years agoCorrectly remove buffers from the buffersyncer
Janne Koschinski [Fri, 22 Sep 2017 22:37:37 +0000 (00:37 +0200)]
Correctly remove buffers from the buffersyncer

I had forgotten to also remove buffers from the bufferactivity list
when they are being removed. This is now fixed.

2 years agoMake comparison explicit
Janne Koschinski [Fri, 8 Sep 2017 02:13:21 +0000 (04:13 +0200)]
Make comparison explicit

2 years agoReadd files lost during rebasing, fix minor issues
Janne Koschinski [Thu, 31 Aug 2017 23:57:42 +0000 (01:57 +0200)]
Readd files lost during rebasing, fix minor issues

2 years agoRemove debug messages
Janne Koschinski [Sun, 27 Aug 2017 02:00:45 +0000 (04:00 +0200)]
Remove debug messages

2 years agoMove the check if the core handles activities to the right place
Janne Koschinski [Sun, 27 Aug 2017 01:54:28 +0000 (03:54 +0200)]
Move the check if the core handles activities to the right place

2 years agoClarified minor details, again
Janne Koschinski [Sun, 27 Aug 2017 00:46:52 +0000 (02:46 +0200)]
Clarified minor details, again

2 years agoClarified minor details
Janne Koschinski [Sun, 27 Aug 2017 00:43:41 +0000 (02:43 +0200)]
Clarified minor details

2 years agoSeparate highlight handling
Janne Koschinski [Sun, 27 Aug 2017 00:15:32 +0000 (02:15 +0200)]
Separate highlight handling

2 years agoImplement client UI integration, add feature flag (0x400)
Janne Koschinski [Sun, 27 Aug 2017 00:02:29 +0000 (02:02 +0200)]
Implement client UI integration, add feature flag (0x400)

2 years agoChange buffer activity iterator initialization
Janne Koschinski [Sat, 26 Aug 2017 19:13:42 +0000 (21:13 +0200)]
Change buffer activity iterator initialization

2 years agoImplement buffer activity sync
Janne Koschinski [Sat, 26 Aug 2017 18:25:20 +0000 (20:25 +0200)]
Implement buffer activity sync

2 years agoUse Message::Types (which is QFlags<Message::Type>) instead of int
Janne Koschinski [Sat, 26 Aug 2017 00:07:23 +0000 (02:07 +0200)]
Use Message::Types (which is QFlags<Message::Type>) instead of int

2 years agoImplement database backend for buffer-activity patch
Janne Koschinski [Fri, 25 Aug 2017 21:09:00 +0000 (23:09 +0200)]
Implement database backend for buffer-activity patch

2 years agosql: Fix population of lastmsgid for empty buffers
Manuel Nickschas [Thu, 9 Nov 2017 22:23:22 +0000 (23:23 +0100)]
sql: Fix population of lastmsgid for empty buffers

Buffers may be empty, in which case the query to determine the last
message ID in them returns NULL, violating the constraint for the
newly introduced column. Use 0 instead.

Closes GH-315.

3 years ago Update translations from Transifex
Daniel Albers [Mon, 4 Sep 2017 22:06:39 +0000 (00:06 +0200)]
Update translations from Transifex

      26838 translated messages

    Many thanks to:
     - cs: Jaroslav Lichtblau <dragonlord@seznam.cz>
     - da: Joe Hansen <joedalton2@yahoo.dk>
     - el: Kostas Koudaras <warlordfff@gmail.com>
     - fi: Lasse Liehu <larso@gmx.com>
     - fr: Zoddo <transifex.com@zoddo.fr>
     - mr: Raju Devidas Vindane <rajuvindane@gmail.com>
     - pa: A S Alam <apreet.alam@gmail.com>
     - pt_BR: AndrĂ© Marcelo Alvarenga <alvarenga@kde.org>
     - ro: Sergiu Bivol <sergiu@cip.md>
     - ru: Viktor Suprun <popsul1993@gmail.com>
     - sl: Andrej Mernik <andrejm@ubuntu.si>
     - tr: Volkan Gezer <volkangezer@gmail.com>
     - uk: Yuri Chornoivan <yurchor@ukr.net>

3 years agoFix minor stylistic issues with the code 278/head
Janne Koschinski [Sun, 3 Sep 2017 20:41:00 +0000 (22:41 +0200)]
Fix minor stylistic issues with the code

Closes GH-278.

3 years agoAdd comment requested by @digitalcircuit
Janne Koschinski [Thu, 31 Aug 2017 23:14:05 +0000 (01:14 +0200)]
Add comment requested by @digitalcircuit

3 years agoImplement sender prefix storage in the database
Janne Koschinski [Thu, 31 Aug 2017 23:11:50 +0000 (01:11 +0200)]
Implement sender prefix storage in the database

* When processing a new message, find the mode the user that
  sent this message has in a channel (for example o or hv)
* Convert it to a prefix (for example @ or +%)
* Store this in a new sendermode column in the backlog table

Schema for both SQLite and PostgreSQL is updated.

3 years agoqtui: Add missing include
Manuel Nickschas [Mon, 4 Sep 2017 19:18:29 +0000 (21:18 +0200)]
qtui: Add missing include

QDir seems to be transitively pulled in on some, but not all Qt
versions we've encountered...

3 years agocommon: Fix isChannelName crash on empty string
Shane Synan [Mon, 4 Sep 2017 08:52:25 +0000 (03:52 -0500)]
common: Fix isChannelName crash on empty string

Add check to isChannelName for an empty string; return false if so
and don't try to index it.  This avoids crashing on connect for some

Closes GH-307.

3 years agocommon: Fix build with Qt4 and/or MSVC
Manuel Nickschas [Sun, 3 Sep 2017 23:43:24 +0000 (01:43 +0200)]
common: Fix build with Qt4 and/or MSVC

The previous commit caused a build failure for some combinations of
our build matrix, as QChar is not actually a literal usable in a
constexpr (unless you enable Qt5, for some bizarre reason...).

3 years agocommon: Make frequently called util methods more efficient
Manuel Nickschas [Sun, 3 Sep 2017 23:04:25 +0000 (01:04 +0200)]
common: Make frequently called util methods more efficient

Remove unnecessary temporary allocations and string copies in the
various methods in util.*, and avoid calling API functions that do
more than we need them to do in favor of an efficient implementation.

Ensure that frequently used QRegExp instances are created statically
and reused between invocations, so they can make use of JIT and other

As some of the affected methods are called *very* frequently, this
provides significant savings in terms of allocations, and
significantly reduces memory fragmentation as well.

Modernize some of the related code. Clean up includes, too.

3 years agoTrivia: Update URLs for Qt
Adriaan de Groot [Sat, 29 Apr 2017 14:55:26 +0000 (16:55 +0200)]
Trivia: Update URLs for Qt

Closes GH-291.

3 years agoDefault to unread backlog fetch if not changed
Shane Synan [Thu, 8 Sep 2016 02:08:49 +0000 (21:08 -0500)]
Default to unread backlog fetch if not changed

Use PerBufferUnread by default for backlog fetching rather than
PerBufferFixed.  In cases with many slow channels or multiple PMs,
this reduces the amount of backlog fetched on connect by ignoring
content already read.  This also increases the chances of seeing
highlights past the previous fixed limit of 500 lines.

This modifies new installs and existing configurations if the prior
default value wasn't changed.

In most cases, this should speed up connecting.  However, if
problematic, the version upgrade system should be used to preserve
old defaults for existing installs.

Closes GH-247.

3 years agoDon't terminate the core due to backend issues while setting up
Manuel Nickschas [Wed, 30 Aug 2017 21:50:54 +0000 (23:50 +0200)]
Don't terminate the core due to backend issues while setting up

If the authenticator or storage backend selected by the user during
core setup cannot be initialized, the problem shall be communicated
to the client and the user can start over; the core shall not exit
in this case. Ensure that failure to initialize the selected backends
only terminates the core if it's not being setup.

3 years agoFix layout issues in CoreConfigWizard; cleanup
Manuel Nickschas [Wed, 30 Aug 2017 21:43:45 +0000 (23:43 +0200)]
Fix layout issues in CoreConfigWizard; cleanup

Qt has trouble layouting widgets dynamically added to wizard pages,
so switch to using QStackedWidget for storage and authenticator
settings. Add size policies as needed and explicitly set the size of
all pages to fit the largest one to ensure that the wizard is large

While we're at it, clean up related code a bit.

Closes GH-170.

3 years agoLDAP authenticator now logs server address as info message
Ben Rosser [Mon, 19 Jun 2017 18:38:47 +0000 (14:38 -0400)]
LDAP authenticator now logs server address as info message

As requested by Zhoriel, the core now prints the full address and port
of the LDAP server it is connecting to, in order to make debugging
a little easier.

3 years agoFix issue from rebase; migrateTo now needs writer.get().
Ben Rosser [Sat, 27 May 2017 18:19:09 +0000 (14:19 -0400)]
Fix issue from rebase; migrateTo now needs writer.get().

3 years agoLDAP username case-insensivity
Tuetuopay [Mon, 6 Feb 2017 13:51:42 +0000 (14:51 +0100)]
LDAP username case-insensivity

This patches a case sensitivity issue in the core.

LDAP itself is case insensitive, but the LDAP module of the core will
keep the case of the usename when creating a local Quassel account.
Thus, if you login with the same username but using a different casing,
a new internal Quassel account will be creating, resulting in an
apparent settings loss (networks, ...).

The patch converts the username to lowercase before handing it to the

3 years agoFix quasseluser table setup on PostgreSQL and sort sql.qrc
Ben Rosser [Thu, 24 Nov 2016 23:51:11 +0000 (18:51 -0500)]
Fix quasseluser table setup on PostgreSQL and sort sql.qrc

It seems that at some point the DEFAULT option for a varchar()
column has become sensitive to whether or not single or double quotation
marks are used. In particular when ""s were used, core setup failed
with the message 'ERROR:  column "Database" does not exist'. Changing
to single quotation marks (''s) resolved the issue.

Also include @digitalcircuit's sorted version of sql.qrc.

Fix the upgrade script too.

3 years agotravis: Try to work around a build issue with LDAP on OSX
Manuel Nickschas [Tue, 1 Nov 2016 20:39:51 +0000 (21:39 +0100)]
travis: Try to work around a build issue with LDAP on OSX

Seems like the headers found in the OSX Frameworks are broken, so
try giving the include path explicitly.

3 years agoRework the handling of storage/auth backends and config
Manuel Nickschas [Tue, 1 Nov 2016 16:34:16 +0000 (17:34 +0100)]
Rework the handling of storage/auth backends and config

The legacy way of transmitting backend settings to the client
for initial core configuration was pretty weird, especially regarding
the setupKeys/setupDefaults mess that required guesswork on the
client side as of the property types. With the introduction of
authenticators, an opportunity presented itself to improve this.

Upon fixing this, I realized that lots of pretty crazy legacy code
was involved, and partially even duplicated for authenticator
handling. I could not keep myself from cleaning that up.
In the process, the affected parts of the code were modernized too,
leveraging Modern C++ and the STL where possible.

The setupKeys/setupDefaults properties of the backend info structs
are now deprecated and replaced by a setupData list of field IDs,
translatable display names, and default values/types. To keep
legacy clients working, the old properties are still transmitted
until the next protocol break.

3 years agocommon: Add Deferred{Unique|Shared}Ptr and helpers
Manuel Nickschas [Tue, 1 Nov 2016 16:23:44 +0000 (17:23 +0100)]
common: Add Deferred{Unique|Shared}Ptr and helpers

This commit adds smart pointers for holding QObject derivatives.
On destruction, they will deleteLater() the object they're holding.
This is the recommended and safe way for deleting QObject instances.
Be careful with using such smart pointers outside of the scope of
their parent, for objects that are owned. The parent will delete
its children, and any outside reference still held by a smart pointer
will lead to a double free!

3 years agoldap: Don't use the backend's display name as identifier
Manuel Nickschas [Sun, 23 Oct 2016 23:03:16 +0000 (01:03 +0200)]
ldap: Don't use the backend's display name as identifier

We'd like to have the display name translatable, so it should not
be used as an identifer. Instead, introduce a backendId property
for this purpose.

3 years agoldap: Use correct authenticator name for mono client
Manuel Nickschas [Sun, 23 Oct 2016 22:23:34 +0000 (00:23 +0200)]
ldap: Use correct authenticator name for mono client

Should be "Database" instead of "StorageAuth".

3 years agoldap: ConnectionProperties -> AuthProperties
Manuel Nickschas [Sun, 23 Oct 2016 22:21:05 +0000 (00:21 +0200)]
ldap: ConnectionProperties -> AuthProperties

This commit changes the settings key to something making slightly
more sense in the context of authentication.

3 years agoldap: Some cleanups for GH-170
Manuel Nickschas [Wed, 19 Oct 2016 21:17:47 +0000 (23:17 +0200)]
ldap: Some cleanups for GH-170

Mostly formatting and a few other bits.

3 years agoldap: Remove warnings
Manuel Nickschas [Thu, 13 Oct 2016 21:25:12 +0000 (23:25 +0200)]
ldap: Remove warnings

3 years agoRe-add the ":authenticator" property to insert_quasseluser.sql
Ben Rosser [Fri, 9 Sep 2016 06:29:06 +0000 (02:29 -0400)]
Re-add the ":authenticator" property to insert_quasseluser.sql

This was removed during the rebase commits.

3 years agoAuthenticator code cleanup as per review
Ben Rosser [Fri, 9 Sep 2016 05:27:27 +0000 (01:27 -0400)]
Authenticator code cleanup as per review

* Standardized on "authenticator" rather than "authBackend"
* Removed XXXs and replaced with TODO or FIXME comments appropriately
* Fixed a couple whitespace errors
* Cleared up some comments in the ldap cmake
* In the authenticator code, renamed displayName to backendId
* Added missing newline at the end of authenticator.cpp

3 years agoAttempt to link against openldap on Windows, too
Ben Rosser [Tue, 2 Feb 2016 18:28:00 +0000 (13:28 -0500)]
Attempt to link against openldap on Windows, too

Rewrite cmake module to remove special case for Windows.

Added some (commented out) example code to ldapauthenticator as
how we'd need to link against winldap.h, but the implementations
are sufficiently different that it's probably a waste of time.

3 years agoAdd --select-authenticator switch to core
Ben Rosser [Mon, 1 Feb 2016 00:17:46 +0000 (19:17 -0500)]
Add --select-authenticator switch to core

The select-authenticator switch now behaves exactly like the
select-backend switch for storage backends, allowing the user to
reconfigure their authenticator from the commandline or do initial
core setup.

Initial core setup should look something like this now:
quasselcore -c _dir_ --select-backend=SQLite --select-authenticator=Database

3 years agoFix a couple of whitespace errors in core.{cpp,h}
Ben Rosser [Mon, 4 Jan 2016 22:00:22 +0000 (17:00 -0500)]
Fix a couple of whitespace errors in core.{cpp,h}

3 years agoAdd authenticator column to quasseluser migration table
Ben Rosser [Sat, 2 Jan 2016 20:18:04 +0000 (15:18 -0500)]
Add authenticator column to quasseluser migration table

Commit these too.

3 years agoAdd password changing checks
Ben Rosser [Fri, 1 Jan 2016 20:43:07 +0000 (15:43 -0500)]
Add password changing checks

Don't allow passwords to be changed if it's forbidden by the auth

3 years agoAdd authenticator column to quasseluser table
Ben Rosser [Wed, 30 Dec 2015 06:23:26 +0000 (01:23 -0500)]
Add authenticator column to quasseluser table

... as additional cross-check when logging in a user.

This will default to storage-based auth.

3 years agoFirst attempt local auth, then try external provider
Ben Rosser [Mon, 28 Dec 2015 22:18:45 +0000 (17:18 -0500)]
First attempt local auth, then try external provider

3 years agoDelete authenticators in core destructor too
Ben Rosser [Thu, 24 Dec 2015 21:37:40 +0000 (16:37 -0500)]
Delete authenticators in core destructor too