mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Add CModule::ExpandString()
It chooses which ExpandString() to call, of user or of network.
This commit is contained in:
@@ -155,6 +155,25 @@ void CModule::SetUser(CUser* pUser) { m_pUser = pUser; }
|
||||
void CModule::SetNetwork(CIRCNetwork* pNetwork) { m_pNetwork = pNetwork; }
|
||||
void CModule::SetClient(CClient* pClient) { m_pClient = pClient; }
|
||||
|
||||
CString CModule::ExpandString(const CString& sStr) const {
|
||||
CString sRet;
|
||||
return ExpandString(sStr, sRet);
|
||||
}
|
||||
|
||||
CString& CModule::ExpandString(const CString& sStr, CString& sRet) const {
|
||||
sRet = sStr;
|
||||
|
||||
if (m_pNetwork) {
|
||||
return m_pNetwork->ExpandString(sRet, sRet);
|
||||
}
|
||||
|
||||
if (m_pUser) {
|
||||
return m_pUser->ExpandString(sRet, sRet);
|
||||
}
|
||||
|
||||
return sRet;
|
||||
}
|
||||
|
||||
const CString& CModule::GetSavePath() const {
|
||||
if (!CFile::Exists(m_sSavePath)) {
|
||||
CDir::MakeDir(m_sSavePath);
|
||||
|
||||
Reference in New Issue
Block a user