X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreircuser.cpp;h=6ea3ca2ba12efdacef0d39a1a1f5ccf96012480b;hp=4dd946ead319d6d4ed5bdf9d5f79fea6495515ed;hb=8961f348947fc55cc4bc769563684af3f2ea7ccc;hpb=c382e0c11f80fb37307ecc42c487aa433c97ad8c diff --git a/src/core/coreircuser.cpp b/src/core/coreircuser.cpp index 4dd946ea..6ea3ca2b 100644 --- a/src/core/coreircuser.cpp +++ b/src/core/coreircuser.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -19,15 +19,17 @@ ***************************************************************************/ #include "coreircuser.h" + #include "corenetwork.h" -CoreIrcUser::CoreIrcUser(const QString &hostmask, Network *network) : IrcUser(hostmask, network) +CoreIrcUser::CoreIrcUser(const QString& hostmask, Network* network) + : IrcUser(hostmask, network) { #ifdef HAVE_QCA2 - _cipher = 0; + _cipher = nullptr; // Get the cipher key from CoreNetwork if present - CoreNetwork *coreNetwork = qobject_cast(network); + auto* coreNetwork = qobject_cast(network); if (coreNetwork) { QByteArray key = coreNetwork->readChannelCipherKey(nick().toLower()); if (!key.isEmpty()) { @@ -40,7 +42,6 @@ CoreIrcUser::CoreIrcUser(const QString &hostmask, Network *network) : IrcUser(ho #endif } - CoreIrcUser::~CoreIrcUser() { #ifdef HAVE_QCA2 @@ -48,7 +49,7 @@ CoreIrcUser::~CoreIrcUser() // exists. There is no need to store the empty key if no cipher exists; no // key was present when instantiating and no key was set during the // channel's lifetime. - CoreNetwork *coreNetwork = qobject_cast(network()); + auto* coreNetwork = qobject_cast(network()); if (coreNetwork && _cipher) { coreNetwork->storeChannelCipherKey(nick().toLower(), _cipher->key()); } @@ -57,9 +58,8 @@ CoreIrcUser::~CoreIrcUser() #endif } - #ifdef HAVE_QCA2 -Cipher *CoreIrcUser::cipher() const +Cipher* CoreIrcUser::cipher() const { if (!_cipher) _cipher = new Cipher(); @@ -67,5 +67,4 @@ Cipher *CoreIrcUser::cipher() const return _cipher; } - #endif