Merge 1.7.x to master

This commit is contained in:
Alexey Sokolov
2018-07-14 07:27:55 +01:00
15 changed files with 218 additions and 192 deletions

View File

@@ -103,7 +103,8 @@ void CClient::ReadLine(const CString& sData) {
CLanguageScope user_lang(GetUser() ? GetUser()->GetLanguage() : "");
CString sLine = sData;
sLine.TrimRight("\n\r");
sLine.Replace("\n", "");
sLine.Replace("\r", "");
DEBUG("(" << GetFullName() << ") CLI -> ZNC ["
<< CDebug::Filter(sLine) << "]");

View File

@@ -174,9 +174,14 @@ bool CConfig::Parse(CFile& file, CString& sErrorMsg) {
void CConfig::Write(CFile& File, unsigned int iIndentation) {
CString sIndentation = CString(iIndentation, '\t');
auto SingleLine = [](const CString& s) {
return s.Replace_n("\r", "").Replace_n("\n", "");
};
for (const auto& it : m_ConfigEntries) {
for (const CString& sValue : it.second) {
File.Write(sIndentation + it.first + " = " + sValue + "\n");
File.Write(SingleLine(sIndentation + it.first + " = " + sValue) +
"\n");
}
}
@@ -184,9 +189,11 @@ void CConfig::Write(CFile& File, unsigned int iIndentation) {
for (const auto& it2 : it.second) {
File.Write("\n");
File.Write(sIndentation + "<" + it.first + " " + it2.first + ">\n");
File.Write(SingleLine(sIndentation + "<" + it.first + " " +
it2.first + ">") +
"\n");
it2.second.m_pSubConfig->Write(File, iIndentation + 1);
File.Write(sIndentation + "</" + it.first + ">\n");
File.Write(SingleLine(sIndentation + "</" + it.first + ">") + "\n");
}
}
}

View File

@@ -156,7 +156,8 @@ void CIRCSock::Quit(const CString& sQuitMsg) {
void CIRCSock::ReadLine(const CString& sData) {
CString sLine = sData;
sLine.TrimRight("\n\r");
sLine.Replace("\n", "");
sLine.Replace("\r", "");
DEBUG("(" << m_pNetwork->GetUser()->GetUserName() << "/"
<< m_pNetwork->GetName() << ") IRC -> ZNC [" << sLine << "]");

View File

@@ -557,13 +557,15 @@ CWebSock::EPageReqResult CWebSock::PrintTemplate(const CString& sPageName,
}
CString CWebSock::GetSkinPath(const CString& sSkinName) {
CString sRet = CZNC::Get().GetZNCPath() + "/webskins/" + sSkinName;
const CString sSkin = sSkinName.Replace_n("/", "_").Replace_n(".", "_");
CString sRet = CZNC::Get().GetZNCPath() + "/webskins/" + sSkin;
if (!CFile::IsDir(sRet)) {
sRet = CZNC::Get().GetCurPath() + "/webskins/" + sSkinName;
sRet = CZNC::Get().GetCurPath() + "/webskins/" + sSkin;
if (!CFile::IsDir(sRet)) {
sRet = CString(_SKINDIR_) + "/" + sSkinName;
sRet = CString(_SKINDIR_) + "/" + sSkin;
}
}

View File

@@ -262,13 +262,13 @@ msgstr "Uso: /attach <#canales>"
#: Client.cpp:1336 Client.cpp:1358 ClientCommand.cpp:129 ClientCommand.cpp:151
msgid "There was {1} channel matching [{2}]"
msgid_plural "There were {1} channels matching [{2}]"
msgstr[0] ""
msgstr[0] "Hay {1} canal que coincide con [{2}]"
msgstr[1] "Hay {1} canales que coinciden con [{2}]"
#: Client.cpp:1339 ClientCommand.cpp:132
msgid "Attached {1} channel"
msgid_plural "Attached {1} channels"
msgstr[0] ""
msgstr[0] "Vinculado a {1} canal"
msgstr[1] "Unido a {1} canales"
#: Client.cpp:1351
@@ -278,7 +278,7 @@ msgstr "Uso: /detach <#canales>"
#: Client.cpp:1361 ClientCommand.cpp:154
msgid "Detached {1} channel"
msgid_plural "Detached {1} channels"
msgstr[0] ""
msgstr[0] "Desvinculado {1} canal"
msgstr[1] "Separados {1} canales"
#: Chan.cpp:638
@@ -321,7 +321,7 @@ msgstr "No se ha encontrado el módulo {1}"
#: Modules.cpp:1659
msgid "Module {1} does not support module type {2}."
msgstr ""
msgstr "El módulo {1} no soporta el tipo de módulo {2}."
#: Modules.cpp:1666
msgid "Module {1} requires a user."
@@ -1045,7 +1045,7 @@ msgstr "Uso: ClearBuffer <#canal|privado>"
#: ClientCommand.cpp:1395
msgid "{1} buffer matching {2} has been cleared"
msgid_plural "{1} buffers matching {2} have been cleared"
msgstr[0] ""
msgstr[0] "{1} búfer coincidente con {2} ha sido borrado"
msgstr[1] "{1} búfers coincidentes con {2} han sido borrados"
#: ClientCommand.cpp:1408