X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoreircchannel.cpp;h=7f9acd3bb8c698f07466f4e27a6adc3ea7974b1b;hp=8bce68f4cc9ae1c71e7c6ea21a104c0bcd1b0d10;hb=HEAD;hpb=39328183a6a87c6eb10a9dbbffcd5d65bf154a1f diff --git a/src/core/coreircchannel.cpp b/src/core/coreircchannel.cpp index 8bce68f4..7f9acd3b 100644 --- a/src/core/coreircchannel.cpp +++ b/src/core/coreircchannel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -19,17 +19,18 @@ ***************************************************************************/ #include "coreircchannel.h" + #include "corenetwork.h" -CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network) - : IrcChannel(channelname, network), - _receivedWelcomeMsg(false) +CoreIrcChannel::CoreIrcChannel(const QString& channelname, Network* network) + : IrcChannel(channelname, network) + , _receivedWelcomeMsg(false) { #ifdef HAVE_QCA2 _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(channelname); if (!key.isEmpty()) { @@ -39,7 +40,6 @@ CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network) #endif } - CoreIrcChannel::~CoreIrcChannel() { #ifdef HAVE_QCA2 @@ -47,7 +47,7 @@ CoreIrcChannel::~CoreIrcChannel() // 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(name(), _cipher->key()); } @@ -56,9 +56,8 @@ CoreIrcChannel::~CoreIrcChannel() #endif } - #ifdef HAVE_QCA2 -Cipher *CoreIrcChannel::cipher() const +Cipher* CoreIrcChannel::cipher() const { if (!_cipher) _cipher = new Cipher(); @@ -66,7 +65,6 @@ Cipher *CoreIrcChannel::cipher() const return _cipher; } - void CoreIrcChannel::setEncrypted(bool e) { IrcChannel::setEncrypted(e); @@ -83,5 +81,4 @@ void CoreIrcChannel::setEncrypted(bool e) } } - #endif