X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=include%2Fnntp%2Fnntpconnection.h;h=d048375669b40cc2d3547aab0ae469c2062d5297;hb=109c20e6f822c6efa465af31249e5608469253b6;hp=64a1645862716a37dd03eb91da49d0db39e95d80;hpb=c7fcb4c4bc5012a584add81a9509fc1f84c3c688;p=fms.git diff --git a/include/nntp/nntpconnection.h b/include/nntp/nntpconnection.h index 64a1645..d048375 100644 --- a/include/nntp/nntpconnection.h +++ b/include/nntp/nntpconnection.h @@ -1,14 +1,15 @@ #ifndef _nntpconnection_ #define _nntpconnection_ +#include "../threadwrapper/cancelablerunnable.h" #include "../socketdefines.h" #include "../ilogger.h" #include "../message.h" +#include "../localidentity.h" +#include "../ithreaddatabase.h" #include #include -//#include -#include "../pthreadwrapper/runnable.h" #ifdef _WIN32 @@ -21,7 +22,7 @@ #include #endif -class NNTPConnection:public PThread::Runnable,public ILogger +class NNTPConnection:public CancelableRunnable,public ILogger,public IThreadDatabase { public: NNTPConnection(SOCKET sock); @@ -30,7 +31,7 @@ public: void Disconnect(); const bool Disconnected() { return m_socket==INVALID_SOCKET; } - void Run(); + void run(); private: @@ -46,11 +47,15 @@ private: }; struct ClientStatus { + ClientStatus(SQLite3DB::DB *db):m_authuser(db) {} + ClientMode m_mode; bool m_allowpost; bool m_isposting; long m_boardid; long m_messageid; + LocalIdentity m_authuser; // -1 if user not authenticated, otherwise id of user from tblLocalIdentity + bool m_authenticated; }; void SendBuffered(const std::string &data); @@ -83,6 +88,10 @@ private: const bool HandleNewGroupsCommand(const NNTPCommand &command); const bool HandlePostCommand(const NNTPCommand &command); const bool HandleOverCommand(const NNTPCommand &command); + const bool HandleAuthInfoCommand(const NNTPCommand &command); + const bool HandleGetTrustCommand(const NNTPCommand &command); + const bool HandleSetTrustCommand(const NNTPCommand &command); + const bool HandleGetTrustListCommand(const NNTPCommand &command); SOCKET m_socket; ClientStatus m_status;