if (!Cipher::neededFeaturesAvailable())
return nullptr;
- CoreIrcChannel *channel = qobject_cast<CoreIrcChannel *>(ircChannel(target));
+ auto *channel = qobject_cast<CoreIrcChannel *>(ircChannel(target));
if (channel) {
return channel->cipher();
}
- CoreIrcUser *user = qobject_cast<CoreIrcUser *>(ircUser(target));
+ auto *user = qobject_cast<CoreIrcUser *>(ircUser(target));
if (user) {
return user->cipher();
} else if (!isChannelName(target)) {
QByteArray CoreNetwork::cipherKey(const QString &target) const
{
- CoreIrcChannel *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
+ auto *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
if (c)
return c->cipher()->key();
- CoreIrcUser *u = qobject_cast<CoreIrcUser*>(ircUser(target));
+ auto *u = qobject_cast<CoreIrcUser*>(ircUser(target));
if (u)
return u->cipher()->key();
void CoreNetwork::setCipherKey(const QString &target, const QByteArray &key)
{
- CoreIrcChannel *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
+ auto *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
if (c) {
c->setEncrypted(c->cipher()->setKey(key));
coreSession()->setBufferCipher(networkId(), target, key);
return;
}
- CoreIrcUser *u = qobject_cast<CoreIrcUser*>(ircUser(target));
+ auto *u = qobject_cast<CoreIrcUser*>(ircUser(target));
if (!u && !isChannelName(target))
u = qobject_cast<CoreIrcUser*>(newIrcUser(target));
bool CoreNetwork::cipherUsesCBC(const QString &target)
{
- CoreIrcChannel *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
+ auto *c = qobject_cast<CoreIrcChannel*>(ircChannel(target));
if (c)
return c->cipher()->usesCBC();
- CoreIrcUser *u = qobject_cast<CoreIrcUser*>(ircUser(target));
+ auto *u = qobject_cast<CoreIrcUser*>(ircUser(target));
if (u)
return u->cipher()->usesCBC();