mirror of
https://github.com/znc/znc.git
synced 2026-08-08 01:43:03 +02:00
Merge branch 'master' of github.com:znc/znc
This commit is contained in:
@@ -54,6 +54,7 @@ public:
|
||||
/// Same as AddLine, but replaces a line whose format string starts with sMatch if there is one.
|
||||
int UpdateLine(const CString& sMatch, const CString& sFormat, const CString& sText = "");
|
||||
/// Same as UpdateLine, but does nothing if this exact line already exists.
|
||||
/// We need this because "/version" sends us the 005 raws again
|
||||
int UpdateExactLine(const CString& sFormat, const CString& sText = "");
|
||||
const CBufLine& GetBufLine(unsigned int uIdx) const;
|
||||
CString GetLine(unsigned int uIdx, const CClient& Client, const MCString& msParams = MCString::EmptyMap) const;
|
||||
|
||||
@@ -6,6 +6,7 @@ PERL_CXX := $(shell $(PERL) -MExtUtils::Embed -e perl_inc)
|
||||
PERL_LD := $(shell $(PERL) -MExtUtils::Embed -e ldopts)
|
||||
# Perl API is ugly, casting string literals to char* and redeclaring functions :(
|
||||
PERL_CXX += -Wno-write-strings -Wno-redundant-decls -Wno-missing-declarations
|
||||
PERL_CXX += -Wno-type-limits -Wno-sign-compare -Wno-strict-overflow
|
||||
# This is for SWIG
|
||||
PERL_CXX += -DSWIG_TYPE_TABLE=znc
|
||||
modperlCXXFLAGS := $(PERL_CXX)
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
ifeq "$(PYTHON_ON)" "yes"
|
||||
PYTHONCOMMON := $(PY_CFLAGS)
|
||||
PYTHONCOMMON += -DSWIG_TYPE_TABLE=znc
|
||||
# Could someone fix all of these in swig / python, please?
|
||||
PYTHONCOMMON += -Wno-missing-field-initializers -Wno-unused -Wno-shadow
|
||||
PYTHONCOMMON += -Wno-missing-declarations -Wno-uninitialized
|
||||
PYTHONCOMMON += -Wno-missing-declarations -Wno-uninitialized -Wno-switch-enum
|
||||
PYTHONCOMMON += -Wno-redundant-decls
|
||||
modpythonCXXFLAGS := $(PYTHONCOMMON) -I.
|
||||
modpythonLDFLAGS := $(PY_LDFLAGS)
|
||||
|
||||
|
||||
+11
-1
@@ -560,6 +560,11 @@ public:
|
||||
o3["DisplayName"] = "Detached";
|
||||
if (pChan && pChan->IsDetached()) { o3["Checked"] = "true"; }
|
||||
|
||||
CTemplate& o4 = Tmpl.AddRow("OptionLoop");
|
||||
o4["Name"] = "disabled";
|
||||
o4["DisplayName"] = "Disabled";
|
||||
if (pChan && pChan->IsDisabled()) { o4["Checked"] = "true"; }
|
||||
|
||||
FOR_EACH_MODULE(i, pUser) {
|
||||
CTemplate& mod = Tmpl.AddRow("EmbeddedModuleLoop");
|
||||
mod.insert(Tmpl.begin(), Tmpl.end());
|
||||
@@ -597,7 +602,6 @@ public:
|
||||
pChan->SetKey(WebSock.GetParam("key"));
|
||||
|
||||
bool bDetached = WebSock.GetParam("detached").ToBool();
|
||||
|
||||
if (pChan->IsDetached() != bDetached) {
|
||||
if (bDetached) {
|
||||
pChan->DetachUser();
|
||||
@@ -606,6 +610,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool bDisabled = WebSock.GetParam("disabled").ToBool();
|
||||
if (bDisabled)
|
||||
pChan->Disable();
|
||||
else
|
||||
pChan->Enable();
|
||||
|
||||
CTemplate TmplMod;
|
||||
TmplMod["User"] = pUser->GetUserName();
|
||||
TmplMod["ChanName"] = sChanName;
|
||||
|
||||
+4
-1
@@ -357,6 +357,7 @@ CString CZNC::ExpandConfigPath(const CString& sConfigFile, bool bAllowMkDir) {
|
||||
|
||||
bool CZNC::WriteConfig() {
|
||||
if (GetConfigFile().empty()) {
|
||||
DEBUG("Config file name is empty?!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -364,6 +365,7 @@ bool CZNC::WriteConfig() {
|
||||
CFile *pFile = new CFile(GetConfigFile() + "~");
|
||||
|
||||
if (!pFile->Open(O_WRONLY | O_CREAT | O_TRUNC, 0600)) {
|
||||
DEBUG("Could not write config to " + GetConfigFile() + "~: " + CString(strerror(errno)));
|
||||
delete pFile;
|
||||
return false;
|
||||
}
|
||||
@@ -372,6 +374,7 @@ bool CZNC::WriteConfig() {
|
||||
// The old file (= inode) is going away and thus a lock on it would be
|
||||
// useless. These lock should always succeed (races, anyone?).
|
||||
if (!pFile->TryExLock()) {
|
||||
DEBUG("Error while locking the new config file, errno says: " + CString(strerror(errno)));
|
||||
pFile->Delete();
|
||||
delete pFile;
|
||||
return false;
|
||||
@@ -465,7 +468,7 @@ bool CZNC::WriteConfig() {
|
||||
|
||||
// We wrote to a temporary name, move it to the right place
|
||||
if (!pFile->Move(GetConfigFile(), true)) {
|
||||
DEBUG("Error while replacing the config file with a new version");
|
||||
DEBUG("Error while replacing the config file with a new version, errno says " << strerror(errno));
|
||||
pFile->Delete();
|
||||
delete pFile;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user