Permalink
Browse files

Add CIRCNetwork which now hold each IRC Connection.

This allows a user to have multiple networks.

A user can login as a network by supplying PASS [user[/network]:]pass or
USER user[/network] on connect. A user can also switch between networks
by using /msg *status JumpNetwork <network>
  • Loading branch information...
1 parent 88033a5 commit fec1a3fe917e0da055165172175dfc425f0485d9 Kyle Fuller committed Aug 24, 2011
Showing with 1,202 additions and 660 deletions.
  1. +12 −4 Config.h
  2. +796 −0 IRCNetwork.cpp
  3. +153 −0 IRCNetwork.h
  4. +2 −2 Listener.cpp
  5. +2 −2 Makefile.in
  6. +179 −557 User.cpp
  7. +17 −68 User.h
  8. +39 −26 znc.cpp
  9. +2 −1 znc.h
View
@@ -67,13 +67,17 @@ class CConfig {
return true;
}
- bool FindStringVector(const CString& sName, VCString& vsList) {
+ bool FindStringVector(const CString& sName, VCString& vsList, bool bErase = true) {
EntryMap::iterator it = m_ConfigEntries.find(sName);
vsList.clear();
if (it == m_ConfigEntries.end())
return false;
vsList = it->second;
- m_ConfigEntries.erase(it);
+
+ if (bErase) {
+ m_ConfigEntries.erase(it);
+ }
+
return true;
}
@@ -109,14 +113,18 @@ class CConfig {
return false;
}
- bool FindSubConfig(const CString& sName, SubConfig& Config) {
+ bool FindSubConfig(const CString& sName, SubConfig& Config, bool bErase = true) {
SubConfigMap::iterator it = m_SubConfigs.find(sName);
if (it == m_SubConfigs.end()) {
Config.clear();
return false;
}
Config = it->second;
- m_SubConfigs.erase(it);
+
+ if (bErase) {
+ m_SubConfigs.erase(it);
+ }
+
return true;
}
Oops, something went wrong.

0 comments on commit fec1a3f

Please sign in to comment.