X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Foidentdconfiggenerator.cpp;h=76a2c064fbc756b14ef0ec6bd552dafc4b8e4982;hp=06ff272f0c99858399de00db86fc8481b24562fc;hb=3fe23d142d83c2f79ad75103738fd161d52b003e;hpb=694f9bfbf7f1af19108461c7e00d133e55082bce diff --git a/src/core/oidentdconfiggenerator.cpp b/src/core/oidentdconfiggenerator.cpp index 06ff272f..76a2c064 100644 --- a/src/core/oidentdconfiggenerator.cpp +++ b/src/core/oidentdconfiggenerator.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2012 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,9 +15,12 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ +#include + +#include "corenetwork.h" #include "oidentdconfiggenerator.h" OidentdConfigGenerator::OidentdConfigGenerator(QObject *parent) : @@ -66,12 +69,26 @@ bool OidentdConfigGenerator::init() } -bool OidentdConfigGenerator::addSocket(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort) +QString OidentdConfigGenerator::sysIdentForIdentity(const CoreIdentity *identity) const { + // Make sure the identity's ident complies with strict mode if enabled + const CoreNetwork *network = qobject_cast(sender()); + return network->coreSession()->strictCompliantIdent(identity); +} + + +bool OidentdConfigGenerator::addSocket(const CoreIdentity *identity, + const QHostAddress &localAddress, quint16 localPort, + const QHostAddress &peerAddress, quint16 peerPort, + qint64 socketId) { - Q_UNUSED(localAddress) Q_UNUSED(peerAddress) Q_UNUSED(peerPort) - QString ident = identity->ident(); + Q_UNUSED(localAddress) + Q_UNUSED(peerAddress) + Q_UNUSED(peerPort) + Q_UNUSED(socketId) + + const QString ident = sysIdentForIdentity(identity); - _quasselConfig.append(_quasselStanzaTemplate.arg(localPort).arg(ident).arg(_configTag).toAscii()); + _quasselConfig.append(_quasselStanzaTemplate.arg(localPort).arg(ident).arg(_configTag).toLatin1()); bool ret = writeConfig(); @@ -80,9 +97,18 @@ bool OidentdConfigGenerator::addSocket(const CoreIdentity *identity, const QHost //! not yet implemented -bool OidentdConfigGenerator::removeSocket(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort) +bool OidentdConfigGenerator::removeSocket(const CoreIdentity *identity, + const QHostAddress &localAddress, quint16 localPort, + const QHostAddress &peerAddress, quint16 peerPort, + qint64 socketId) { - Q_UNUSED(identity) Q_UNUSED(localAddress) Q_UNUSED(localPort) Q_UNUSED(peerAddress) Q_UNUSED(peerPort) + Q_UNUSED(identity) + Q_UNUSED(localAddress) + Q_UNUSED(localPort) + Q_UNUSED(peerAddress) + Q_UNUSED(peerPort) + Q_UNUSED(socketId) + return true; }