This commit is contained in:
Alexey Sokolov
2024-01-05 00:45:41 +00:00
parent 4cbccac707
commit 66137bd89a
7 changed files with 186 additions and 12 deletions

View File

@@ -227,7 +227,11 @@ class CClient : public CIRCSocket {
/** Notifies client about one specific cap which server has just notified us about.
*/
void NotifyServerDependentCap(const CString& sCap, bool bValue);
void NotifyServerDependentCap(const CString& sCap, bool bValue, const CString& sValue,
const std::function<void(CClient*, bool)>& handler);
/** Notifies client if the cap is server-dependent, otherwise noop.
*/
void PotentiallyNotifyServerDependentCap(const CString& sCap, bool bValue, const CString& sValue);
/** Notifies client that all these caps are now available.
*
* This function will internally filter only those which are server-dependent.

View File

@@ -156,7 +156,9 @@ class CIRCNetwork : private CCoreTranslationMixin {
void IRCConnected();
void IRCDisconnected();
void CheckIRCConnect();
void NotifyServerDependentCap(const CString& sCap, bool bValue);
void PotentiallyNotifyServerDependentCap(const CString& sCap, bool bValue);
void NotifyClientsAboutServerDependentCap(const CString& sCap, bool bValue, const std::function<void(CClient*, bool)>& handler);
bool IsServerCapAccepted(const CString& sCap) const;
bool PutIRC(const CString& sLine);
bool PutIRC(const CMessage& Message);

View File

@@ -162,6 +162,8 @@ class CIRCSock : public CIRCSocket {
bool IsCapAccepted(const CString& sCap) {
return 1 == m_ssAcceptedCaps.count(sCap);
}
CString GetCapLsValue(const CString& sKey,
const CString& sDefault = "") const;
const MCString& GetISupport() const { return m_mISupport; }
CString GetISupport(const CString& sKey,
const CString& sDefault = "") const;
@@ -223,6 +225,7 @@ class CIRCSock : public CIRCSocket {
unsigned int m_uCapPaused;
SCString m_ssAcceptedCaps;
SCString m_ssPendingCaps;
MCString m_msCapLsValues;
time_t m_lastCTCP;
unsigned int m_uNumCTCP;
static const time_t m_uCTCPFloodTime;