Manuel Nickschas [Mon, 3 Sep 2018 23:18:10 +0000 (01:18 +0200)]
clang-tidy: Reorder NetworkInfo attributes to avoid excessive padding
Use a more optimal attribute order to avoid excessive padding in the
NetworkInfo struct.
Remove the default constructor in favor of direct initialization.
Rewrite the comparison operator using a boolean expression instead
of a bunch of conditions.
alturiak [Mon, 3 Sep 2018 18:35:20 +0000 (20:35 +0200)]
cipher.cpp: Default to CBC instead of ECB
For security reasons (and compatibility to other irc-client's implementations), default to CBC for blowfish encryption.
Shane Synan [Mon, 3 Sep 2018 04:36:23 +0000 (23:36 -0500)]
common: Add "--debug-irc" to log raw IRC messages
Add "--debug-irc" command-line option to Core and Monolithic to log
raw IRC messages to the log at Debug level.
Check for raw IRC logging in CoreNetwork and IrcParser, logging
anything sent and received with the Network ID and "<<" for received,
">>" for sent.
Add "--debug-irc-id" to limit raw logging to a specific Network ID,
handy for cores with multiple networks. This option automatically
applies "--debug-irc".
These usually should be combined with "--loglevel Debug", though the
Monolithic build can show raw IRC messages in the "Debug Log" GUI
without setting that parameter.
CAUTION: "--debug-irc" will leak all IRC passwords in plain text via
any configured logging receivers (file, syslog, etc) and should not
be used on production servers without taking special care to limit
access to logging output.
Note: The ideal approach is to have the core maintain the most recent
raw IRC logs on a rotating basis, allowing any client to request this
portion of logs on demand. However, there's a lot more changes
involved, which might not be wise with the goal of stabilizing 0.13.
We should revisit this in the future.
Manuel Nickschas [Wed, 29 Aug 2018 20:11:46 +0000 (22:11 +0200)]
client: Don't store the list of properties in every PropertyMapItem
It's rather inefficient to store a QStringList in every item, since
it is the same for every type of item anyway. Use a pure virtual
accessor in the base class instead, and return a static QStringList
in every item type.
This prevents the usecase of adding properties dynamically after
creation, but we didn't use that feature anyway, so remove it.
Manuel Nickschas [Wed, 29 Aug 2018 19:02:41 +0000 (21:02 +0200)]
client: Don't send dataChanged() before actually changing the data
The PropertyMapItem didn't set a changed property before sending
the signal, so consumers synchronously reacting to dataChanged()
would still access the old value.
Not sure if this issue is the cause for some of the weird model
behavior we tend to see at times...
Shane Synan [Sat, 1 Sep 2018 21:37:32 +0000 (16:37 -0500)]
common: Port local nicks to NickHighlightMatcher
Port QtUiMessageProcessor nick highlights to NickHighlightMatcher
class, providing easy caching and simplifying expression handling.
This fixes nickname caching being reset when switching between
networks.
Add SIGNAL/SLOT traversal to pass on information about network
removal to clean up per-network nickname highlight caches, avoiding
memory leaks.
Shane Synan [Sat, 1 Sep 2018 21:36:45 +0000 (16:36 -0500)]
common: Port remote nicks to NickHighlightMatcher
Port HighlightRuleManager nick highlights to NickHighlightMatcher
class, providing easy caching and simplifying expression handling.
This fixes nickname caching being reset when switching between
networks.
Add SIGNAL/SLOT traversal to pass on information about network
removal to clean up per-network nickname highlight caches, avoiding
memory leaks.
Shane Synan [Sat, 1 Sep 2018 21:33:03 +0000 (16:33 -0500)]
common: Add auto-caching NickHighlightMatcher
Add NickHighlightMatcher class to unify handling of nick highlight
matching in Quassel, including automatically updating the expression
matcher instance as needed per network.
Cached ExpressionMatch objects are updated on demand after any change
in nickname configuration or active/configured nicks.
This lays the foundation for performance and readibility improvements
in future commits.
Shane Synan [Sat, 1 Sep 2018 21:30:51 +0000 (16:30 -0500)]
util: Remove unused and broken scopeMatch()
Remove scopeMatch() from util.cpp - not only is it no longer needed,
superseded by ExpressionMatch, the scopeMatch behavior broke previous
Quassel functionality.
Details: Channel names can begin with "!", and scopeMatch() does not
support escaping "!" in the beginning of rules. Escaping support
needs to be added.. but ExpressionMatch can now handle this. Let us
keep the ugly parser loops confined to one place...
Shane Synan [Sat, 1 Sep 2018 21:29:02 +0000 (16:29 -0500)]
client: Port old HighlightRule to ExpressionMatch
Port QtUiMessageProcessor HighlightRule objects to ExpressionMatch
class, providing easy caching and simplifying expression handling.
Migrate HighlightRule struct into a full-blown class for easier
management and greater assurance over automatic internal cache
management.
Port QtUiMessageProcessor to ExpressionMatch for nickname matching,
providing easy caching and simplifying expression handling.
Add tons of documentation comments, too, and fix up line lengths.
NOTE: Legacy highlight rules lack support for "sender", "ID", and
inverse rules. There's no technical reason for this, just lack of
developer time. Feel free to add support in the future! Just make
sure to not miss any part - I'd suggest simply replacing the legacy
LegacyHighlightRule class in QtUiMessageProcessor with the full one
from HighlightRuleManager, and don't forget to fix
> QtUiMessageProcessor::HighlightRule::operator!=()
...and...
> QtUiMessageProcessor::HighlightRule::determineExpressions()
Shane Synan [Sat, 1 Sep 2018 21:17:33 +0000 (16:17 -0500)]
common: Fix whitespace CTCP ignore invalid index
When constructing a CTCP ignore, check that splitting on whitespace
results in non-empty list before taking from the list. If it's
empty, fall back to assuming any valid sender, i.e. "*"/".*"
depending on whether the rule is set as wildcard or regex.
This fixes issues when receiving a CTCP with an invalid CTCP ignore
rule such as " ".
Shane Synan [Sat, 1 Sep 2018 21:40:21 +0000 (16:40 -0500)]
common: Port IgnoreListManager to ExpressionMatch
Port IgnoreListItem objects to ExpressionMatch class, providing easy
caching and simplifying expression handling.
Migrate IgnoreListItem struct into a full-blown class for easier
management and greater assurance over automatic internal cache
management.
Add tons of documentation comments, too, and fix up line lengths.
Thanks to @sandsmark for the initial efforts towards the
QRegularExpression migration; it helped a lot!
Shane Synan [Sat, 1 Sep 2018 21:02:00 +0000 (16:02 -0500)]
common: Port HighlightRule to ExpressionMatch
Port HighlightRule objects to ExpressionMatch class, providing easy
caching and simplifying expression handling.
Migrate HighlightRule struct into a full-blown class for easier
management and greater assurance over automatic internal cache
management.
Port HighlightRuleManager to ExpressionMatch for nickname matching,
providing easy caching and simplifying expression handling.
(Noticing a theme?)
Add tons of documentation comments, too, and fix up line lengths.
Shane Synan [Sat, 1 Sep 2018 20:53:16 +0000 (15:53 -0500)]
client: Handle newlines in Ignore rule scope edit
Handle "\n" and ";" as separator in scope rules. This fixes using
newlines in the Configure Ignore Rule dialog.
Make use of ExpressionMatch::trimMultiWildcardWhitespace() to handle
all of the arcane details, unifying code into one place.
Shane Synan [Sun, 2 Sep 2018 07:39:30 +0000 (02:39 -0500)]
common: Add ExpressionMatchTests unit tests
Add ExpressionMatchTests class to test the functionality of
ExpressionMatch, helping ensure it works across Qt 4 and Qt 5.
This is implemented as a series of Q_ASSERT()'s as Quassel does not
yet have an actual testing framework. Once a test framework is
settled on, this class can be migrated to unit tests.
To use ExpressionMatchTests:
1. Include it in "quassel.cpp"
2. Call ExpressionMatchTests::runTests() near end of Quassel::init()
// DEBUG: Run tests!
ExpressionMatchTests::runTests();
Shane Synan [Sun, 2 Sep 2018 16:52:12 +0000 (11:52 -0500)]
common: Add auto-caching ExpressionMatch class
Add ExpressionMatch class to unify handling of various search
expressions in Quassel, including automatically caching the regular
expression instances and providing Qt 4/5 compatibility.
The source expression depends on the matching mode:
* ExpressionMatch::MatchPhrase
Match the entire phrase, looking for whitespace or beginning/end
around either side of the phrase. No further processing.
* ExpressionMatch::MatchMultiPhrase
Same as MatchPhrase, but split the expression on newlines ("\n") and
treat as match successful if any phrase is found. This avoids having
to create multiple ExpressionMatch classes just to match multiple
phrases.
* ExpressionMatch::MatchWildcard
Split on ";" and newlines ("\n"), and apply basic wildcard globbing,
with "*" representing any characters and "?" a single character.
Prefixing a section with "!" turns it into an invert-match, negating
any other matching rules. If only invert-match rules exist, matching
is true unless an invert-rule applies. "\[...]" escapes the given
character.
* ExpressionMatch::MatchRegEx
Treat expression as a regular expression, inverting if prefixed with
"!" (and not escaped as "\!").
Cached regular expression objects are updated whenever changing any
parameters.
When Qt 4 support is dropped, the QT_VERSION macros can be adjusted.
This lays the foundation for performance and readibility improvements
in future commits.
Shane Synan [Thu, 23 Aug 2018 03:41:23 +0000 (22:41 -0500)]
client: Fix .ui reference to oxygen_icons.qrc
Fix ignorelisteditdlg.ui's reference to oxygen_icons.qrc, pointing it
to the new location.
Hannah von Reth [Thu, 30 Aug 2018 21:04:53 +0000 (23:04 +0200)]
We don't need dbus on Windows
Hannah von Reth [Thu, 30 Aug 2018 21:02:15 +0000 (23:02 +0200)]
Don't install clang on appveyor
Manuel Nickschas [Wed, 29 Aug 2018 20:35:18 +0000 (22:35 +0200)]
macos client: Fix copyright year in Info.plist
Davide `rainbow` Gerhard [Wed, 29 Aug 2018 14:37:06 +0000 (16:37 +0200)]
macos client: fix automatic GPU switching
see https://codereview.qt-project.org/#/c/73839/
Shane Synan [Thu, 23 Aug 2018 02:36:47 +0000 (21:36 -0500)]
core: Limit "User is away" to 1hr or when changed
Increase the "* User is away" silencing to one hour, and add tracking
for changes in away state. Only print the "* User is away" if away
state has changed since last away message (including removing and
applying the same away message), or if 1 hour has elapsed.
This reduces the spamming of "* User is away" when one often knows
that, yes, the user is away. Any change in away state or message
will still be shown.
Shane Synan [Thu, 23 Aug 2018 00:34:40 +0000 (19:34 -0500)]
common: Unify Date/Time formatting, UTC offset
Unify date/time formatting for the client UI, using
Qt::DateFormat::DefaultLocaleShortDate to respect the operating
system's configured locale. This avoids Qt's kind-of-weird default
date/time format that mixes numbers and named short months/days.
See https://doc.qt.io/qt-5/qt.html#DateFormat-enum
Modify AM/PM detection to use application locale, which currently
defaults to system locale. This avoids any inconsistencies should
Quassel later allow specifying an application-wide locale different
from the system locale.
In CTCP VERSION replies, always use UTC time in ISO8601 date format,
avoiding locale-specific replies and timezone differences. This
fixes client version statistic-tracking software from treating
different languages and different timezones as unique versions of
Quassel IRC.
In CTCP TIME replies, use local time in ISO8601 date format with
timezone offset. This provides a consistent format for others to
parse and still provides the timezone information.
Work around a Qt bug for the latter.
See https://bugreports.qt.io/browse/QTBUG-26161
And https://stackoverflow.com/questions/
18750569/qdatetime-isodate-with-timezone
Shane Synan [Wed, 22 Aug 2018 21:46:01 +0000 (16:46 -0500)]
settings: Fix defaults caching, cache key exists
Add separate cache of whether or not a settings key is persisted to
disk, separate from the cache of settings key values. Modify
localKeyExists() to make use of this cache, offering a potential
slight performance boost.
Fix caching of default values as actual settings values by always
checking if the key is persisted to disk, returning the default value
if not.
This fixes ChatMonitorSettings's "OperationMode" getting set to
"InvalidMode" by ChatMonitorFilter::_operationMode's reading of a
default "InvalidMode", then when loading settings,
ChatMonitorSettingsPage::settings["OperationMode"] would incorrectly
default to "InvalidMode" instead of "OptOut".
Test case:
1. Start with a fresh configuration.
2. Open Chat Monitor settings, skipping first-run wizard/etc
3. Check that "Opt Out" is the default mode
4. Via qDebug() prints, check that ChatMonitorFilter still sees the
default value as InvalidMode
Shane Synan [Wed, 22 Aug 2018 20:43:23 +0000 (15:43 -0500)]
settings: Unify ChatMonitor defaults
Sync ChatMonitor defaults among the three different places to specify
them. Add a comment to explain.
Unify on disabling showing read messages, enabling showing own
messages.
Shane Synan [Tue, 7 Aug 2018 17:01:39 +0000 (12:01 -0500)]
client: Fix duplicated query quit messages
Replace the .contains() check with std::binary_search on message
timestamps, passing a custom comparator that provides +/- 1000 ms of
fuzzy matching. If a quit message is received and doesn't exist
within this time range, it gets forwarded to the query, otherwise
discarded.
Remove the QMultiHash method that tracked quit nicknames. Each query
gets a unique MessageFilter, so there's no need to store and filter
that. This will need modified if e.g. adding an option for quit
messages in the Chat Monitor.
This fixes an existing bug made much worse with millisecond timestamp
precision. Before the 64-bit time changes, quit messages would only
be duplicated if they got split over the turn of a second, a rare
occurrence. Afterwards, they'd get duplicated if split over the turn
of a millisecond, a much more common occurrence.
Fixes regression from commit
6a63070246d89aa2a2474e3a9a1035fa889ad77e
Manuel Nickschas [Tue, 24 Jul 2018 21:20:45 +0000 (23:20 +0200)]
qtui: Properly render hovered-upon clickables
Additional formats given to QTextLayout::draw() are not cumulative.
Since we were using this feature for rendering both selections and
active (hovered-upon) clickables, things would break when both
overlapped. In particular, a highlighted *and* selected URL would
vanish while being hovered.
Fix this by explicitly calculating the range of affected formats
for both selections and active clickables, taking overlap into
account. Remove special handling in ContentsChatItem in favor of
the more generic solution.
Use the newly-introduced "hovered" message label to determine how
an active clickable should be rendered, rather than hardcoding
an underline.
Manuel Nickschas [Tue, 24 Jul 2018 21:19:27 +0000 (23:19 +0200)]
qss: Introduce new message label "hovered"
In order to make the appearance of hovered-upon URLs controllable
by stylesheet, add support for a new message label "hovered".
Extend the default stylesheet to underline hovered-upon URLs.
Manuel Nickschas [Tue, 24 Jul 2018 21:29:18 +0000 (23:29 +0200)]
qss: Disable color codes in highlighted messages in the default QSS
Colored text in highlighted messages may be hard to read due to
the changed background color. Disable overriding the highlight
text color in the default stylesheet.
Custom stylesheets can still enable color codes again by setting
the allow-foreground-override property to true.
Manuel Nickschas [Wed, 22 Aug 2018 23:46:43 +0000 (01:46 +0200)]
qa: Remove [[clang::fallthrough]] annotations again
These cause warnings in most compilers, so remove them again until
we can use C++17 and the official attribute.
Add comments, so we know the fallthroughs are intentional anyway.
Shane Synan [Wed, 22 Aug 2018 01:51:40 +0000 (20:51 -0500)]
core: Remove leftover getAuthUserName and SQL
Remove Storage::getAuthUserName(), including PostgreSQL and SQLite.
Remove the corresponding select_authusername.sql files, too.
This avoids unused code and may avoid confusion in the future. Any
time a username-for-ID is needed, Core::_authUserNames should be
consulted instead.
NOTE: Before using Core::_authUserNames, public functions should be
created and caching should always be done on core startup, instead of
only when --strict-ident mode is enabled.
Shane Synan [Tue, 7 Aug 2018 22:25:16 +0000 (17:25 -0500)]
settings: Reset Network SASL status on load
Explicitly reset IRCv3 capability-based network settings whenever
loading network IDs. This should help guard against situations where
setNetworkCapStates() does not get called with a NetworkId when
loading, resulting in the template text being left visible.
Shane Synan [Mon, 6 Aug 2018 21:31:48 +0000 (16:31 -0500)]
settings: Local Highlights, default Current nick
Re-enable nickname highlighting in Local Highlights by default. This
fixes the issue of upgrading the client before the core resulting in
loss of nickname highlighting.
Many other options were discussed, such as unifying these settings
(new UI work), automatically toggling/disabling local based on core
features, auto-importing, etc, and though all better approaches, they
will take a good bit more time to implement correctly. The focus is
on fixing client-side settings properly in 0.14+, with profiles
allowing for different settings per groups of clients, allowing
deprecation of local highlights entirely.
Partial revert of
f2e4560b71a1888599ca2153eee36a9b4136c902 and
5fcc2f000757bb7c2578e09c8fc8c86a288c3cb5
Shane Synan [Mon, 6 Aug 2018 21:30:33 +0000 (16:30 -0500)]
settings: Local Highlights, clean up nick case UI
Modify the Qt UI page to match the actual default. Not needed, but
it's nicer to see the result when designing.
Hannah von Reth [Mon, 6 Aug 2018 08:51:55 +0000 (10:51 +0200)]
Cleanup appveyor artifact upload
romibi [Fri, 3 Aug 2018 18:47:13 +0000 (20:47 +0200)]
Use Qt's font dialog instead of the (broken) native OSX one
Manuel Nickschas [Wed, 25 Jul 2018 20:26:59 +0000 (22:26 +0200)]
uisupport: Allow to disable spell checking
Apparently, Sonnet, when used standalone (i.e. not in KTextEdit),
does not honor its own setting to disable it by default.
Explicitly read the setting when initializing the highlighter, and
set its active state accordingly. Provide a context menu option
to enable/disable spell check on-the-fly as well.
Remove the bogus/unused checkbox in the InputWidget settings page;
there is a dedicated settings page for configuring spell checking.
Explicitly depend on Sonnet when building with KDE Frameworks
(it was transitively depended upon anyway), so we can be sure to
offer the Sonnet settings page even when using Frameworks.
Manuel Nickschas [Thu, 23 Aug 2018 00:08:50 +0000 (02:08 +0200)]
core: Fix build without SSL
Seems like an #ifdef was overlooked.
Manuel Nickschas [Wed, 22 Aug 2018 23:50:08 +0000 (01:50 +0200)]
qa: Remove bogus self-assignment
Mike Gilbert [Sat, 11 Aug 2018 19:06:00 +0000 (15:06 -0400)]
Set RUNTIME_OUTPUT_DIRECTORY instead of abusing OUTPUT_NAME
This resolves an error when building with ninja:
ninja: error: build.ninja:4374: multiple rules generate quasselcore
Hannah von Reth [Fri, 27 Jul 2018 08:32:56 +0000 (10:32 +0200)]
Use new blueprint repo craft-blueprints-quassel
Jan Alexander Steffens (heftig) [Thu, 19 Jul 2018 21:04:44 +0000 (23:04 +0200)]
QtUiStyle: Support more font weights
The chosen expression is more or less an inverse of the CSS weights to
QFont::Weight translation in the QssParser.
Jan Alexander Steffens (heftig) [Thu, 19 Jul 2018 21:00:52 +0000 (23:00 +0200)]
QssParser: Don't interpret `font: normal` as weight 0
It fell through to the unchecked int conversion.
Also handle "strikethrough" and don't forget to reset the underline
style.
Jan Alexander Steffens (heftig) [Thu, 19 Jul 2018 20:51:54 +0000 (22:51 +0200)]
QssParser: Interpret "oblique" as italic
This is better than nothing.
Manuel Nickschas [Thu, 21 Jun 2018 21:35:52 +0000 (23:35 +0200)]
Bump version for release
Manuel Nickschas [Thu, 21 Jun 2018 21:33:55 +0000 (23:33 +0200)]
Update ChangeLog
Michael Marley [Wed, 18 Jul 2018 00:09:15 +0000 (20:09 -0400)]
Update inxi to 3.0.18
Shane Synan [Tue, 17 Jul 2018 18:28:06 +0000 (13:28 -0500)]
client: Clarify highlight 'Channel' functionality
Modify 'Channel' column tooltip to mention 'channel/query', since
this actually refers to buffer name. As it's less likely someone
will want to set highlights on queries as they trigger notifications
by default, don't rename the column itself.
Shane Synan [Tue, 17 Jul 2018 18:03:52 +0000 (13:03 -0500)]
common: Empty highlight name matches all messages
Don't force core-side highlight rules to have non-empty names,
allowing for matching all messages by leaving the name empty.
Requires core and client support, but as this has not been in a
released version, and it's near release, backwards-compatibility
shouldn't be required.
Update tooltips to note this. (After cleanup, only a single change!)
This wasn't easily possible before as highlight names were the
identifier for the highlight rule. Now that we have IDs for
highlight rules, there's no need to force names to be non-empty.
NOTE: This could cause confusion, but the flexibility in not having
to use RegEx for the sake of matching every message seems worth the
risk of people unintentionally setting empty highlight rules that
match every message.
Local highlights are not changed as they don't have IDs.
Shane Synan [Tue, 17 Jul 2018 17:58:04 +0000 (12:58 -0500)]
client: Fix CoreHighlightSettings Sender resize
Set CoreHighlightSettingsPage::SenderColumn to ResizeToContents,
matching the other columns. This was likely missed when originally
adding this column.
Shane Synan [Tue, 17 Jul 2018 17:56:10 +0000 (12:56 -0500)]
client: Unify CoreHighlightSettingsPage tooltips
Move setting tooltips to a generic function, setupTableTooltips(), to
keep tooltips consistent. This fixes outdated tooltips in the
highlight ignore rules table and reduces duplication.
Add another function getTableTooltip() for getting the tooltips
themselves. Unfortunately, QTableWidgetItem does not inherit from
QWidget, so function overloading (or equivalent) is necessary. Alas,
std::variant is C++17...
Manuel Nickschas [Tue, 17 Jul 2018 21:03:13 +0000 (23:03 +0200)]
cmake: Enable exceptions when building with KDE support
The KDE cmake integration disables exceptions by default. Enable
exceptions explicitly in the build system so our code builds.
Manuel Nickschas [Sun, 15 Jul 2018 21:48:32 +0000 (23:48 +0200)]
core: Improve handling of core initialization errors
Since the event loop may not be running while the core is being
initialized, calling exit() does not have the desired effect.
Instead, throw an exception with exit code and error message to
be able to handle this correctly. Exceptions must not be thrown
through the event loop, so ensure that they're caught before in
cases where the event loop was started already.
For the monolithic client, introduce an asynchronous init method
that catches potential exceptions and calls exit() instead. Show
an error popup in the UI if an error message is provided, so the
user gets some feedback before the client is terminated.
Shane Synan [Mon, 16 Jul 2018 21:47:37 +0000 (16:47 -0500)]
core: Fix highlight nick config save/load
Modernize CoreHighlightRuleManager to use the conventions of
DccConfig, saving/loading via SyncableObject serialization handling
for load/save.
This simplifies the code and fixes highlight nick configuration
(highlightNick, nicksCaseSensitive) not being persisted after core
restart.
Add some documentation, too.
Fixes regression from
17c39210b1bce04795046657642de66292518fe6.
Shane Synan [Mon, 16 Jul 2018 21:47:29 +0000 (16:47 -0500)]
client: Fix lost unsaved highlights on Import
Save highlights before importing if changes exist to avoid losing
any unsaved rules when loading the highlight rule list from the
client.
Test case:
1. Have at least 1 local highlight rule
2. Add remote highlight rule, don't save
3. Import local highlights
4. Unsaved highlight rule gets deleted
Shane Synan [Mon, 16 Jul 2018 20:49:01 +0000 (15:49 -0500)]
chatmonitor: Always -> "Include ignored buffers"
Change the display string for 'alwaysOwn' from "Always" to
"Include ignored buffers", matching the option
"Include read messages".
No functional change, just minor UI tweak before string freeze.
Jan Alexander Steffens (heftig) [Mon, 16 Jul 2018 11:19:06 +0000 (13:19 +0200)]
Chat Monitor: Add option to always include own messages
Jan Alexander Steffens (heftig) [Mon, 16 Jul 2018 11:08:24 +0000 (13:08 +0200)]
ChatMonitorFilter: Refactor conditions
No functional change.
Matt Schatz [Sun, 1 Jul 2018 05:16:03 +0000 (23:16 -0600)]
Attempt to improve the /LIST timeout for large lists
Prior to this, the timer was simply running for 10 seconds from the
start of the query; which could timeout even while data was being received.
Large channel lists (i.e. Freenode) would over-run into the status buffer.
Now we utilize QBasicTimer to create a timer that can be easily
restarted everytime we receive a RPL_LIST. Inital timeout is 5 seconds
and 5 seconds after each RPL_LIST. We also now remove the timer after
receiving a RPL_LISTEND instead of letting it tick.
Shane Synan [Thu, 12 Jul 2018 01:13:22 +0000 (20:13 -0500)]
common: Fix BufferViewConfig upgrade defaults
Fix initialization of default values when upgrading BufferViewConfig.
This solves the issue of showSearch() being set to true on upgrade
despite having the default of false.
Search doesn't usually need shown as the activate shortcut will make
it temporarily appear.
Details: When loading a buffer from configuration, the
"fromVariantMap(properties);" path was taken. As this side lacked
the initialization, defaults weren't set for newly-added values.
Thankfully, it really is just this simple (fingers crossed).
Add some documentation love, too.
Shane Synan [Fri, 22 Jun 2018 01:56:14 +0000 (20:56 -0500)]
client: /list automatically requests channel list
When using "/list" or "/list <params" to open Channel List dialog,
automatically request the channel list. This mimics the behavior
before the UI interception and minimizes effort needed to use the
dialog.
Shane Synan [Fri, 22 Jun 2018 01:46:54 +0000 (20:46 -0500)]
client: Set Channel List input focus, sort A-Z
Set Channel List input focus to reasonable defaults. When advanced
channel search is visible, focus it. Otherwise, focus the channel
list filter box.
Sort channel list by name in ascending order by default. Sort order
can be changed afterwards as before.
Shane Synan [Fri, 22 Jun 2018 01:44:50 +0000 (20:44 -0500)]
client: Convert /list #chan to UI advanced search
Pass "/list" parameters to ChannelListDlg when opening, allowing for
"/list #channel", <Enter> to search in a similar fashion to current
stable release.
Add documentation to the showChannelList()/related functions.
Prompt when "/list" is called without a valid network selected. This
fixes running "/list" before any networks are selected resulting in a
channel list dialog that wouldn't do anything.
Manuel Nickschas [Wed, 20 Jun 2018 23:36:27 +0000 (01:36 +0200)]
logger: Refactor the logging framework
* Rename the previous Logger class to LogMessage (since that is what
it is), and consolidate logging functionality, including the
various output methods, setup of log file etc., into a new
Logger class.
* Hold the "debug log", i.e. the collected log messages, in the Logger
class instead of in the Client. Adapt the DebugLogWidget accordingly.
Messages will not be kept in quasselcore, as we wouldn't have a way
to display them otherwise (and we don't want to accumulate lots of
data over months of the core running).
* Support early log messages. Instantiate the Logger right at the
start of main(), and keep all log messages until the Quassel class
is initialized and we can rely on command-line options to configure
backends accordingly. Accumulated messages will be output once the
Logger is configured.
Manuel Nickschas [Tue, 10 Jul 2018 23:40:41 +0000 (01:40 +0200)]
qtui: Remove bogus Quassel instance
A remnant from refactoring, QtUiApplication carried a useless
attribute of type Quassel. This would of course create a second
instance of the singleton, which is not a Good Thing™.
Remove the bogus attribute to ensure that Quassel is only created
once.
Shane Synan [Fri, 22 Jun 2018 05:18:09 +0000 (00:18 -0500)]
client: Fix settings upgrade missing some steps
Remove cache check in Settings::localKeyExists(). This fixes
settings version upgrade wrongly skipping some steps due to earlier
migration steps causing default values (not stored in .conf) to be
loaded into settings cache. Most notably, creating/writing the
QtUiStyle settings Qt StyleSheet.
The symptoms are only visible when migrating multiple steps at once,
hence not catching this earlier.
Bug originally introduced in
d2ac8f78a0e050d2efa397c434b249d6b3391576
Manuel Nickschas [Thu, 21 Jun 2018 20:16:43 +0000 (22:16 +0200)]
qtui: Remove remnant from debugging icon loading
Good old eye...
Manuel Nickschas [Wed, 20 Jun 2018 20:12:25 +0000 (22:12 +0200)]
quassel: Install signal handlers in init() rather than ctor
Unix signal handlers require e.g. command line options, which are
not available at construction time of the Quassel instance.
Move signal handler registration into init().
Add TODO comments to remind us of the fact that we're not supposed
to use unsafe methods in signal handlers (which we currently do),
and should rework signal handling to be safe.
Shane Synan [Wed, 20 Jun 2018 09:05:10 +0000 (04:05 -0500)]
client: Use sentence case for Core Info details
Use sentence case for CoreSessionWidget `Version date:` and
`Connected since:`, providing consistency with the core information.
Use sentence case for `Connected clients:`, too.
`Version date:` was the inconsistent one by majority, but (in my
subjective opinion) it looks nicer.
Shane Synan [Wed, 20 Jun 2018 09:05:00 +0000 (04:05 -0500)]
common: Make CommitDate Unix epoch, handle legacy
Leave CommitDate (BuildDate) in Unix epoch format, converting it on
demand when displayed. This allows clients to localize the time
shown.
Add tryFormatUnixEpoch, which checks a string for Unix epoch, parsing
as date/time if possible, otherwise letting the string through. This
avoids breaking protocol or any existing packaging scripts that set
commit date to a string.
Check for empty commit/build dates when using them, replacing with
"Unknown date" or "unknown" as appropriate. Don't encode this in
Quassel::setupBuildInfo() to allow for location-specific treatment
and client-side translation.
Michael Marley [Tue, 19 Jun 2018 16:45:44 +0000 (12:45 -0400)]
Fix default port for integrated ident daemon
The value for the option identifier was missing, causing what was
intended to be the default value to actually become the identifier
and the default value to be undefined. This resulted in random
ports being chosen.
Shane Synan [Tue, 19 Jun 2018 02:58:41 +0000 (21:58 -0500)]
core: Fix oidentd signal connection, cleanup
Update OidentdConfigGenerator signal connections, adding the missing
socketId added in commit
41b9d689945e784b160a25d12076600ff4b7ae90 .
This fixes a warning about signals/slots not matching up.
Thanks to @genius3000 for finding this issue!
Clean up line length and spacing while we're here.
Shane Synan [Tue, 19 Jun 2018 02:37:06 +0000 (21:37 -0500)]
common: Use UTF-8 server encoding by default
Switch to UTF-8 as default codec for server. This fixes non-ASCII
characters in /away messages and other situations silently being
converted to question marks.
Don't modify default Decoding codec as UTF-8 is automatically used
there when needed.
Update tooltips to offer guidance on restoring server encoding.
NOTE 1: If client is upgraded without core being upgraded, client
will wrongly show UTF-8 as the default for server encoding. The
older core still uses the past encoding, and manually specifying
UTF-8 as the selected encoding still works.
NOTE 2: This affects all networks that have not yet set a custom
encoding. A migration would require core-side in-database settings
versioning and reading/writing from database. It might be better to
mention this on the release notes.
This is a matter of trade-offs. Invalid encoding can result in error
messages or server disconnecting, confusing but noisy. However, too
limited of an encoding simply silently converts characters to
question marks, in e.g. /away messages or nicks. No warnings are
printed.
Is the IRC world ready for UTF-8 by default as a server encoding?
Well.. that's hard to say. This can be overridden per-network
(even with an old client!), and this commit is also easily reverted.
It's probably worthwhile trying in beta, reverting before release if
too many things break. IRC servers should at least provide error
messages.
(I personally think it's time to switch. Partially since it took me
1-2 years before finding out this is why I couldn't join UTF-8
channels on a certain network. And it's still confusing people
today with e.g. non-ASCII in /away messages.)
Thanks to @disconsented for bringing this issue to attention again.
Test results for Freenode (a partially UTF-8 server network):
> Before
/join ##test♪
[8:18:31 pm] --> digitalcircuit (...) has joined ##test?
/nick digitalcircuit♪
[8:19:06 pm] * No free and valid nicks in nicklist found. use: /nick <othernick> to continue
[8:19:06 pm] * Nick digitalcircuit? contains illegal characters
/away Now playing ♪ Songs to Test
[8:21:11 pm] * You have been marked as being away
/whois digitalcircuit
[8:21:18 pm] * [Whois] digitalcircuit is away: "Now playing ? Songs to Test"
> After
/join ##test♪
[8:16:57 pm] * 479 ##test♪ Illegal channel name
/nick digitalcircuit♪
[8:17:39 pm] * No free and valid nicks in nicklist found. use: /nick <othernick> to continue
[8:17:39 pm] * Nick digitalcircuit�� contains illegal characters
/away Now playing ♪ Songs to Test
[8:21:46 pm] * You have been marked as being away
/whois digitalcircuit
[8:22:12 pm] * [Whois] digitalcircuit is away: "Now playing ♪ Songs to Test"
Matt Schatz [Thu, 29 Mar 2018 12:14:39 +0000 (06:14 -0600)]
Prepend current nickname if buffer has no name
If the buffer name is blank, assume Status Buffer (or otherwise
some un-named buffer?) and prepend our current nickname. Now
shortcuts like '/mode +R' will work on ourself from the Status
Buffer and doesn't interfere with current behaviour otherwise.
Matt Schatz [Tue, 19 Jun 2018 00:55:39 +0000 (18:55 -0600)]
Update my AboutData entry
Shane Synan [Tue, 19 Jun 2018 00:59:05 +0000 (19:59 -0500)]
client: Fix text format shortcuts edge case
When toggling text formatting via keyboard shortcuts, always update
the button state, too. This fixes an issue where in certain
situations formatting could not be removed by shortcut, only by
button.
(I originally avoided doing this out of concern it'd create a loop
with the clicked() signal firing when setting check state.
Thankfully that's not the case.)
Test case:
1. Type "test message here"
2. Select "message", mark as italic (button or shortcut)
3. Move cursor to end of message, so italic button becomes unpressed
4. Click at the end of the word "message" (after the 'e'), and
drag-select/Shift-Arrow select up to the beginning of the message
(before the 'm').
5. Use shortcut to toggle italic, several times
6. Use button to toggle italic, several times
> Before
The italic shortcut would not toggle on then off, clearing the format
> After
The italic shortcut works after toggling twice, just like the button.
Having to toggle twice in this situation is a bug that existed before
the formatting shortcut changes.
Shane Synan [Tue, 19 Jun 2018 00:12:33 +0000 (19:12 -0500)]
aboutdata: Rename QuasselDroid -> Quasseldroid
Update @justJanne 's contributor information to mention
"Quasseldroid" instead of "QuasselDroid". This matches upstream
rebranding to reduce the risk of a lawsuit from certain companies
involved with things called "Droid".
The other mention of "QuasselDroid" is from sandsmark, where the
project is still called "QuasselDroid" (and now marked as legacy).
It may be better to leave that one to distinguish the projects.
See https://git.kuschku.de/justJanne/QuasselDroid-ng/commit/
5e08f048764171d550ce17127c4075709bf9c2cd
Shane Synan [Mon, 18 Jun 2018 21:13:36 +0000 (16:13 -0500)]
client: Poll legacy CoreInfo when dialog is open
On legacy cores (lacking SyncedCoreInfo), when CoreInfoDlg is open,
every 15 seconds resynchronize CoreInfo object to update the
"Connected Clients" count. This matches expectations set by the
counting uptime clock, and shouldn't be a significant data impact as
info is only polled while the dialog is open.
Modern cores (with SyncedCoreInfo) will not poll, using signals to
update immediately as before.
Shane Synan [Mon, 18 Jun 2018 21:16:37 +0000 (16:16 -0500)]
client: Detect legacy CoreInfo, request on show
Add feature flag 'SyncedCoreInfo' to signify the core supports
signals for the CoreInfo object.
Detect cores without support for 'SyncedCoreInfo', and poll for core
information on every CoreInfoDlg show. This avoids regressing
functionality for older cores.
Synchronize the CoreInfo object before connecting, ensuring it's
ready to receive parameters on first connect, mimicking backlog
requester. This avoids a warning about "No registered receiver"
for the CoreInfo handler.
Reset CoreInfo object on disconnect, update CoreInfoDlg with
"Disconnected from core" message. This reduces confusion about the
state of the core; before, it would simply stop updating.
Remove several nullpointer checks, CoreInfo now should never be null.
Add Client::coreInfoResynchronized() signal for CoreInfo
resynchronization, allowing for periodic updates on legacy cores.
Shane Synan [Mon, 18 Jun 2018 20:47:10 +0000 (15:47 -0500)]
core: Silence auto-PINGs with invalid timestamps
Track whether or not an automated ping reply is pending. If so, and
if the network has not shown to reply to PING via quoting, silence
the response.
This fixes automated PING resulting in unsolicited PONG replies
spamming the server buffer for networks that don't quote PING in
PONG replies. Manual PING still works in almost all cases, unless
the IRC server responds out-of-order.
Mark a network as sending valid PONG timestamps after the first one
is received, resetting on every connect (as each server may differ).
Simplify PONG silencing by using the EventManager::Silent flag,
remove redundant logic from EventStringifier.
Clean up private variable initialization.
Shane Synan [Mon, 18 Jun 2018 03:50:01 +0000 (22:50 -0500)]
core: Handle single-parameter PONG replies
In processIrcEventPong, allow for single-parameter PONG replies.
Some IRC servers reply with server name then quote, others reply with
just the quote.
Log a debug message for invalid timestamps. It's not a known error
as the user can request arbitrary PING replies, but it should be
logged to simplify tracking down IRC servers that mangle or outright
ignore the PING parameters.
(Yes, some IRC servers do this.)
Handle single-parameter PONG replies in EventStringifier, too.
Clarify and reformat comments.
Manuel Nickschas [Mon, 18 Jun 2018 20:37:23 +0000 (22:37 +0200)]
Clean up the HighlightRuleManager a bit
Fix formatting and const-correctness.
Janne Koschinski [Sun, 10 Jun 2018 22:50:09 +0000 (00:50 +0200)]
Rework sync protocol for highlight rules
- Sync highlightNick and nicksCaseSensitive as actual Q_PROPERTY
- Identify rules by their id, not their name
- This allows multiple rules to have the same rule, but different scopes
and senders
Manuel Nickschas [Mon, 18 Jun 2018 21:04:30 +0000 (23:04 +0200)]
icons: Override system icon theme by default
Preliminary reports from the field are in, and apparently the
fallback theme handling is too fragile to unleash it onto
unsuspecting users, due to bugs in Qt, desktop environments and
just plain stupid desktop themes.
Override by default to get a consistent look of Quassel in most
cases. Users can still actively choose the other way.
Shane Synan [Mon, 18 Jun 2018 01:02:49 +0000 (20:02 -0500)]
client: Fix Remote Cores marked unsaved on load
Fix Remote Cores (CoreAccountSettingsPage) wrongly being marked as
unsaved when loading if a default core account was chosen and the
index in the QComboBox was not 0.
This likely happened due to the change of setCurrentIndex on
autoConnectAccount triggering the state as changed, due to a missing
call to setChangedState(). Possibly.
Also clean up if statement scopes while we're here.
Test case:
> Add two accounts, "A" and "B"
> Pick "B" as default account
> Save, close Settings dialog, re-open
> Select Remote Cores, note that it's treated as if changes were there
Shane Synan [Mon, 18 Jun 2018 00:17:21 +0000 (19:17 -0500)]
client: Clean up CoreAccount, add qDebug support
Clean up CoreAccount and CoreAccountModel, adding support for the
negated equality operator '!=' and qDebug() printing.
Modify CoreAccountSettingsPage::testHasChanged() to make use of the
negated equality operator.
Manuel Nickschas [Mon, 18 Jun 2018 18:19:26 +0000 (20:19 +0200)]
identd: Remove unneeded strict attribute
Strictness is now handled in CoreSession, so the attribute is no
longer used.
Manuel Nickschas [Sun, 17 Jun 2018 22:07:51 +0000 (00:07 +0200)]
identd: Ensure sockets are deleted when disconnected
Don't leave stale sockets around; instead, have them delete themselves
once disconnected. Use a QPointer in Request to be able to check for
deletion before trying to access the socket.
Manuel Nickschas [Sun, 17 Jun 2018 22:03:25 +0000 (00:03 +0200)]
identd: Cleanup
Fix formatting and const-correctness.
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:47:02 +0000 (12:47 +0200)]
identd: Return INVALID-PORT if the parsing fails
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:31:40 +0000 (12:31 +0200)]
identd: Move response construction to Request
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:31:40 +0000 (12:31 +0200)]
identd: Rework lowestSocketId handling
Since we're appending only strictly increasing integers, the lowest
socketId is always at the front of the list (if that exists).
hasSocketsBelowId also had a off-by-one error. This had no effect on the
code since a socketId equal to the current _socketId cannot be in the
_waiting list.
Reorder processWaiting's handling of requests:
- If the socketId is one the request might have been waiting for,
check responseAvailable.
- Otherwise, if there is at least one socket we need to wait for,
continue waiting.
- Otherwise, responseUnavailable.
The former order was:
- If there are no sockets left from before this request was made,
responseUnavailable.
- If the socketId is one the request might have been waiting for,
check responseAvailable.
- Otherwise, continue waiting.
The change was necessary as the lowestSocketId no longer includes the
socketId that was just removed. In addition, the new order also matches
the if-else chain in IdentServer::respond.
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:29:43 +0000 (12:29 +0200)]
identd: Simplify responseAvailable via early return
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:29:42 +0000 (12:29 +0200)]
identd: Flatten respond's if-else chain
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:42:48 +0000 (12:42 +0200)]
identd: Avoid a maybe-uninitialized warning
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:29:42 +0000 (12:29 +0200)]
identd: Turn !canReadLine into an early return
Reduces rightward drift.
Janne Koschinski [Tue, 8 May 2018 15:44:25 +0000 (17:44 +0200)]
identd: Implement --ident-port option
Janne Koschinski [Mon, 7 May 2018 23:49:13 +0000 (01:49 +0200)]
identd: Implement blocking request queueing
Janne Koschinski [Mon, 7 May 2018 22:12:32 +0000 (00:12 +0200)]
identd: Initial draft of integrated ident daemon
Manuel Nickschas [Mon, 18 Jun 2018 06:46:20 +0000 (08:46 +0200)]
qtui: Fix typo