CIRCNetwork::CIRCNetwork(CUser* pUser, const CString& sName)
    : m_sName(sName),
      m_pUser(nullptr),
      m_sNick(""),
      m_sAltNick(""),
      m_sIdent(""),
      m_sRealName(""),
      m_sBindHost(""),
      m_sEncoding(""),
      m_sQuitMsg(""),
      m_ssTrustedFingerprints(),
      m_pModules(new CModules),
      m_vClients(),
      m_pIRCSock(nullptr),
      m_vChans(),
      m_vQueries(),
      m_sChanPrefixes(""),
      m_bIRCConnectEnabled(true),
      m_bTrustAllCerts(false),
      m_bTrustPKI(true),
      m_sIRCServer(""),
      m_vServers(),
      m_uServerIdx(0),
      m_IRCNick(),
      m_bIRCAway(false),
      m_fFloodRate(2),
      m_uFloodBurst(9),
      m_RawBuffer(),
      m_MotdBuffer(),
      m_NoticeBuffer(),
      m_pPingTimer(nullptr),
      m_pJoinTimer(nullptr),
      m_uJoinDelay(0),
      m_uBytesRead(0),
      m_uBytesWritten(0) {
    SetUser(pUser);

    // This should be more than enough raws, especially since we are buffering
    // the MOTD separately
    m_RawBuffer.SetLineCount(100, true);
    // This should be more than enough motd lines
    m_MotdBuffer.SetLineCount(200, true);
    m_NoticeBuffer.SetLineCount(250, true);

    m_pPingTimer = new CIRCNetworkPingTimer(this);
    CZNC::Get().GetManager().AddCron(m_pPingTimer);

    m_pJoinTimer = new CIRCNetworkJoinTimer(this);
    CZNC::Get().GetManager().AddCron(m_pJoinTimer);

    SetIRCConnectEnabled(true);
}
CIRCNetwork::CIRCNetwork(CUser* pUser, const CString& sName)
    : m_sName(sName),
      m_pUser(nullptr),
      m_sNick(""),
      m_sAltNick(""),
      m_sIdent(""),
      m_sRealName(""),
      m_sBindHost(""),
      m_sEncoding(""),
      m_sQuitMsg(""),
      m_ssTrustedFingerprints(),
      m_pModules(new CModules),
      m_vClients(),
      m_pIRCSock(nullptr),
      m_vChans(),
      m_vQueries(),
      m_sChanPrefixes(""),
      m_bIRCConnectEnabled(true),
      m_bTrustAllCerts(false),
      m_bTrustPKI(true),
      m_sIRCServer(""),
      m_vServers(),
      m_uServerIdx(0),
      m_IRCNick(),
      m_bIRCAway(false),
      m_fFloodRate(2),
      m_uFloodBurst(9),
      m_RawBuffer(),
      m_MotdBuffer(),
      m_NoticeBuffer(),
      m_pPingTimer(nullptr),
      m_pJoinTimer(nullptr),
      m_uJoinDelay(0),
      m_uBytesRead(0),
      m_uBytesWritten(0) {
    SetUser(pUser);

     
     
    m_RawBuffer.SetLineCount(100, true);
     
    m_MotdBuffer.SetLineCount(200, true);
    m_NoticeBuffer.SetLineCount(250, true);

    m_pPingTimer = new CIRCNetworkPingTimer(this);
    CZNC::Get().GetManager().AddCron(m_pPingTimer);

    m_pJoinTimer = new CIRCNetworkJoinTimer(this);
    CZNC::Get().GetManager().AddCron(m_pJoinTimer);

    SetIRCConnectEnabled(true);
}