mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Make CMessage::ToString() use GetParams()
Avoids having the same loop in two places. GetParams() was under consideration to be removed after the CMessage porting work is done, but it's starting to look like it's here to stay. There are cases, such as mode messages, where "get all params starting from position N" is handy.
This commit is contained in:
@@ -151,14 +151,11 @@ CString CMessage::ToString(unsigned int uFlags) const
|
||||
}
|
||||
|
||||
// <params>
|
||||
unsigned uParams = m_vsParams.size();
|
||||
for (unsigned int uIdx = 0; uIdx < uParams; ++uIdx) {
|
||||
const CString& sParam = m_vsParams[uIdx];
|
||||
sMessage += " ";
|
||||
if (uIdx == uParams - 1 && (m_bColon || sParam.empty() || sParam.StartsWith(":") || sParam.Contains(" "))) {
|
||||
sMessage += ":";
|
||||
if (!m_vsParams.empty()) {
|
||||
if (!sMessage.empty()) {
|
||||
sMessage += " ";
|
||||
}
|
||||
sMessage += sParam;
|
||||
sMessage += GetParams(0);
|
||||
}
|
||||
|
||||
return sMessage;
|
||||
|
||||
Reference in New Issue
Block a user