Some more fun with tabs

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1966 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-05-02 08:36:57 +00:00
parent 6b3f8929c7
commit 99f1efc843
37 changed files with 275 additions and 277 deletions
+4 -4
View File
@@ -97,9 +97,9 @@ public:
}
private:
protected:
CString m_sUsername;
CString m_sHostmask;
set<CString> m_ssChans;
CString m_sUsername;
CString m_sHostmask;
set<CString> m_ssChans;
};
class CAutoVoiceMod : public CModule {
@@ -271,7 +271,7 @@ public:
}
private:
map<CString, CAutoVoiceUser*> m_msUsers;
map<CString, CAutoVoiceUser*> m_msUsers;
};
MODULEDEFS(CAutoVoiceMod, "Auto voice the good guys")
+18 -18
View File
@@ -18,10 +18,10 @@ using std::stringstream;
struct EmailST
{
CString sFrom;
CString sSubject;
CString sUidl;
u_int iSize;
CString sFrom;
CString sSubject;
CString sUidl;
u_int iSize;
};
class CEmailJob : public CTimer
@@ -114,7 +114,7 @@ public:
ssUidls.insert(vEmails[a].sUidl);
}
m_ssUidls = ssUidls; // keep the list in synch
m_ssUidls = ssUidls; // keep the list in synch
if (Table.size()) {
PutModule(Table);
@@ -127,10 +127,10 @@ public:
}
private:
CString m_sMailPath;
time_t m_iLastCheck;
set<CString> m_ssUidls;
bool m_bInitialized;
CString m_sMailPath;
time_t m_iLastCheck;
set<CString> m_ssUidls;
bool m_bInitialized;
};
class CEmailFolder : public CSocket
@@ -146,7 +146,7 @@ public:
virtual ~CEmailFolder()
{
if (!m_sMailBuffer.empty())
ProcessMail(); // get the last one
ProcessMail(); // get the last one
if (!m_vEmails.empty())
m_pModule->ParseEmails(m_vEmails);
@@ -178,7 +178,7 @@ public:
CString sLine(*it);
sLine.Trim();
if (sLine.empty())
break; // out of the headers
break; // out of the headers
if (sLine.Equals("From: ", false, 6))
tmp.sFrom = sLine.substr(6, CString::npos);
@@ -192,10 +192,10 @@ public:
m_vEmails.push_back(tmp);
}
private:
CEmail *m_pModule;
CString m_sMailbox;
CString m_sMailBuffer;
vector<EmailST> m_vEmails;
CEmail *m_pModule;
CString m_sMailbox;
CString m_sMailBuffer;
vector<EmailST> m_vEmails;
};
void CEmail::OnModCommand(const CString& sCommand)
@@ -222,17 +222,17 @@ void CEmail::StartParser()
CString sParserName = "EMAIL::" + m_pUser->GetUserName();
if (m_pManager->FindSockByName(sParserName))
return; // one at a time sucker
return; // one at a time sucker
CFile cFile(m_sMailPath);
if ((!cFile.Exists()) || (cFile.GetSize() == 0))
{
m_bInitialized = true;
return; // der
return; // der
}
if (cFile.GetMTime() <= m_iLastCheck)
return; // only check if modified
return; // only check if modified
int iFD = open(m_sMailPath.c_str(), O_RDONLY);
if (iFD >= 0)
+12 -12
View File
@@ -32,10 +32,10 @@ public:
virtual void ReadLine(const CString& sLine);
private:
protected:
CIMAPAuthMod* m_pIMAPMod;
bool m_bSentLogin;
bool m_bSentReply;
CSmartPtr<CAuthBase> m_spAuth;
CIMAPAuthMod* m_pIMAPMod;
bool m_bSentLogin;
bool m_bSentReply;
CSmartPtr<CAuthBase> m_spAuth;
};
@@ -56,7 +56,7 @@ public:
virtual bool OnLoad(const CString& sArgs, CString& sMessage) {
if (sArgs.Trim_n().empty()) {
return true; // use defaults
return true; // use defaults
}
m_sServer = sArgs.Token(0);
@@ -80,7 +80,7 @@ public:
virtual EModRet OnLoginAttempt(CSmartPtr<CAuthBase> Auth) {
CUser* pUser = CZNC::Get().FindUser(Auth->GetUsername());
if (!pUser) { // @todo Will want to do some sort of && !m_bAllowCreate in the future
if (!pUser) { // @todo Will want to do some sort of && !m_bAllowCreate in the future
Auth->RefuseLogin("Invalid User - Halting IMAP Lookup");
return HALT;
}
@@ -109,13 +109,13 @@ public:
// !Getters
private:
// Settings
CString m_sServer;
unsigned short m_uPort;
bool m_bSSL;
CString m_sUserFormat;
CString m_sServer;
unsigned short m_uPort;
bool m_bSSL;
CString m_sUserFormat;
// !Settings
TCacheMap<CString> m_Cache;
TCacheMap<CString> m_Cache;
};
void CIMAPSock::ReadLine(const CString& sLine) {
@@ -139,7 +139,7 @@ void CIMAPSock::ReadLine(const CString& sLine) {
if (pUser && sLine.Equals("AUTH OK", false, 7)) {
m_spAuth->AcceptLogin(*pUser);
m_pIMAPMod->CacheLogin(CString(m_spAuth->GetUsername() + ":" + m_spAuth->GetPassword()).MD5()); // Use MD5 so passes don't sit in memory in plain text
m_pIMAPMod->CacheLogin(CString(m_spAuth->GetUsername() + ":" + m_spAuth->GetPassword()).MD5()); // Use MD5 so passes don't sit in memory in plain text
DEBUG("+++ Successful IMAP lookup");
} else {
m_spAuth->RefuseLogin("Invalid Password");
+8 -8
View File
@@ -17,12 +17,12 @@
#define STDVAR (ClientData cd, Tcl_Interp *irp, int argc, const char *argv[])
#define BADARGS(nl, nh, example) do { \
if ((argc < (nl)) || (argc > (nh))) { \
Tcl_AppendResult(irp, "wrong # args: should be \"", \
argv[0], (example), "\"", NULL); \
return TCL_ERROR; \
} \
#define BADARGS(nl, nh, example) do { \
if ((argc < (nl)) || (argc > (nh))) { \
Tcl_AppendResult(irp, "wrong # args: should be \"", \
argv[0], (example), "\"", NULL); \
return TCL_ERROR; \
} \
} while (0)
class CModTcl;
@@ -34,7 +34,7 @@ public:
virtual ~CModTclTimer() {}
protected:
virtual void RunJob();
CModTcl* m_pParent;
CModTcl* m_pParent;
};
class CModTclStartTimer : public CTimer {
@@ -44,7 +44,7 @@ public:
virtual ~CModTclStartTimer() {}
protected:
virtual void RunJob();
CModTcl* m_pParent;
CModTcl* m_pParent;
};
+4 -4
View File
@@ -61,7 +61,7 @@ public:
CUser* pUser(CZNC::Get().FindUser(user));
sasl_conn_t *sasl_conn(0);
if (!pUser) { // @todo Will want to do some sort of && !m_bAllowCreate in the future
if (!pUser) { // @todo Will want to do some sort of && !m_bAllowCreate in the future
Auth->RefuseLogin("Invalid User - Halting SASL Authentication");
return HALT;
}
@@ -87,10 +87,10 @@ public:
}
private:
TCacheMap<CString> m_Cache;
TCacheMap<CString> m_Cache;
static sasl_callback_t cbs[];
static CString method;
static sasl_callback_t cbs[];
static CString method;
static int getopt(void *context, const char *plugin_name, const char *option, const char **result, unsigned *len) {
if (!method.empty() && strcmp(option, "pwcheck_method") == 0) {
+3 -3
View File
@@ -35,10 +35,10 @@ public:
virtual void ReadLine(const CString& sData);
virtual void Disconnected();
CShellMod* m_pParent;
CShellMod* m_pParent;
private:
CClient* m_pClient;
CClient* m_pClient;
};
class CShellMod : public CModule {
@@ -158,7 +158,7 @@ public:
m_pManager->AddSock(new CShellSock(this, m_pClient, "cd " + m_sPath + " && " + sCommand), "SHELL");
}
private:
CString m_sPath;
CString m_sPath;
};
void CShellSock::ReadLine(const CString& sData) {