X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Foidentdconfiggenerator.h;h=6a394913fceda754131044f5bfcac2729a999bfa;hp=0612ae0f23ae22b25be4c7587df5616eb2b7106a;hb=1f21c1f9613031ae263eeed0c4883bfcd5488343;hpb=4a5065255e652dd0c301bac0db41b7afb777ef49 diff --git a/src/core/oidentdconfiggenerator.h b/src/core/oidentdconfiggenerator.h index 0612ae0f..6a394913 100644 --- a/src/core/oidentdconfiggenerator.h +++ b/src/core/oidentdconfiggenerator.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 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 * @@ -21,21 +21,17 @@ #ifndef OIDENTDCONFIGGENERATOR_H #define OIDENTDCONFIGGENERATOR_H -#include +#include +#include #include #include -#include #include #include -#include - -#ifdef HAVE_UMASK -# include -# include -#endif /* HAVE_UMASK */ +#include +#include -#include "quassel.h" #include "coreidentity.h" +#include "quassel.h" //! Produces oidentd configuration files /*! @@ -58,22 +54,34 @@ class OidentdConfigGenerator : public QObject { Q_OBJECT public: - explicit OidentdConfigGenerator(QObject *parent = 0); - ~OidentdConfigGenerator(); + explicit OidentdConfigGenerator(QObject* parent = nullptr); + ~OidentdConfigGenerator() override; public slots: - bool addSocket(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort); - bool removeSocket(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort); + bool addSocket(const CoreIdentity* identity, + const QHostAddress& localAddress, + quint16 localPort, + const QHostAddress& peerAddress, + quint16 peerPort, + qint64 socketId); + bool removeSocket(const CoreIdentity* identity, + const QHostAddress& localAddress, + quint16 localPort, + const QHostAddress& peerAddress, + quint16 peerPort, + qint64 socketId); private: + QString sysIdentForIdentity(const CoreIdentity* identity) const; bool init(); bool writeConfig(); bool parseConfig(bool readQuasselStanzas = false); - bool lineByUs(const QByteArray &line); + bool lineByUs(const QByteArray& line); - bool _initialized; + bool _initialized{false}; + bool _strict; QDateTime _lastSync; - QFile *_configFile; + QFile* _configFile; QByteArray _parsedConfig; QByteArray _quasselConfig; // Mutex isn't strictly necessary at the moment, since with the current invocation in Core only one instance at a time exists @@ -87,5 +95,4 @@ private: QString _quasselStanzaTemplate; }; - -#endif // OIDENTDCONFIGGENERATOR_H +#endif // OIDENTDCONFIGGENERATOR_H