From f4019b6740e26667a1654d6cbf1e3a8dd61e9ec6 Mon Sep 17 00:00:00 2001 From: Lee Aylward Date: Wed, 7 Dec 2011 19:09:23 -0600 Subject: [PATCH 01/32] send 422 event if MOTD buffer is empty --- src/IRCNetwork.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 549ce3c2..3625b5a7 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -403,9 +403,14 @@ void CIRCNetwork::ClientConnected(CClient *pClient) { // Send the cached MOTD uSize = m_MotdBuffer.Size(); - for (uIdx = 0; uIdx < uSize; uIdx++) { - pClient->PutClient(m_MotdBuffer.GetLine(uIdx, *pClient, msParams)); - } + if (uSize > 0) { + for (uIdx = 0; uIdx < uSize; uIdx++) { + pClient->PutClient(m_MotdBuffer.GetLine(uIdx, *pClient, msParams)); + } + } + else { + pClient->PutClient(":irc.znc.in 422 :MOTD File is missing"); + } if (GetIRCSock() != NULL) { CString sUserMode(""); From 8bb7ea5370046566f05a73d337ab3ef390435190 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Thu, 29 Dec 2011 11:35:25 +0700 Subject: [PATCH 02/32] Rework modperl to better integrate with perl. Now it supports global and network modules. Fixes github issue #82 --- modules/modperl.cpp | 37 ++---- modules/modperl/codegen.pl | 2 +- modules/modperl/modperl.i | 2 + modules/modperl/module.h | 40 ++++--- modules/modperl/startup.pl | 223 ++++++++++++++++--------------------- 5 files changed, 133 insertions(+), 171 deletions(-) diff --git a/modules/modperl.cpp b/modules/modperl.cpp index e1a66fc3..d41e1ae2 100644 --- a/modules/modperl.cpp +++ b/modules/modperl.cpp @@ -76,14 +76,13 @@ public: virtual EModRet OnModuleLoading(const CString& sModName, const CString& sArgs, CModInfo::EModuleType eType, bool& bSuccess, CString& sRetMsg) { - if (!GetUser() || eType != CModInfo::UserModule) { - return CONTINUE; - } EModRet result = HALT; PSTART; PUSH_STR(sModName); PUSH_STR(sArgs); + mXPUSHi(eType); PUSH_PTR(CUser*, GetUser()); + PUSH_PTR(CIRCNetwork*, GetNetwork()); PCALL("ZNC::Core::LoadModule"); if (SvTRUE(ERRSV)) { @@ -115,7 +114,7 @@ public: if (pMod) { CString sModName = pMod->GetModName(); PSTART; - PUSH_PTR(CPerlModule*, pMod); + XPUSHs(pMod->GetPerlObj()); PCALL("ZNC::Core::UnloadModule"); if (SvTRUE(ERRSV)) { bSuccess = false; @@ -135,6 +134,7 @@ public: bool& bSuccess, CString& sRetMsg) { PSTART; PUSH_STR(sModule); + PUSH_PTR(CModInfo*, &ModInfo); PCALL("ZNC::Core::GetModInfo"); EModRet result = CONTINUE; if (SvTRUE(ERRSV)) { @@ -147,13 +147,7 @@ public: break; case Perl_Loaded: result = HALT; - if (4 == ret) { - ModInfo.SetDefaultType(CModInfo::UserModule); - ModInfo.AddType(CModInfo::UserModule); - ModInfo.SetDescription(PString(ST(2))); - ModInfo.SetName(sModule); - ModInfo.SetPath(PString(ST(1))); - ModInfo.SetWikiPage(PString(ST(3))); + if (1 == ret) { bSuccess = true; } else { bSuccess = false; @@ -175,14 +169,10 @@ public: sRetMsg = "Something weird happened"; } PEND; - DEBUG(__PRETTY_FUNCTION__ << " " << sRetMsg); return result; } virtual void OnGetAvailableMods(set& ssMods, CModInfo::EModuleType eType) { - if (eType != CModInfo::UserModule) { - return; - } unsigned int a = 0; CDir Dir; @@ -202,13 +192,9 @@ public: PSTART; PUSH_STR(sPath); PUSH_STR(sName); + PUSH_PTR(CModInfo*, &ModInfo); PCALL("ZNC::Core::ModInfoByPath"); if (!SvTRUE(ERRSV) && ret == 2) { - ModInfo.AddType(CModInfo::UserModule); - ModInfo.SetDescription(PString(ST(0))); - ModInfo.SetName(sName); - ModInfo.SetPath(sPath); - ModInfo.SetWikiPage(PString(ST(1))); ssMods.insert(ModInfo); } PEND; @@ -243,8 +229,7 @@ void CPerlTimer::RunJob() { CPerlModule* pMod = AsPerlModule(GetModule()); if (pMod) { PSTART; - PUSH_STR(pMod->GetPerlID()); - PUSH_STR(GetPerlID()); + XPUSHs(GetPerlObj()); PCALL("ZNC::Core::CallTimer"); PEND; } @@ -254,14 +239,13 @@ CPerlTimer::~CPerlTimer() { CPerlModule* pMod = AsPerlModule(GetModule()); if (pMod) { PSTART; - PUSH_STR(pMod->GetPerlID()); - PUSH_STR(GetPerlID()); + XPUSHs(sv_2mortal(m_perlObj)); PCALL("ZNC::Core::RemoveTimer"); PEND; } } -#define SOCKSTART PSTART; PUSH_STR(pMod->GetPerlID()); PUSH_STR(GetPerlID()) +#define SOCKSTART PSTART; XPUSHs(GetPerlObj()) #define SOCKCBCHECK(OnSuccess) PCALL("ZNC::Core::CallSocket"); if (SvTRUE(ERRSV)) { Close(); DEBUG("Perl socket hook died with: " + PString(ERRSV)); } else { OnSuccess; } PEND #define CBSOCK(Func) void CPerlSocket::Func() {\ CPerlModule* pMod = AsPerlModule(GetModule());\ @@ -313,7 +297,8 @@ Csock* CPerlSocket::GetSockObj(const CString& sHost, unsigned short uPort) { CPerlSocket::~CPerlSocket() { CPerlModule* pMod = AsPerlModule(GetModule()); if (pMod) { - SOCKSTART; + PSTART; + XPUSHs(sv_2mortal(m_perlObj)); PCALL("ZNC::Core::RemoveSocket"); PEND; } diff --git a/modules/modperl/codegen.pl b/modules/modperl/codegen.pl index 0e4bf138..d27e46a0 100755 --- a/modules/modperl/codegen.pl +++ b/modules/modperl/codegen.pl @@ -64,7 +64,7 @@ namespace { #define PUSH_STR(s) XPUSHs(PString(s).GetSV()) #define PUSH_PTR(type, p) XPUSHs(SWIG_NewInstanceObj(const_cast(p), SWIG_TypeQuery(#type), SWIG_SHADOW)) */ -#define PSTART_IDF(Func) PSTART; PUSH_STR(GetPerlID()); PUSH_STR(#Func) +#define PSTART_IDF(Func) PSTART; XPUSHs(GetPerlObj()); PUSH_STR(#Func) #define PCALLMOD(Error, Success) PCALL("ZNC::Core::CallModFunc"); if (SvTRUE(ERRSV)) { DEBUG("Perl hook died with: " + PString(ERRSV)); Error; } else { Success; } PEND EOF diff --git a/modules/modperl/modperl.i b/modules/modperl/modperl.i index b7394e21..c62cd334 100644 --- a/modules/modperl/modperl.i +++ b/modules/modperl/modperl.i @@ -24,6 +24,7 @@ #include "../include/znc/Nick.h" #include "../include/znc/Chan.h" #include "../include/znc/User.h" +#include "../include/znc/IRCNetwork.h" #include "../include/znc/Client.h" #include "../include/znc/IRCSock.h" #include "../include/znc/Listener.h" @@ -87,6 +88,7 @@ namespace std { %include "../include/znc/Nick.h" %include "../include/znc/Chan.h" %include "../include/znc/User.h" +%include "../include/znc/IRCNetwork.h" %include "../include/znc/Client.h" %include "../include/znc/IRCSock.h" %include "../include/znc/Listener.h" diff --git a/modules/modperl/module.h b/modules/modperl/module.h index 22c0ec37..a88efd5d 100644 --- a/modules/modperl/module.h +++ b/modules/modperl/module.h @@ -8,21 +8,27 @@ #pragma once +#include +#include +#include + #include #if HAVE_VISIBILITY #pragma GCC visibility push(default) #endif class CPerlModule : public CModule { - CString m_sPerlID; + SV* m_perlObj; VWebSubPages* _GetSubPages(); public: CPerlModule(CUser* pUser, CIRCNetwork* pNetwork, const CString& sModName, const CString& sDataPath, - const CString& sPerlID) + SV* perlObj) : CModule(NULL, pUser, pNetwork, sModName, sDataPath) { - m_sPerlID = sPerlID; + m_perlObj = newSVsv(perlObj); + } + SV* GetPerlObj() { + return sv_2mortal(newSVsv(m_perlObj)); } - CString GetPerlID() { return m_sPerlID; } virtual bool OnBoot(); virtual bool WebRequiresLogin(); @@ -99,27 +105,31 @@ enum ELoadPerlMod { }; class CPerlTimer : public CTimer { - CString m_sPerlID; + SV* m_perlObj; public: - CPerlTimer(CPerlModule* pModule, unsigned int uInterval, unsigned int uCycles, const CString& sLabel, const CString& sDescription, const CString& sPerlID) - : CTimer (pModule, uInterval, uCycles, sLabel, sDescription), m_sPerlID(sPerlID) { + CPerlTimer(CPerlModule* pModule, unsigned int uInterval, unsigned int uCycles, const CString& sLabel, const CString& sDescription, SV* perlObj) + : CTimer (pModule, uInterval, uCycles, sLabel, sDescription), m_perlObj(newSVsv(perlObj)) { pModule->AddTimer(this); } virtual void RunJob(); - CString GetPerlID() { return m_sPerlID; } + SV* GetPerlObj() { + return sv_2mortal(newSVsv(m_perlObj)); + } ~CPerlTimer(); }; inline CPerlTimer* CreatePerlTimer(CPerlModule* pModule, unsigned int uInterval, unsigned int uCycles, - const CString& sLabel, const CString& sDescription, const CString& sPerlID) { - return new CPerlTimer(pModule, uInterval, uCycles, sLabel, sDescription, sPerlID); + const CString& sLabel, const CString& sDescription, SV* perlObj) { + return new CPerlTimer(pModule, uInterval, uCycles, sLabel, sDescription, perlObj); } class CPerlSocket : public CSocket { - CString m_sPerlID; + SV* m_perlObj; public: - CPerlSocket(CPerlModule* pModule, const CString& sPerlID) : CSocket(pModule), m_sPerlID(sPerlID) {} - CString GetPerlID() { return m_sPerlID; } + CPerlSocket(CPerlModule* pModule, SV* perlObj) : CSocket(pModule), m_perlObj(newSVsv(perlObj)) {} + SV* GetPerlObj() { + return sv_2mortal(newSVsv(m_perlObj)); + } ~CPerlSocket(); virtual void Connected(); virtual void Disconnected(); @@ -130,8 +140,8 @@ public: virtual Csock* GetSockObj(const CString& sHost, unsigned short uPort); }; -inline CPerlSocket* CreatePerlSocket(CPerlModule* pModule, const CString& sPerlID) { - return new CPerlSocket(pModule, sPerlID); +inline CPerlSocket* CreatePerlSocket(CPerlModule* pModule, SV* perlObj) { + return new CPerlSocket(pModule, perlObj); } inline bool HaveIPv6() { diff --git a/modules/modperl/startup.pl b/modules/modperl/startup.pl index 0e8cee5d..22e098e9 100644 --- a/modules/modperl/startup.pl +++ b/modules/modperl/startup.pl @@ -15,69 +15,40 @@ use feature 'switch', 'say'; package ZNC::Core; -my $uuidtype; -my $uuidgen; -our %pmods; my %modrefcount; +my @allmods; -sub Init { - if (eval { require Data::UUID }) { - $uuidtype = 'Data::UUID'; - $uuidgen = new Data::UUID; - } elsif (eval { require UUID }) { - $uuidtype = 'UUID'; - } else { - $uuidtype = 'int'; - $uuidgen = 0; - } -} - -sub CreateUUID { - my $res; - given ($uuidtype) { - when ('Data::UUID') { - $res = $uuidgen->create_str; +sub UnloadModule { + my ($pmod) = @_; + $pmod->OnShutdown; + @allmods = grep {$pmod != $_} @allmods; + my $cmod = $pmod->{_cmod}; + my $modpath = $cmod->GetModPath; + my $modname = $cmod->GetModName; + given ($cmod->GetType()) { + when ($ZNC::CModInfo::NetworkModule) { + $cmod->GetNetwork->GetModules->removeModule($cmod); } - when ('UUID') { - my ($uuid, $str); - UUID::generate($uuid); - UUID::unparse($uuid, $res); + when ($ZNC::CModInfo::UserModule) { + $cmod->GetUser->GetModules->removeModule($cmod); } - when ('int') { - $uuidgen++; - $res = "$uuidgen"; + when ($ZNC::CModInfo::GlobalModule) { + ZNC::CZNC::Get()->GetModules->removeModule($cmod); } } - say "Created new UUID for modperl with '$uuidtype': $res"; - return $res; -} - -sub unloadByIDUser { - my ($id, $user) = @_; - my $modpath = $pmods{$id}{_cmod}->GetModPath; - my $modname = $pmods{$id}{_cmod}->GetModName; - $pmods{$id}->OnShutdown; - $user->GetModules->removeModule($pmods{$id}{_cmod}); - delete $pmods{$id}{_cmod};# Just for the case - delete $pmods{$id}{_nv}; - delete $pmods{$id}{_ptimers}; - delete $pmods{$id}{_sockets}; - delete $pmods{$id}; + delete $pmod->{_cmod}; + delete $pmod->{_nv}; unless (--$modrefcount{$modname}) { say "Unloading $modpath from perl"; ZNC::_CleanupStash($modname); delete $INC{$modpath}; } -} - -sub UnloadModule { - my ($cmod) = @_; - unloadByIDUser($cmod->GetPerlID, $cmod->GetUser); + # here $cmod is deleted by perl (using DESTROY) } sub UnloadAll { - while (my ($id, $pmod) = each %pmods) { - unloadByIDUser($id, $pmod->{_cmod}->GetUser); + while (@allmods) { + UnloadModule($allmods[0]); } } @@ -89,39 +60,55 @@ sub IsModule { } sub LoadModule { - my ($modname, $args, $user) = @_; + my ($modname, $args, $type, $user, $network) = @_; $modname =~ /^\w+$/ or return ($ZNC::Perl_LoadError, "Module names can only contain letters, numbers and underscores, [$modname] is invalid."); - return ($ZNC::Perl_LoadError, "Module [$modname] already loaded.") if defined $user->GetModules->FindModule($modname); + my $container; + given ($type) { + when ($ZNC::CModInfo::NetworkModule) { + $container = $network; + } + when ($ZNC::CModInfo::UserModule) { + $container = $user; + } + when ($ZNC::CModInfo::GlobalModule) { + $container = ZNC::CZNC::Get(); + } + } + return ($ZNC::Perl_LoadError, "Uhm? No container for the module? Wtf?") unless $container; + $container = $container->GetModules; + return ($ZNC::Perl_LoadError, "Module [$modname] already loaded.") if defined $container->FindModule($modname); my $modpath = ZNC::String->new; my $datapath = ZNC::String->new; ZNC::CModules::FindModPath("$modname.pm", $modpath, $datapath) or return ($ZNC::Perl_NotFound); $modpath = $modpath->GetPerlStr; return ($ZNC::Perl_LoadError, "Incorrect perl module [$modpath]") unless IsModule $modpath, $modname; - eval { + my $pmod; + my @types = eval { require $modpath; + $pmod = bless {}, $modname; + $pmod->module_types(); }; if ($@) { - # modrefcount was 0 before this, otherwise it couldn't die. + # modrefcount was 0 before this, otherwise it couldn't die in the previous time. # so can safely remove module from %INC delete $INC{$modpath}; die $@; } + return ($ZNC::Perl_LoadError, "Module [$modname] doesn't support the specified type.") unless $type ~~ @types; $modrefcount{$modname}++; - my $id = CreateUUID; $datapath = $datapath->GetPerlStr; $datapath =~ s/\.pm$//; - my $cmod = ZNC::CPerlModule->new($user, $modname, $datapath, $id); + my $cmod = ZNC::CPerlModule->new($user, $network, $modname, $datapath, $pmod); my %nv; tie %nv, 'ZNC::ModuleNV', $cmod; - my $pmod = bless { - _cmod=>$cmod, - _nv=>\%nv - }, $modname; + $pmod->{_cmod} = $cmod; + $pmod->{_nv} = \%nv; $cmod->SetDescription($pmod->description); $cmod->SetArgs($args); $cmod->SetModPath($modpath); - $pmods{$id} = $pmod; - $user->GetModules->push_back($cmod); + $cmod->SetType($type); + push @allmods, $pmod; + $container->push_back($cmod); my $x = ''; my $loaded = 0; eval { @@ -132,7 +119,7 @@ sub LoadModule { $x .= $@; } if (!$loaded) { - unloadByIDUser($id, $user); + UnloadModule $pmod; if ($x) { return ($ZNC::Perl_LoadError, "Module [$modname] aborted: $x"); } @@ -145,7 +132,7 @@ sub LoadModule { } sub GetModInfo { - my ($modname) = @_; + my ($modname, $modinfo) = @_; $modname =~ /^\w+$/ or return ($ZNC::Perl_LoadError, "Module names can only contain letters, numbers and underscores, [$modname] is invalid."); my $modpath = ZNC::String->new; my $datapath = ZNC::String->new; @@ -154,23 +141,36 @@ sub GetModInfo { return ($ZNC::Perl_LoadError, "Incorrect perl module.") unless IsModule $modpath, $modname; require $modpath; my $pmod = bless {}, $modname; - return ($ZNC::Perl_Loaded, $modpath, $pmod->description, $pmod->wiki_page) + my @types = $pmod->module_types; + $modinfo->SetDefaultType($types[0]); + $modinfo->SetDescription($pmod->description); + $modinfo->SetWikiPage($pmod->wiki_page); + $modinfo->SetName($modname); + $modinfo->SetPath($modpath); + $modinfo->AddType($_) for @types; + return ($ZNC::Perl_Loaded) } sub ModInfoByPath { - my ($modpath, $modname) = @_; + my ($modpath, $modname, $modinfo) = @_; die "Incorrect perl module." unless IsModule $modpath, $modname; require $modpath; my $pmod = bless {}, $modname; - return ($pmod->description, $pmod->wiki_page) + my @types = $pmod->module_types; + $modinfo->SetDefaultType($types[0]); + $modinfo->SetDescription($pmod->description); + $modinfo->SetWikiPage($pmod->wiki_page); + $modinfo->SetName($modname); + $modinfo->SetPath($modpath); + $modinfo->AddType($_) for @types; } sub CallModFunc { - my $id = shift; + my $pmod = shift; my $func = shift; my $default = shift; my @arg = @_; - my $res = $pmods{$id}->$func(@arg); + my $res = $pmod->$func(@arg); # print "Returned from $func(@_): $res, (@arg)\n"; unless (defined $res) { $res = $default if defined $default; @@ -179,26 +179,25 @@ sub CallModFunc { } sub CallTimer { - my $modid = shift; - my $timerid = shift; - $pmods{$modid}->_CallTimer($timerid) + my $timer = shift; + $timer->RunJob; } sub CallSocket { - my $modid = shift; - $pmods{$modid}->_CallSocket(@_) + my $socket = shift; + my $func = shift; + say "Calling socket $func"; + $socket->$func(@_) } sub RemoveTimer { - my $modid = shift; - my $timerid = shift; - $pmods{$modid}->_RemoveTimer($timerid) + my $timer = shift; + $timer->OnShutdown; } sub RemoveSocket { - my $modid = shift; - my $sockid = shift; - $pmods{$modid}->_RemoveSocket($sockid) + my $socket = shift; + $socket->OnShutdown; } package ZNC::ModuleNV; @@ -283,6 +282,10 @@ sub wiki_page { '' } +sub module_types { + $ZNC::CModInfo::NetworkModule +} + # Default implementations for module hooks. They can be overriden in derived modules. sub OnLoad {1} sub OnBoot {} @@ -386,20 +389,16 @@ sub NV { sub CreateTimer { my $self = shift; - my $id = ZNC::Core::CreateUUID; my %a = @_; + my $ptimer = {}; my $ctimer = ZNC::CreatePerlTimer( $self->{_cmod}, $a{interval}//10, $a{cycles}//1, - "perl-timer-$id", + "perl-timer", $a{description}//'Just Another Perl Timer', - $id); - my $ptimer = { - _ctimer=>$ctimer, - _modid=>$self->GetPerlID - }; - $self->{_ptimers}{$id} = $ptimer; + $ptimer); + $ptimer->{_ctimer} = $ctimer; if (ref($a{task}) eq 'CODE') { bless $ptimer, 'ZNC::Timer'; $ptimer->{job} = $a{task}; @@ -410,55 +409,21 @@ sub CreateTimer { $ptimer; } -sub _CallTimer { - my $self = shift; - my $id = shift; - my $t = $self->{_ptimers}{$id}; - $t->RunJob; -} - -sub _RemoveTimer { - my $self = shift; - my $id = shift; - say "Removing perl timer $id"; - $self->{_ptimers}{$id}->OnShutdown; - delete $self->{_ptimers}{$id} -} - sub CreateSocket { my $self = shift; my $class = shift; - my $id = ZNC::Core::CreateUUID; - my $csock = ZNC::CreatePerlSocket($self->{_cmod}, $id); - my $psock = bless { - _csock=>$csock, - _modid=>$self->GetPerlID - }, $class; - $self->{_sockets}{$id} = $psock; + my $psock = bless {}, $class; + my $csock = ZNC::CreatePerlSocket($self->{_cmod}, $psock); + $psock->{_csock} = $csock; $psock->Init(@_); $psock; } -sub _CallSocket { - my $self = shift; - my $id = shift; - my $func = shift; - $self->{_sockets}{$id}->$func(@_) -} - -sub _RemoveSocket { - my $self = shift; - my $id = shift; - say "Removing perl socket $id"; - $self->{_sockets}{$id}->OnShutdown; - delete $self->{_sockets}{$id} -} - package ZNC::Timer; sub GetModule { my $self = shift; - $ZNC::Core::pmods{$self->{_modid}}; + ZNC::AsPerlModule($self->{_ctimer}->GetModule)->GetPerlObj() } sub RunJob { @@ -492,7 +457,7 @@ package ZNC::Socket; sub GetModule { my $self = shift; - $ZNC::Core::pmods{$self->{_modid}}; + ZNC::AsPerlModule($self->{_csock}->GetModule)->GetPerlObj() } sub Init {} @@ -537,7 +502,7 @@ sub Connect { $self->GetModule->GetManager->Connect( $host, $port, - "perl-socket-".$self->GetPerlID, + "perl-socket", $arg{timeout}//60, $arg{ssl}//0, $arg{bindhost}//'', @@ -560,7 +525,7 @@ sub Listen { if (defined $arg{port}) { return $arg{port} if $self->GetModule->GetManager->ListenHost( $arg{port}, - "perl-socket-".$self->GetPerlID, + "perl-socket", $arg{bindhost}//'', $arg{ssl}//0, $arg{maxconns}//ZNC::_GetSOMAXCONN, @@ -571,7 +536,7 @@ sub Listen { return 0; } $self->GetModule->GetManager->ListenRand( - "perl-socket-".$self->GetPerlID, + "perl-socket", $arg{bindhost}//'', $arg{ssl}//0, $arg{maxconns}//ZNC::_GetSOMAXCONN, From 57a51dfd78d3027e3519dfb382ce47f560779f59 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Thu, 29 Dec 2011 11:52:41 +0700 Subject: [PATCH 03/32] Fix codestyle. --- src/IRCNetwork.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 3625b5a7..1071d9a0 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -407,9 +407,8 @@ void CIRCNetwork::ClientConnected(CClient *pClient) { for (uIdx = 0; uIdx < uSize; uIdx++) { pClient->PutClient(m_MotdBuffer.GetLine(uIdx, *pClient, msParams)); } - } - else { - pClient->PutClient(":irc.znc.in 422 :MOTD File is missing"); + } else { + pClient->PutClient(":irc.znc.in 422 :MOTD Cache is missing"); } if (GetIRCSock() != NULL) { From 6443563bd56b13e93019f0a7c82140887736ddc6 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Thu, 29 Dec 2011 18:58:46 +0700 Subject: [PATCH 04/32] Python modules are network mods by default. --- modules/modpython/znc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/modpython/znc.py b/modules/modpython/znc.py index 0fb2cf6c..50bebd20 100644 --- a/modules/modpython/znc.py +++ b/modules/modpython/znc.py @@ -150,7 +150,7 @@ class ModuleNV(collections.MutableMapping): class Module: description = '< Placeholder for a description >' - module_types = [CModInfo.UserModule] + module_types = [CModInfo.NetworkModule] wiki_page = '' From cdc27e1434a9ce4021eff188b8e065fc9ce94027 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 29 Dec 2011 12:28:49 +0100 Subject: [PATCH 05/32] Automatically load autoaway if away is requested This module was renamed in f604709cf0d377. Signed-off-by: Uli Schlachter --- src/IRCNetwork.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 1071d9a0..8d8c1c88 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -252,6 +252,13 @@ bool CIRCNetwork::ParseConfig(CConfig *pConfig, CString& sError, bool bUpgrade) CString sValue = *vit; CString sModName = sValue.Token(0); + // XXX Legacy crap, added in ZNC 0.203 + if (sModName == "away") { + CUtils::PrintMessage("NOTICE: [away] was renamed, " + "loading [autoaway] instead"); + sModName = "autoaway"; + } + CUtils::PrintAction("Loading Module [" + sModName + "]"); CString sModRet; CString sArgs = sValue.Token(1, true); From 01341cfb0a0ce48e2817c2c9b654e6b65fcae2df Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 29 Dec 2011 13:50:31 +0100 Subject: [PATCH 06/32] Fix some invalid iterator uses This fixes #96. When the last user in a partyline channel is deleted, the channel is deleted, too. This invalidates the iterator used in OnDeleteUser(). This fix is to increase the iterator before the channel can be deleted. After the above fix, znc still crashed due to another broken use of iterators. When a network is deleted, it takes all its clients with it (why aren't they just moved into the "no network"-state?"). However, deleting a CClient removes it from the network's list of clients via CClient::Disconnect(). This resulted in another invalid use of iterators. Signed-off-by: Uli Schlachter --- modules/partyline.cpp | 8 ++++++-- src/IRCNetwork.cpp | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/partyline.cpp b/modules/partyline.cpp index c77fb94b..25c2d869 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -123,8 +123,12 @@ public: virtual EModRet OnDeleteUser(CUser& User) { // Loop through each chan - for (set::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); ++it) { - RemoveUser(&User, *it, "KICK", "User deleted", true); + for (set::iterator it = m_ssChannels.begin(); it != m_ssChannels.end();) { + CPartylineChannel *pChan = *it; + // RemoveUser() might delete channels, so make sure our + // iterator doesn't break. + it++; + RemoveUser(&User, pChan, "KICK", "User deleted", true); } return CONTINUE; diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 8d8c1c88..6676248a 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -181,8 +181,8 @@ CIRCNetwork::~CIRCNetwork() { } // Delete clients - for (vector::const_iterator it = m_vClients.begin(); it != m_vClients.end(); ++it) { - CZNC::Get().GetManager().DelSockByAddr(*it); + while (!m_vClients.empty()) { + CZNC::Get().GetManager().DelSockByAddr(m_vClients[0]); } m_vClients.clear(); From 73270ff023332065d077803c2f3d542e3efb68d7 Mon Sep 17 00:00:00 2001 From: Un1matr1x Date: Sun, 1 Jan 2012 09:30:19 +0100 Subject: [PATCH 07/32] Welcome in 2012 --- include/znc/Buffer.h | 2 +- include/znc/Chan.h | 2 +- include/znc/Client.h | 2 +- include/znc/Config.h | 2 +- include/znc/ExecSock.h | 2 +- include/znc/FileUtils.h | 2 +- include/znc/HTTPSock.h | 2 +- include/znc/IRCNetwork.h | 2 +- include/znc/IRCSock.h | 2 +- include/znc/Listener.h | 2 +- include/znc/Modules.h | 2 +- include/znc/Nick.h | 2 +- include/znc/Server.h | 2 +- include/znc/Socket.h | 2 +- include/znc/Template.h | 2 +- include/znc/User.h | 2 +- include/znc/Utils.h | 2 +- include/znc/WebModules.h | 2 +- include/znc/ZNCDebug.h | 2 +- include/znc/ZNCString.h | 2 +- include/znc/defines.h | 2 +- include/znc/main.h | 2 +- include/znc/znc.h | 2 +- modules/admin.cpp | 2 +- modules/adminlog.cpp | 2 +- modules/autoattach.cpp | 2 +- modules/autoop.cpp | 2 +- modules/autoreply.cpp | 2 +- modules/awaynick.cpp | 2 +- modules/blockuser.cpp | 2 +- modules/bouncedcc.cpp | 2 +- modules/buffextras.cpp | 2 +- modules/cert.cpp | 2 +- modules/certauth.cpp | 2 +- modules/chansaver.cpp | 2 +- modules/clientnotify.cpp | 2 +- modules/crypt.cpp | 2 +- modules/disconkick.cpp | 2 +- modules/extra/antiidle.cpp | 2 +- modules/extra/autoaway.cpp | 2 +- modules/extra/autocycle.cpp | 2 +- modules/extra/autovoice.cpp | 2 +- modules/extra/block_motd.cpp | 2 +- modules/extra/charset.cpp | 2 +- modules/extra/clearbufferonmsg.cpp | 2 +- modules/extra/ctcpflood.cpp | 2 +- modules/extra/dcc.cpp | 2 +- modules/extra/droproot.cpp | 2 +- modules/extra/email.cpp | 2 +- modules/extra/fakeonline.cpp | 2 +- modules/extra/flooddetach.cpp | 2 +- modules/extra/imapauth.cpp | 2 +- modules/extra/listsockets.cpp | 2 +- modules/extra/motdfile.cpp | 2 +- modules/extra/notify_connect.cpp | 2 +- modules/extra/saslauth.cpp | 2 +- modules/extra/send_raw.cpp | 2 +- modules/extra/shell.cpp | 2 +- modules/fail2ban.cpp | 2 +- modules/identfile.cpp | 2 +- modules/keepnick.cpp | 2 +- modules/kickrejoin.cpp | 2 +- modules/lastseen.cpp | 2 +- modules/log.cpp | 2 +- modules/modperl.cpp | 2 +- modules/modperl/codegen.pl | 4 ++-- modules/modperl/modperl.i | 2 +- modules/modperl/module.h | 2 +- modules/modperl/pstring.h | 2 +- modules/modperl/startup.pl | 2 +- modules/modpython.cpp | 2 +- modules/modpython/codegen.pl | 4 ++-- modules/modpython/compiler.cpp | 2 +- modules/modpython/modpython.i | 2 +- modules/modpython/module.h | 2 +- modules/modpython/retstring.h | 2 +- modules/modpython/znc.py | 2 +- modules/modtcl.cpp | 2 +- modules/modtcl/binds.tcl | 2 +- modules/modtcl/modtcl.tcl | 2 +- modules/nickserv.cpp | 2 +- modules/notes.cpp | 2 +- modules/partyline.cpp | 2 +- modules/perform.cpp | 2 +- modules/q.cpp | 2 +- modules/raw.cpp | 2 +- modules/route_replies.cpp | 2 +- modules/sample.cpp | 2 +- modules/savebuff.cpp | 2 +- modules/schat.cpp | 2 +- modules/simple_away.cpp | 2 +- modules/stickychan.cpp | 2 +- modules/watch.cpp | 2 +- modules/webadmin.cpp | 2 +- src/Buffer.cpp | 2 +- src/Chan.cpp | 2 +- src/Client.cpp | 2 +- src/ClientCommand.cpp | 2 +- src/Config.cpp | 2 +- src/FileUtils.cpp | 2 +- src/HTTPSock.cpp | 2 +- src/IRCNetwork.cpp | 2 +- src/IRCSock.cpp | 2 +- src/Listener.cpp | 2 +- src/Modules.cpp | 2 +- src/Nick.cpp | 2 +- src/Server.cpp | 2 +- src/Socket.cpp | 2 +- src/Template.cpp | 2 +- src/User.cpp | 2 +- src/Utils.cpp | 2 +- src/WebModules.cpp | 2 +- src/ZNCDebug.cpp | 2 +- src/ZNCString.cpp | 2 +- src/main.cpp | 2 +- src/znc.cpp | 2 +- test/ConfigTest.cpp | 2 +- test/EscapeTest.cpp | 2 +- 118 files changed, 120 insertions(+), 120 deletions(-) diff --git a/include/znc/Buffer.h b/include/znc/Buffer.h index 2613fab6..c99b7d02 100644 --- a/include/znc/Buffer.h +++ b/include/znc/Buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/Chan.h b/include/znc/Chan.h index 0a0c1079..11a50e32 100644 --- a/include/znc/Chan.h +++ b/include/znc/Chan.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/Client.h b/include/znc/Client.h index 424b5ab2..7cc34a81 100644 --- a/include/znc/Client.h +++ b/include/znc/Client.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/Config.h b/include/znc/Config.h index e98131ca..990e4592 100644 --- a/include/znc/Config.h +++ b/include/znc/Config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/ExecSock.h b/include/znc/ExecSock.h index 93ea916b..01336bae 100644 --- a/include/znc/ExecSock.h +++ b/include/znc/ExecSock.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/FileUtils.h b/include/znc/FileUtils.h index 89cac8cc..567ba218 100644 --- a/include/znc/FileUtils.h +++ b/include/znc/FileUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/HTTPSock.h b/include/znc/HTTPSock.h index 94a008c4..219bb8d1 100644 --- a/include/znc/HTTPSock.h +++ b/include/znc/HTTPSock.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/IRCNetwork.h b/include/znc/IRCNetwork.h index 82e36310..a9ea3336 100644 --- a/include/znc/IRCNetwork.h +++ b/include/znc/IRCNetwork.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/IRCSock.h b/include/znc/IRCSock.h index 26a79e4e..3a4e05d7 100644 --- a/include/znc/IRCSock.h +++ b/include/znc/IRCSock.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/Listener.h b/include/znc/Listener.h index 09088cc0..063ac272 100644 --- a/include/znc/Listener.h +++ b/include/znc/Listener.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/Modules.h b/include/znc/Modules.h index fab06c09..f4c4dd6a 100644 --- a/include/znc/Modules.h +++ b/include/znc/Modules.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/Nick.h b/include/znc/Nick.h index 5ad892ec..182c3a7e 100644 --- a/include/znc/Nick.h +++ b/include/znc/Nick.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/Server.h b/include/znc/Server.h index cb18d67e..c7e47e9d 100644 --- a/include/znc/Server.h +++ b/include/znc/Server.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/Socket.h b/include/znc/Socket.h index 086410c8..a1c258f6 100644 --- a/include/znc/Socket.h +++ b/include/znc/Socket.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/Template.h b/include/znc/Template.h index 6f69ce6c..43676fba 100644 --- a/include/znc/Template.h +++ b/include/znc/Template.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/User.h b/include/znc/User.h index 68ac28b2..266c2931 100644 --- a/include/znc/User.h +++ b/include/znc/User.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/Utils.h b/include/znc/Utils.h index 88a88ab6..210ac608 100644 --- a/include/znc/Utils.h +++ b/include/znc/Utils.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/WebModules.h b/include/znc/WebModules.h index a436c7d4..79df2492 100644 --- a/include/znc/WebModules.h +++ b/include/znc/WebModules.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/ZNCDebug.h b/include/znc/ZNCDebug.h index ceb200f4..55cfe1b9 100644 --- a/include/znc/ZNCDebug.h +++ b/include/znc/ZNCDebug.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/ZNCString.h b/include/znc/ZNCString.h index 9e5c87cf..477b8f79 100644 --- a/include/znc/ZNCString.h +++ b/include/znc/ZNCString.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/defines.h b/include/znc/defines.h index 628b014e..699063b6 100644 --- a/include/znc/defines.h +++ b/include/znc/defines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/main.h b/include/znc/main.h index d04e07c9..35594dd3 100644 --- a/include/znc/main.h +++ b/include/znc/main.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/include/znc/znc.h b/include/znc/znc.h index 46ead889..daae5c62 100644 --- a/include/znc/znc.h +++ b/include/znc/znc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/admin.cpp b/modules/admin.cpp index 2514d6bd..bac6a8a5 100644 --- a/modules/admin.cpp +++ b/modules/admin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * Copyright (C) 2008 by Stefan Rado * based on admin.cpp by Sebastian Ramacher * based on admin.cpp in crox branch diff --git a/modules/adminlog.cpp b/modules/adminlog.cpp index 904369c0..2f6abad2 100644 --- a/modules/adminlog.cpp +++ b/modules/adminlog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/autoattach.cpp b/modules/autoattach.cpp index afc60eca..54328c4b 100644 --- a/modules/autoattach.cpp +++ b/modules/autoattach.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/autoop.cpp b/modules/autoop.cpp index 505550e2..e989f488 100644 --- a/modules/autoop.cpp +++ b/modules/autoop.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/autoreply.cpp b/modules/autoreply.cpp index eebc6b9d..473d1e6e 100644 --- a/modules/autoreply.cpp +++ b/modules/autoreply.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * Copyright (C) 2008 Michael "Svedrin" Ziegler diese-addy@funzt-halt.net * * This program is free software; you can redistribute it and/or modify it diff --git a/modules/awaynick.cpp b/modules/awaynick.cpp index 3ecf9498..fcd94a4d 100644 --- a/modules/awaynick.cpp +++ b/modules/awaynick.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/blockuser.cpp b/modules/blockuser.cpp index 2e366588..e04287ee 100644 --- a/modules/blockuser.cpp +++ b/modules/blockuser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/bouncedcc.cpp b/modules/bouncedcc.cpp index 202602be..33f89a4b 100644 --- a/modules/bouncedcc.cpp +++ b/modules/bouncedcc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/buffextras.cpp b/modules/buffextras.cpp index d23d01ed..01581209 100644 --- a/modules/buffextras.cpp +++ b/modules/buffextras.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/cert.cpp b/modules/cert.cpp index fcdde30c..a5a2f4e8 100644 --- a/modules/cert.cpp +++ b/modules/cert.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/certauth.cpp b/modules/certauth.cpp index aa789540..c5f2ff42 100644 --- a/modules/certauth.cpp +++ b/modules/certauth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/chansaver.cpp b/modules/chansaver.cpp index a19047bc..da5e2f26 100644 --- a/modules/chansaver.cpp +++ b/modules/chansaver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/clientnotify.cpp b/modules/clientnotify.cpp index 1b9dd02a..488f2e76 100644 --- a/modules/clientnotify.cpp +++ b/modules/clientnotify.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/crypt.cpp b/modules/crypt.cpp index 68d72145..72d0842d 100644 --- a/modules/crypt.cpp +++ b/modules/crypt.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/disconkick.cpp b/modules/disconkick.cpp index 010cab8c..31fcec21 100644 --- a/modules/disconkick.cpp +++ b/modules/disconkick.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/antiidle.cpp b/modules/extra/antiidle.cpp index 23add843..e4123928 100644 --- a/modules/extra/antiidle.cpp +++ b/modules/extra/antiidle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/autoaway.cpp b/modules/extra/autoaway.cpp index 57a647a6..e5672cc6 100644 --- a/modules/extra/autoaway.cpp +++ b/modules/extra/autoaway.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/autocycle.cpp b/modules/extra/autocycle.cpp index d69a2e99..eaa6d91d 100644 --- a/modules/extra/autocycle.cpp +++ b/modules/extra/autocycle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/autovoice.cpp b/modules/extra/autovoice.cpp index 79ab72de..1ddbe6bf 100644 --- a/modules/extra/autovoice.cpp +++ b/modules/extra/autovoice.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/block_motd.cpp b/modules/extra/block_motd.cpp index 2960f8a2..c4467771 100644 --- a/modules/extra/block_motd.cpp +++ b/modules/extra/block_motd.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/charset.cpp b/modules/extra/charset.cpp index 60bdfc45..bd3b529b 100644 --- a/modules/extra/charset.cpp +++ b/modules/extra/charset.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/clearbufferonmsg.cpp b/modules/extra/clearbufferonmsg.cpp index 733ca767..0df53788 100644 --- a/modules/extra/clearbufferonmsg.cpp +++ b/modules/extra/clearbufferonmsg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/ctcpflood.cpp b/modules/extra/ctcpflood.cpp index 48b04577..66d14ff5 100644 --- a/modules/extra/ctcpflood.cpp +++ b/modules/extra/ctcpflood.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/dcc.cpp b/modules/extra/dcc.cpp index f9a8b404..8198993f 100644 --- a/modules/extra/dcc.cpp +++ b/modules/extra/dcc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/droproot.cpp b/modules/extra/droproot.cpp index f6e17b97..dce5c2a7 100644 --- a/modules/extra/droproot.cpp +++ b/modules/extra/droproot.cpp @@ -6,7 +6,7 @@ * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation. * - * Copyright (C) 2004-2008 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/email.cpp b/modules/extra/email.cpp index 18269311..5ee7f2aa 100644 --- a/modules/extra/email.cpp +++ b/modules/extra/email.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/fakeonline.cpp b/modules/extra/fakeonline.cpp index ec348dd3..d8626550 100644 --- a/modules/extra/fakeonline.cpp +++ b/modules/extra/fakeonline.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 See the AUTHORS file for details. + * Copyright (C) 2008-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/flooddetach.cpp b/modules/extra/flooddetach.cpp index 72da6e0a..dc69d545 100644 --- a/modules/extra/flooddetach.cpp +++ b/modules/extra/flooddetach.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/imapauth.cpp b/modules/extra/imapauth.cpp index 8d994d2e..a17e85fd 100644 --- a/modules/extra/imapauth.cpp +++ b/modules/extra/imapauth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/listsockets.cpp b/modules/extra/listsockets.cpp index c45c8255..fcb68471 100644 --- a/modules/extra/listsockets.cpp +++ b/modules/extra/listsockets.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/motdfile.cpp b/modules/extra/motdfile.cpp index 985a02f6..d7d8367a 100644 --- a/modules/extra/motdfile.cpp +++ b/modules/extra/motdfile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/notify_connect.cpp b/modules/extra/notify_connect.cpp index 2143cdad..08ec579a 100644 --- a/modules/extra/notify_connect.cpp +++ b/modules/extra/notify_connect.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/saslauth.cpp b/modules/extra/saslauth.cpp index 7fedfc82..32b30a1c 100644 --- a/modules/extra/saslauth.cpp +++ b/modules/extra/saslauth.cpp @@ -1,6 +1,6 @@ /** * Copyright (C) 2008 Heiko Hund - * Copyright (C) 2008-2011 See the AUTHORS file for details. + * Copyright (C) 2008-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/send_raw.cpp b/modules/extra/send_raw.cpp index 921032a6..8869022b 100644 --- a/modules/extra/send_raw.cpp +++ b/modules/extra/send_raw.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/extra/shell.cpp b/modules/extra/shell.cpp index 770f706e..e659c8b1 100644 --- a/modules/extra/shell.cpp +++ b/modules/extra/shell.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/fail2ban.cpp b/modules/fail2ban.cpp index 4704a91f..43693962 100644 --- a/modules/fail2ban.cpp +++ b/modules/fail2ban.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/identfile.cpp b/modules/identfile.cpp index 37a950d7..727c7c5a 100644 --- a/modules/identfile.cpp +++ b/modules/identfile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/keepnick.cpp b/modules/keepnick.cpp index 8c141491..aaddeaea 100644 --- a/modules/keepnick.cpp +++ b/modules/keepnick.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/kickrejoin.cpp b/modules/kickrejoin.cpp index 467bb147..81c9deda 100644 --- a/modules/kickrejoin.cpp +++ b/modules/kickrejoin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/lastseen.cpp b/modules/lastseen.cpp index 1bc37c01..051ade8f 100644 --- a/modules/lastseen.cpp +++ b/modules/lastseen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/log.cpp b/modules/log.cpp index 20065dde..8f533045 100644 --- a/modules/log.cpp +++ b/modules/log.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 See the AUTHORS file for details. + * Copyright (C) 2008-2012 See the AUTHORS file for details. * Copyright (C) 2006-2007, CNU (http://cnu.dieplz.net/znc) * * This program is free software; you can redistribute it and/or modify it diff --git a/modules/modperl.cpp b/modules/modperl.cpp index d41e1ae2..f2e6cafe 100644 --- a/modules/modperl.cpp +++ b/modules/modperl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modperl/codegen.pl b/modules/modperl/codegen.pl index d27e46a0..02986510 100755 --- a/modules/modperl/codegen.pl +++ b/modules/modperl/codegen.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# Copyright (C) 2004-2011 See the AUTHORS file for details. +# Copyright (C) 2004-2012 See the AUTHORS file for details. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -17,7 +17,7 @@ open my $out, ">", $ARGV[1] or die; print $out <<'EOF'; /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modperl/modperl.i b/modules/modperl/modperl.i index c62cd334..e98d1f0c 100644 --- a/modules/modperl/modperl.i +++ b/modules/modperl/modperl.i @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modperl/module.h b/modules/modperl/module.h index a88efd5d..274b8990 100644 --- a/modules/modperl/module.h +++ b/modules/modperl/module.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modperl/pstring.h b/modules/modperl/pstring.h index 6ba2bc43..d3e24a74 100644 --- a/modules/modperl/pstring.h +++ b/modules/modperl/pstring.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modperl/startup.pl b/modules/modperl/startup.pl index 22e098e9..ce777388 100644 --- a/modules/modperl/startup.pl +++ b/modules/modperl/startup.pl @@ -1,5 +1,5 @@ # -# Copyright (C) 2004-2011 See the AUTHORS file for details. +# Copyright (C) 2004-2012 See the AUTHORS file for details. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published diff --git a/modules/modpython.cpp b/modules/modpython.cpp index e86a966a..97eea4e0 100644 --- a/modules/modpython.cpp +++ b/modules/modpython.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modpython/codegen.pl b/modules/modpython/codegen.pl index a12e2457..2b70cae1 100644 --- a/modules/modpython/codegen.pl +++ b/modules/modpython/codegen.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# Copyright (C) 2004-2011 See the AUTHORS file for details. +# Copyright (C) 2004-2012 See the AUTHORS file for details. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -18,7 +18,7 @@ open my $out, ">", $ARGV[1] or die; print $out <<'EOF'; /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modpython/compiler.cpp b/modules/modpython/compiler.cpp index 08c1864f..5d20afe9 100644 --- a/modules/modpython/compiler.cpp +++ b/modules/modpython/compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modpython/modpython.i b/modules/modpython/modpython.i index 2c4a8a12..c21c27c6 100644 --- a/modules/modpython/modpython.i +++ b/modules/modpython/modpython.i @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modpython/module.h b/modules/modpython/module.h index 150103af..f4e83dfc 100644 --- a/modules/modpython/module.h +++ b/modules/modpython/module.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modpython/retstring.h b/modules/modpython/retstring.h index a562c8f3..5879ae0d 100644 --- a/modules/modpython/retstring.h +++ b/modules/modpython/retstring.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modpython/znc.py b/modules/modpython/znc.py index 50bebd20..c0391fdc 100644 --- a/modules/modpython/znc.py +++ b/modules/modpython/znc.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2004-2011 See the AUTHORS file for details. +# Copyright (C) 2004-2012 See the AUTHORS file for details. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published diff --git a/modules/modtcl.cpp b/modules/modtcl.cpp index 8c05eead..92eedfa5 100644 --- a/modules/modtcl.cpp +++ b/modules/modtcl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/modtcl/binds.tcl b/modules/modtcl/binds.tcl index 5875cc69..faa688d9 100644 --- a/modules/modtcl/binds.tcl +++ b/modules/modtcl/binds.tcl @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2011 See the AUTHORS file for details. +# Copyright (C) 2004-2012 See the AUTHORS file for details. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published diff --git a/modules/modtcl/modtcl.tcl b/modules/modtcl/modtcl.tcl index c5964f09..254e43cb 100644 --- a/modules/modtcl/modtcl.tcl +++ b/modules/modtcl/modtcl.tcl @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2011 See the AUTHORS file for details. +# Copyright (C) 2004-2012 See the AUTHORS file for details. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published diff --git a/modules/nickserv.cpp b/modules/nickserv.cpp index 2bfa6295..b056e4a4 100644 --- a/modules/nickserv.cpp +++ b/modules/nickserv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/notes.cpp b/modules/notes.cpp index 85e41ca8..752ad627 100644 --- a/modules/notes.cpp +++ b/modules/notes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/partyline.cpp b/modules/partyline.cpp index 25c2d869..faa1788b 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/perform.cpp b/modules/perform.cpp index 6315d36f..7a2016f4 100644 --- a/modules/perform.cpp +++ b/modules/perform.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/q.cpp b/modules/q.cpp index 66c4e36d..c21747d0 100644 --- a/modules/q.cpp +++ b/modules/q.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 See the AUTHORS file for details. + * Copyright (C) 2008-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/raw.cpp b/modules/raw.cpp index 7b845bbf..7a02c7e9 100644 --- a/modules/raw.cpp +++ b/modules/raw.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/route_replies.cpp b/modules/route_replies.cpp index 05f18181..b533a089 100644 --- a/modules/route_replies.cpp +++ b/modules/route_replies.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/sample.cpp b/modules/sample.cpp index a10db095..56e4741c 100644 --- a/modules/sample.cpp +++ b/modules/sample.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/savebuff.cpp b/modules/savebuff.cpp index cd0bfa15..ad5e30ee 100644 --- a/modules/savebuff.cpp +++ b/modules/savebuff.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/schat.cpp b/modules/schat.cpp index 61743ffc..d23dc631 100644 --- a/modules/schat.cpp +++ b/modules/schat.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/simple_away.cpp b/modules/simple_away.cpp index 8587401e..17f1d1dd 100644 --- a/modules/simple_away.cpp +++ b/modules/simple_away.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/stickychan.cpp b/modules/stickychan.cpp index 1c2a2645..150bfd09 100644 --- a/modules/stickychan.cpp +++ b/modules/stickychan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/watch.cpp b/modules/watch.cpp index 37069c14..36283682 100644 --- a/modules/watch.cpp +++ b/modules/watch.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp index a4136cf0..d505a381 100644 --- a/modules/webadmin.cpp +++ b/modules/webadmin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 972ee473..9505486e 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Chan.cpp b/src/Chan.cpp index e2754e80..b507cb2e 100644 --- a/src/Chan.cpp +++ b/src/Chan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Client.cpp b/src/Client.cpp index a76559dc..42af382d 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/ClientCommand.cpp b/src/ClientCommand.cpp index ca620c2d..02910907 100644 --- a/src/ClientCommand.cpp +++ b/src/ClientCommand.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Config.cpp b/src/Config.cpp index 7538b72b..838803e6 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/FileUtils.cpp b/src/FileUtils.cpp index 02f56f8d..3a759ac3 100644 --- a/src/FileUtils.cpp +++ b/src/FileUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/HTTPSock.cpp b/src/HTTPSock.cpp index 79e017d6..1b83893e 100644 --- a/src/HTTPSock.cpp +++ b/src/HTTPSock.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 6676248a..893d52d2 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/IRCSock.cpp b/src/IRCSock.cpp index 7534f488..9b2e9ea6 100644 --- a/src/IRCSock.cpp +++ b/src/IRCSock.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Listener.cpp b/src/Listener.cpp index 287cf637..fcf1fd9b 100644 --- a/src/Listener.cpp +++ b/src/Listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Modules.cpp b/src/Modules.cpp index 3fed2b12..ebac3e75 100644 --- a/src/Modules.cpp +++ b/src/Modules.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Nick.cpp b/src/Nick.cpp index edd3667b..2b6640d2 100644 --- a/src/Nick.cpp +++ b/src/Nick.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Server.cpp b/src/Server.cpp index 6df60a9a..d8d301f5 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Socket.cpp b/src/Socket.cpp index 60947bc7..1c926c40 100644 --- a/src/Socket.cpp +++ b/src/Socket.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Template.cpp b/src/Template.cpp index d38948bb..ea164a62 100644 --- a/src/Template.cpp +++ b/src/Template.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/User.cpp b/src/User.cpp index 847501fa..85331b0f 100644 --- a/src/User.cpp +++ b/src/User.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/Utils.cpp b/src/Utils.cpp index 70610c9c..20632dcb 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/WebModules.cpp b/src/WebModules.cpp index b4670dfa..11b4606a 100644 --- a/src/WebModules.cpp +++ b/src/WebModules.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/ZNCDebug.cpp b/src/ZNCDebug.cpp index b609ec76..a78f7273 100644 --- a/src/ZNCDebug.cpp +++ b/src/ZNCDebug.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/ZNCString.cpp b/src/ZNCString.cpp index 7cd19382..7b01f15e 100644 --- a/src/ZNCString.cpp +++ b/src/ZNCString.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/main.cpp b/src/main.cpp index ec9c04b8..2aaa3cde 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/src/znc.cpp b/src/znc.cpp index 949c5069..f403d5aa 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/test/ConfigTest.cpp b/test/ConfigTest.cpp index 4102c51c..13673fca 100644 --- a/test/ConfigTest.cpp +++ b/test/ConfigTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published diff --git a/test/EscapeTest.cpp b/test/EscapeTest.cpp index dc06aba0..ac46ac57 100644 --- a/test/EscapeTest.cpp +++ b/test/EscapeTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 See the AUTHORS file for details. + * Copyright (C) 2004-2012 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published From 0260558155f508037db66f0b731f7363367f636a Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 1 Jan 2012 16:45:45 +0700 Subject: [PATCH 08/32] Show more debug info with --enable-debug --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d988c917..b6dc38e1 100644 --- a/configure.ac +++ b/configure.ac @@ -151,7 +151,7 @@ AC_ARG_ENABLE( [poll], [POLL="yes"]) if test "$DEBUG" != "no"; then - appendCXX -ggdb + appendCXX -ggdb3 AC_DEFINE([_DEBUG], [1], [Define for debugging]) # These enable some debug options in g++'s STL, e.g. invalid use of iterators AC_DEFINE([_GLIBCXX_DEBUG], [1], [Enable extra debugging checks in libstdc++]) From c8a4668bbffa37af2314de1cd2a7ca694b6e7ded Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 1 Jan 2012 16:46:21 +0700 Subject: [PATCH 09/32] Unload all python modules when modpython is unloaded. Only user modules were unloaded before. --- modules/modpython.cpp | 31 +++++++++---------------------- modules/modpython/znc.py | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/modules/modpython.cpp b/modules/modpython.cpp index e86a966a..4c65a8a7 100644 --- a/modules/modpython.cpp +++ b/modules/modpython.cpp @@ -320,28 +320,15 @@ public: } virtual ~CModPython() { - const map& users = CZNC::Get().GetUserMap(); - for (map::const_iterator i = users.begin(); i != users.end(); ++i) { - CModules& M = i->second->GetModules(); - bool cont; - do { - cont = false; - for (CModules::iterator it = M.begin(); it != M.end(); ++it) { - CModule* m = *it; - CPyModule* mod = AsPyModule(m); - if (mod) { - cont = true; - bool bSuccess = false; - CString sRetMsg; - OnModuleUnloading(mod, bSuccess, sRetMsg); - if (!bSuccess) { - DEBUG("Error unloading python module in ~CModPython: " << sRetMsg); - } - break; - } - } - } while (cont); - } + PyObject* pyFunc = PyObject_GetAttrString(m_PyZNCModule, "unload_all"); + PyObject* pyRes = PyObject_CallFunctionObjArgs(pyFunc, NULL); + if (!pyRes) { + CString sRetMsg = GetPyExceptionStr(); + DEBUG("modpython tried to unload all modules in its destructor, but: " << sRetMsg); + } + Py_CLEAR(pyRes); + Py_CLEAR(pyFunc); + Py_CLEAR(m_PyFormatException); Py_CLEAR(m_PyZNCModule); Py_Finalize(); diff --git a/modules/modpython/znc.py b/modules/modpython/znc.py index 50bebd20..6a924140 100644 --- a/modules/modpython/znc.py +++ b/modules/modpython/znc.py @@ -423,6 +423,7 @@ def find_open(modname): # nothing found return (None, None) +_py_modules = set() def load_module(modname, args, module_type, user, network, retmsg, modpython): '''Returns 0 if not found, 1 on loading error, 2 on success''' @@ -450,23 +451,24 @@ def load_module(modname, args, module_type, user, network, retmsg, modpython): module.SetArgs(args) module.SetModPath(pymodule.__file__) module.SetType(module_type) + _py_modules.add(module) if module_type == CModInfo.UserModule: if not user: - retmsg.s = "Module [modpython] needs user for for UserModule." + retmsg.s = "Module [{}] is UserModule and needs user.".format(modname) unload_module(module) return 1 user.GetModules().push_back(module._cmod) elif module_type == CModInfo.NetworkModule: if not network: - retmsg.s = "Module [modpython] needs a network for for NetworkModule." + retmsg.s = "Module [{}] is Network module and needs a network.".format(modname) unload_module(module) return 1 network.GetModules().push_back(module._cmod) elif module_type == CModInfo.GlobalModule: CZNC.Get().GetModules().push_back(module._cmod) else: - retmsg.s = "Module [modpython] doesn't support module type." + retmsg.s = "Module [{}] doesn't support that module type.".format(modname) unload_module(module) return 1 @@ -508,6 +510,7 @@ def load_module(modname, args, module_type, user, network, retmsg, modpython): def unload_module(module): module.OnShutdown() + _py_modules.discard(module) cmod = module._cmod if module.GetType() == CModInfo.UserModule: cmod.GetUser().GetModules().removeModule(cmod) @@ -520,6 +523,12 @@ def unload_module(module): del cmod +def unload_all(): + while len(_py_modules) > 0: + mod = _py_modules.pop() + unload_module(mod) + + def get_mod_info(modname, retmsg, modinfo): '''0-not found, 1-error, 2-success''' pymodule, datadir = find_open(modname) From 2cbf26f5ff7615062862b5866732baba058a489b Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 1 Jan 2012 16:57:02 +0700 Subject: [PATCH 10/32] Support RusNet's NickServ. It requires to use /nickserv instead of /msg nickserv, so now all commands used by nickserv module are customizable. --- modules/nickserv.cpp | 70 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/modules/nickserv.cpp b/modules/nickserv.cpp index 2bfa6295..a9a04d4a 100644 --- a/modules/nickserv.cpp +++ b/modules/nickserv.cpp @@ -10,6 +10,12 @@ #include class CNickServ : public CModule { + void DoNickCommand(const CString& sCmd, const CString& sNick) { + MCString msValues; + msValues["nickname"] = sNick; + msValues["password"] = GetNV("Password"); + PutIRC(CString::NamedFormat(GetNV(sCmd), msValues)); + } public: void SetCommand(const CString& sLine) { SetNV("Password", sLine.Token(1, true)); @@ -24,7 +30,7 @@ public: if (sLine.Token(1).empty()) { PutModule("Syntax: ghost "); } else { - PutIRC("PRIVMSG NickServ :GHOST " + sLine.Token(1) + " " + GetNV("Password")); + DoNickCommand("GhostCmd", sLine.Token(1)); } } @@ -32,7 +38,7 @@ public: if (sLine.Token(1).empty()) { PutModule("Syntax: recover "); } else { - PutIRC("PRIVMSG NickServ :RECOVER " + sLine.Token(1) + " " + GetNV("Password")); + DoNickCommand("RecoverCmd", sLine.Token(1)); } } @@ -40,7 +46,7 @@ public: if (sLine.Token(1).empty()) { PutModule("Syntax: release "); } else { - PutIRC("PRIVMSG NickServ :RELEASE " + sLine.Token(1) + " " + GetNV("Password")); + DoNickCommand("ReleaseCmd", sLine.Token(1)); } } @@ -48,10 +54,38 @@ public: if (sLine.Token(1).empty()) { PutModule("Syntax: group "); } else { - PutIRC("PRIVMSG NickServ :GROUP " + sLine.Token(1) + " " + GetNV("Password")); + DoNickCommand("GroupCmd", sLine.Token(1)); } } + void ViewCommandsCommand(const CString& sLine) { + PutModule("IDENTIFY=" + GetNV("IdentifyCmd")); + PutModule("GHOST=" + GetNV("GhostCmd")); + PutModule("RECOVER=" + GetNV("RecoverCmd")); + PutModule("RELEASE=" + GetNV("ReleaseCmd")); + PutModule("GROUP=" + GetNV("GroupCmd")); + } + + void SetCommandCommand(const CString& sLine) { + CString sCmd = sLine.Token(1); + CString sNewCmd = sLine.Token(2, true); + if (sCmd.Equals("IDENTIFY")) { + SetNV("IdentifyCmd", sNewCmd); + } else if (sCmd.Equals("GHOST")) { + SetNV("GhostCmd", sNewCmd); + } else if (sCmd.Equals("RECOVER")) { + SetNV("RecoverCmd", sNewCmd); + } else if (sCmd.Equals("RELEASE")) { + SetNV("ReleaseCmd", sNewCmd); + } else if (sCmd.Equals("GROUP")) { + SetNV("GroupCmd", sNewCmd); + } else { + PutModule("No such editable command. See ViewCommands for list."); + return; + } + PutModule("Ok"); + } + MODCONSTRUCTOR(CNickServ) { AddHelpCommand(); AddCommand("Set", static_cast(&CNickServ::SetCommand), @@ -66,7 +100,10 @@ public: "nickname"); AddCommand("Group", static_cast(&CNickServ::GroupCommand), "nickname"); - + AddCommand("ViewCommands", static_cast(&CNickServ::ViewCommandsCommand), + "", "Show patterns for lines, which are being sent to NickServ"); + AddCommand("SetCommand", static_cast(&CNickServ::SetCommandCommand), + "cmd new-pattern", "Set pattern for commands"); } virtual ~CNickServ() {} @@ -77,6 +114,22 @@ public: SetArgs(""); } + if (GetNV("IdentifyCmd").empty()) { + SetNV("IdentifyCmd", "PRIVMSG NickServ :IDENTIFY {password}"); + } + if (GetNV("GhostCmd").empty()) { + SetNV("GhostCmd", "PRIVMSG NickServ :GHOST {nickname} {password}"); + } + if (GetNV("RecoverCmd").empty()) { + SetNV("RecoverCmd", "PRIVMSG NickServ :RECOVER {nickname} {password}"); + } + if (GetNV("ReleaseCmd").empty()) { + SetNV("ReleaseCmd", "PRIVMSG NickServ :RELEASE {nickname} {password}"); + } + if (GetNV("GroupCmd").empty()) { + SetNV("GroupCmd", "PRIVMSG NickServ :GROUP {nickname} {password}"); + } + return true; } @@ -84,10 +137,13 @@ public: if (!GetNV("Password").empty() && Nick.GetNick().Equals("NickServ") && (sMessage.find("msg") != CString::npos - || sMessage.find("authenticate") != CString::npos) + || sMessage.find("authenticate") != CString::npos + || sMessage.find("choose a different nickname") != CString::npos) && sMessage.AsUpper().find("IDENTIFY") != CString::npos && sMessage.find("help") == CString::npos) { - PutIRC("PRIVMSG NickServ :IDENTIFY " + GetNV("Password")); + MCString msValues; + msValues["password"] = GetNV("Password"); + PutIRC(CString::NamedFormat(GetNV("IdentifyCmd"), msValues)); } } From 7ca8aa96a2948c6dd917b6f1e344a70782e7d9f7 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 1 Jan 2012 19:47:04 +0700 Subject: [PATCH 11/32] Add missing dependency to modperl. --- modules/modperl/Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/modperl/Makefile.inc b/modules/modperl/Makefile.inc index ae92d23f..0c0af75f 100644 --- a/modules/modperl/Makefile.inc +++ b/modules/modperl/Makefile.inc @@ -45,7 +45,7 @@ modperl/ZNC.cpp: modperl/modperl.i Makefile modperl/module.h modperl/CString.i @mkdir -p .depend $(Q)$(SWIG) -perl5 -c++ -shadow -outdir modperl -I$(srcdir) -MMD -MF .depend/modperl.swig.dep -w362,315,401,402 -o $@ $< endif -modperl/functions.cpp: modperl/functions.in +modperl/functions.cpp: modperl/functions.in modperl/codegen.pl @mkdir -p modperl $(Q)$(PERL) $(srcdir)/modperl/codegen.pl $< $@ From 87aad361211aa9ad6bca07545ca0f18f1eb75f65 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 1 Jan 2012 13:47:10 +0100 Subject: [PATCH 12/32] Increase the version number to 0.205 Signed-off-by: Uli Schlachter --- configure.ac | 2 +- include/znc/main.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b6dc38e1..af9e4d00 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ AC_DEFUN([AC_PROG_CC], [m4_errprint(__file__:__line__[: Something is trying to u dnl Needed for AC_PATH_PROGS_FEATURE_CHECK which was added in 2.62 AC_PREREQ([2.62]) dnl Keep the version number in sync with main.h! -AC_INIT([znc], [0.203]) +AC_INIT([znc], [0.205]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/znc.cpp]) AC_LANG([C++]) diff --git a/include/znc/main.h b/include/znc/main.h index 35594dd3..3ac92305 100644 --- a/include/znc/main.h +++ b/include/znc/main.h @@ -13,7 +13,7 @@ // The following defines are for #if comparison (preprocessor only likes ints) #define VERSION_MAJOR 0 -#define VERSION_MINOR 203 +#define VERSION_MINOR 205 // This one is for display purpose #define VERSION (VERSION_MAJOR + VERSION_MINOR / 1000.0) From 78c6b1edd2c040aed51e1e95d233875ae15ff867 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 1 Jan 2012 22:04:22 +0700 Subject: [PATCH 13/32] Fix moddata path for python modules. How did it ever work before? >< --- modules/modpython/znc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/modpython/znc.py b/modules/modpython/znc.py index fdf36897..5deb020a 100644 --- a/modules/modpython/znc.py +++ b/modules/modpython/znc.py @@ -418,7 +418,7 @@ def find_open(modname): finally: if x[0]: x[0].close() - return (pymodule, d[1]) + return (pymodule, d[1]+modname) else: # nothing found return (None, None) From 13bfec0809a4375de893d70fff968a7d40f68466 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 2 Jan 2012 02:38:52 +0700 Subject: [PATCH 14/32] Python and Perl should know that off_t is integer type. --- modules/modperl/modperl.i | 2 ++ modules/modpython/modpython.i | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/modperl/modperl.i b/modules/modperl/modperl.i index e98d1f0c..87a284b3 100644 --- a/modules/modperl/modperl.i +++ b/modules/modperl/modperl.i @@ -41,6 +41,8 @@ #define stat struct stat %} +%apply long { off_t }; + %begin %{ #include "znc/zncconfig.h" %} diff --git a/modules/modpython/modpython.i b/modules/modpython/modpython.i index c21c27c6..4c574447 100644 --- a/modules/modpython/modpython.i +++ b/modules/modpython/modpython.i @@ -36,6 +36,8 @@ using std::allocator; %} +%apply long { off_t }; + %begin %{ #include "znc/zncconfig.h" %} From f374874b1a2322f0349ecdefe63a2b91f2b9899e Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 2 Jan 2012 14:39:17 +0700 Subject: [PATCH 15/32] Fix several issues in modpython. 1. In several cases CString wasn't handled properly. 2. Some container-like object didn't return from functions properly. 3. Buffer.h was missing --- modules/modpython/cstring.i | 16 +++++++++++++--- modules/modpython/modpython.i | 15 +++++++++++++++ modules/modpython/znc.py | 4 ++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/modules/modpython/cstring.i b/modules/modpython/cstring.i index 925000a2..8afb4348 100644 --- a/modules/modpython/cstring.i +++ b/modules/modpython/cstring.i @@ -69,7 +69,7 @@ SWIG_AsVal_std_string (PyObject * obj, CString *val) } /*@SWIG@*/ /*@SWIG:/usr/share/swig1.3/typemaps/std_strings.swg,38,%std_string_from@*/ -%fragment("SWIG_" "From" "_" {CString},"header",fragment="SWIG_FromCharPtrAndSize") { +%fragment("SWIG_" "From" "_" {CString},"header",fragment="SWIG_FromCharPtrAndSize",fragment="StdTraits") { SWIGINTERNINLINE PyObject * SWIG_From_std_string (const CString& s) { @@ -82,6 +82,17 @@ SWIG_From_std_string (const CString& s) } /*@SWIG@*/ +%fragment("StdTraitsCString","header",fragment="SWIG_From_CString") { + namespace swig { + template<> struct traits_from { + static PyObject *from(const CString& s) { + return SWIG_From_std_string(s); + } + }; + } +} + + /*@SWIG:/usr/share/swig1.3/typemaps/ptrtypes.swg,204,%typemaps_asptrfromn@*/ /*@SWIG:/usr/share/swig1.3/typemaps/ptrtypes.swg,193,%typemaps_asptrfrom@*/ /*@SWIG:/usr/share/swig1.3/typemaps/ptrtypes.swg,163,%typemaps_asptr@*/ @@ -104,7 +115,7 @@ SWIG_From_std_string (const CString& s) } } /*@SWIG:/usr/share/swig1.3/typemaps/ptrtypes.swg,31,%ptr_in_typemap@*/ - %typemap(in,fragment="SWIG_" "AsPtr" "_" {CString}) CString { + %typemap(in,fragment="SWIG_" "AsPtr" "_" {CString},fragment="StdTraitsCString") CString { CString *ptr = (CString *)0; int res = SWIG_AsPtr_std_string($input, &ptr); if (!SWIG_IsOK(res) || !ptr) { @@ -329,4 +340,3 @@ SWIG_From_std_string (const CString& s) /*@SWIG@*/; - diff --git a/modules/modpython/modpython.i b/modules/modpython/modpython.i index 4c574447..df2cd6a5 100644 --- a/modules/modpython/modpython.i +++ b/modules/modpython/modpython.i @@ -28,6 +28,7 @@ #include "../include/znc/FileUtils.h" #include "../include/znc/ZNCDebug.h" #include "../include/znc/ExecSock.h" +#include "../include/znc/Buffer.h" #include "modpython/module.h" #include "modpython/retstring.h" @@ -67,6 +68,10 @@ namespace std { } %} +%template(VIRCNetworks) std::vector; +%template(VChannels) std::vector; +%template(MNicks) std::map; + %typemap(in) CString& { String* p; int res = SWIG_IsOK(SWIG_ConvertPtr($input, (void**)&p, SWIG_TypeQuery("String*"), 0)); @@ -111,6 +116,7 @@ namespace std { %include "../include/znc/Server.h" %include "../include/znc/ZNCDebug.h" %include "../include/znc/ExecSock.h" +%include "../include/znc/Buffer.h" %include "modpython/module.h" @@ -167,6 +173,9 @@ public: CString __repr__() { return "GetUserName() + ">"; } + std::vector GetNetworks_() { + return $self->GetNetworks(); + } }; %extend CIRCNetwork { @@ -176,6 +185,9 @@ public: CString __repr__() { return "GetName() + ">"; } + std::vector GetChans_() { + return $self->GetChans(); + } } %extend CChan { @@ -185,6 +197,9 @@ public: CString __repr__() { return "GetName() + ">"; } + std::map GetNicks_() { + return $self->GetNicks(); + } }; %extend CNick { diff --git a/modules/modpython/znc.py b/modules/modpython/znc.py index 5deb020a..fb0741d8 100644 --- a/modules/modpython/znc.py +++ b/modules/modpython/znc.py @@ -604,3 +604,7 @@ def CreateWebSubPage(name, title='', params=dict(), admin=False): if admin: flags |= CWebSubPage.F_ADMIN return CreateWebSubPage_(name, title, vpair, flags) + +CUser.GetNetworks = CUser.GetNetworks_ +CIRCNetwork.GetChans = CIRCNetwork.GetChans_ +CChan.GetNicks = CChan.GetNicks_ From 6274111aa7482f4a8c20fa4198cd1c7cb9f3223e Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 2 Jan 2012 16:25:14 +0700 Subject: [PATCH 16/32] Add one more message for nickserv's request to auth. --- modules/nickserv.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nickserv.cpp b/modules/nickserv.cpp index f103a24c..b8a5c988 100644 --- a/modules/nickserv.cpp +++ b/modules/nickserv.cpp @@ -138,7 +138,8 @@ public: && Nick.GetNick().Equals("NickServ") && (sMessage.find("msg") != CString::npos || sMessage.find("authenticate") != CString::npos - || sMessage.find("choose a different nickname") != CString::npos) + || sMessage.find("choose a different nickname") != CString::npos + || sMessage.find("If this is your nick, type") != CString::npos) && sMessage.AsUpper().find("IDENTIFY") != CString::npos && sMessage.find("help") == CString::npos) { MCString msValues; From 9680b6a8eb0cdd45c0735e63a17f9beaceff108a Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 2 Jan 2012 19:04:56 +0700 Subject: [PATCH 17/32] Make autovoice a network module. Thanks to nyuszika7h for suggestion. --- modules/extra/autovoice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/extra/autovoice.cpp b/modules/extra/autovoice.cpp index 1ddbe6bf..b2564654 100644 --- a/modules/extra/autovoice.cpp +++ b/modules/extra/autovoice.cpp @@ -275,4 +275,4 @@ private: map m_msUsers; }; -MODULEDEFS(CAutoVoiceMod, "Auto voice the good guys") +NETWORKMODULEDEFS(CAutoVoiceMod, "Auto voice the good guys") From 8ca1859a22de22a3c4f6beec4488f1fed0ca24ef Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 9 Jan 2012 02:52:02 +0700 Subject: [PATCH 18/32] Fix python in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f2dde55..e30aaeb1 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ will make ZNC rewrite its config file. Alternatively you can use this: ## Writing own modules -You can write your own modules in either C++ or perl. +You can write your own modules in either C++, python or perl. C++ modules are compiled by either saving them in the modules source dir and running make or with the znc-buildmod shell script. @@ -148,7 +148,7 @@ For additional info look in the wiki: Perl modules are loaded through the global module modperl. Details: [ModPerl](http://wiki.znc.in/Modperl) -Python modules are loaded throug the global module modpython. +Python modules are loaded through the global module modpython. Details: [ModPython](http://wiki.znc.in/Modpython) ## Further infos From 8e558e83ab9254881776ad8d57ad331e208abe2f Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 9 Jan 2012 16:45:48 +0700 Subject: [PATCH 19/32] nickserv: support also wenet.ru's nickserv request. --- modules/nickserv.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nickserv.cpp b/modules/nickserv.cpp index b8a5c988..f3cefa86 100644 --- a/modules/nickserv.cpp +++ b/modules/nickserv.cpp @@ -139,7 +139,8 @@ public: && (sMessage.find("msg") != CString::npos || sMessage.find("authenticate") != CString::npos || sMessage.find("choose a different nickname") != CString::npos - || sMessage.find("If this is your nick, type") != CString::npos) + || sMessage.find("If this is your nick, type") != CString::npos + || sMessage.find("type /NickServ IDENTIFY password") != CString::npos) && sMessage.AsUpper().find("IDENTIFY") != CString::npos && sMessage.find("help") == CString::npos) { MCString msValues; From 9fdac9f37ad61ed1b2f7bab60ee47d26fb7112c3 Mon Sep 17 00:00:00 2001 From: TEP Date: Tue, 10 Jan 2012 21:37:16 -0500 Subject: [PATCH 20/32] Modified description field for bouncedcc module to explain what the module actually does. --- modules/bouncedcc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/bouncedcc.cpp b/modules/bouncedcc.cpp index 33f89a4b..054eafaf 100644 --- a/modules/bouncedcc.cpp +++ b/modules/bouncedcc.cpp @@ -451,5 +451,5 @@ unsigned short CDCCBounce::DCCRequest(const CString& sNick, unsigned long uLongI -MODULEDEFS(CBounceDCCMod, "Bounce DCC module") +MODULEDEFS(CBounceDCCMod, "This module bounces DCC transfers through the ZNC server instead of sending them directly to the user. ") From 1b7c9f4ed0a09c22dc00eb9ef4c5be97852b08bc Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Wed, 11 Jan 2012 09:46:56 +0700 Subject: [PATCH 21/32] Make bouncedcc's description a bit shorter to fit in small tables better in output of *status. --- modules/bouncedcc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/bouncedcc.cpp b/modules/bouncedcc.cpp index 054eafaf..9f041f88 100644 --- a/modules/bouncedcc.cpp +++ b/modules/bouncedcc.cpp @@ -451,5 +451,5 @@ unsigned short CDCCBounce::DCCRequest(const CString& sNick, unsigned long uLongI -MODULEDEFS(CBounceDCCMod, "This module bounces DCC transfers through the ZNC server instead of sending them directly to the user. ") +MODULEDEFS(CBounceDCCMod, "Bounces DCC transfers through ZNC instead of sending them directly to the user. ") From 4abf3feae448253692e1ae3e32d1a79577f156b8 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Wed, 11 Jan 2012 13:09:16 +0000 Subject: [PATCH 22/32] Remove trailing whitespace --- README.md | 10 +++++----- modules/extra/autoaway.cpp | 2 +- src/User.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e30aaeb1..372005ca 100644 --- a/README.md +++ b/README.md @@ -141,14 +141,14 @@ You can write your own modules in either C++, python or perl. C++ modules are compiled by either saving them in the modules source dir and running make or with the znc-buildmod shell script. -For additional info look in the wiki: - [Writing Modules](http://wiki.znc.in/WritingModules) - [Module Hooks](http://wiki.znc.in/ModuleHooks) +For additional info look in the wiki: + [Writing Modules](http://wiki.znc.in/WritingModules) + [Module Hooks](http://wiki.znc.in/ModuleHooks) -Perl modules are loaded through the global module modperl. +Perl modules are loaded through the global module modperl. Details: [ModPerl](http://wiki.znc.in/Modperl) -Python modules are loaded through the global module modpython. +Python modules are loaded through the global module modpython. Details: [ModPython](http://wiki.znc.in/Modpython) ## Further infos diff --git a/modules/extra/autoaway.cpp b/modules/extra/autoaway.cpp index e5672cc6..4b0a99c8 100644 --- a/modules/extra/autoaway.cpp +++ b/modules/extra/autoaway.cpp @@ -10,7 +10,7 @@ * * I originally wrote this module for when I had multiple clients connected to ZNC. I would leave work and forget to close my client, arriving at home * and re-attaching there someone may have messaged me in commute and I wouldn't know it until I would arrive back at work the next day. I wrote it such that - * my xchat client would monitor desktop activity and ping the module to let it know I was active. Within a few minutes of inactivity the pinging stops and + * my xchat client would monitor desktop activity and ping the module to let it know I was active. Within a few minutes of inactivity the pinging stops and * the away module sets the user as away and logging commences. */ diff --git a/src/User.cpp b/src/User.cpp index 85331b0f..2bf61a94 100644 --- a/src/User.cpp +++ b/src/User.cpp @@ -386,7 +386,7 @@ bool CUser::ParseConfig(CConfig* pConfig, CString& sError) { CString sNetworkModPath = (*it)->GetNetworkPath() + "/moddata/" + sModName; if (!CFile::Exists(sNetworkModPath)) { CDir::MakeDir(sNetworkModPath); - } + } fNVFile.Copy(sNetworkModPath + "/.registry"); } From 3d7d1793aa8b7c1ab5719cb07fd12ecff1df2c05 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Wed, 11 Jan 2012 14:06:11 +0000 Subject: [PATCH 23/32] Move IRCConnectEnabled to each network instead of a global user setting --- include/znc/IRCNetwork.h | 4 +++ include/znc/User.h | 3 -- modules/admin.cpp | 13 ++----- modules/blockuser.cpp | 9 +---- .../data/webadmin/tmpl/add_edit_network.tmpl | 6 ++++ modules/data/webadmin/tmpl/add_edit_user.tmpl | 8 ----- modules/webadmin.cpp | 8 +++-- src/ClientCommand.cpp | 5 ++- src/IRCNetwork.cpp | 35 +++++++++++++++++-- src/IRCSock.cpp | 2 +- src/User.cpp | 11 +++--- 11 files changed, 60 insertions(+), 44 deletions(-) diff --git a/include/znc/IRCNetwork.h b/include/znc/IRCNetwork.h index a9ea3336..1895472d 100644 --- a/include/znc/IRCNetwork.h +++ b/include/znc/IRCNetwork.h @@ -89,6 +89,9 @@ public: bool SetNextServer(const CServer* pServer); bool IsLastServer() const; + void SetIRCConnectEnabled(bool b); + bool GetIRCConnectEnabled() const { return m_bIRCConnectEnabled; } + CIRCSock* GetIRCSock() { return m_pIRCSock; } const CIRCSock* GetIRCSock() const { return m_pIRCSock; } const CString& GetIRCServer() const; @@ -159,6 +162,7 @@ protected: CString m_sChanPrefixes; + bool m_bIRCConnectEnabled; CString m_sIRCServer; vector m_vServers; unsigned int m_uServerIdx; ///< Index in m_vServers of our current server + 1 diff --git a/include/znc/User.h b/include/znc/User.h index 266c2931..6e375dcb 100644 --- a/include/znc/User.h +++ b/include/znc/User.h @@ -125,7 +125,6 @@ public: void SetJoinTries(unsigned int i) { m_uMaxJoinTries = i; } void SetMaxJoins(unsigned int i) { m_uMaxJoins = i; } void SetSkinName(const CString& s) { m_sSkinName = s; } - void SetIRCConnectEnabled(bool b) { m_bIRCConnectEnabled = b; } // !Setters // Getters @@ -146,7 +145,6 @@ public: const CString& GetTimestampFormat() const; bool GetTimestampAppend() const; bool GetTimestampPrepend() const; - bool GetIRCConnectEnabled() const { return m_bIRCConnectEnabled; } const CString& GetUserPath() const; @@ -202,7 +200,6 @@ protected: bool m_bBeingDeleted; bool m_bAppendTimestamp; bool m_bPrependTimestamp; - bool m_bIRCConnectEnabled; CUserTimer* m_pUserTimer; diff --git a/modules/admin.cpp b/modules/admin.cpp index bac6a8a5..9133960e 100644 --- a/modules/admin.cpp +++ b/modules/admin.cpp @@ -559,7 +559,6 @@ class CAdminMod : public CModule { PutModule("Error: Cloning failed! [" + sError + "]"); return; } - pNewUser->SetIRCConnectEnabled(false); if (!CZNC::Get().AddUser(pNewUser, sError)) { delete pNewUser; @@ -730,8 +729,7 @@ class CAdminMod : public CModule { } // then reconnect - pUser->SetIRCConnectEnabled(true); - pNetwork->CheckIRCConnect(); + pNetwork->SetIRCConnectEnabled(true); PutModule("Queued user for a reconnect."); } @@ -757,14 +755,7 @@ class CAdminMod : public CModule { return; } - CIRCSock *pIRCSock = pNetwork->GetIRCSock(); - if (pIRCSock && !pIRCSock->IsConnected()) - pIRCSock->Close(); - else if(pIRCSock) - pIRCSock->Quit(); - - pUser->SetIRCConnectEnabled(false); - + pNetwork->SetIRCConnectEnabled(false); PutModule("Closed user's IRC connection."); } diff --git a/modules/blockuser.cpp b/modules/blockuser.cpp index e04287ee..7d06b673 100644 --- a/modules/blockuser.cpp +++ b/modules/blockuser.cpp @@ -158,16 +158,9 @@ private: // Disconnect all networks from irc vector vNetworks = pUser->GetNetworks(); for (vector::iterator it2 = vNetworks.begin(); it2 != vNetworks.end(); ++it2) { - CIRCNetwork *pNetwork = *it2; - CIRCSock *pIRCSock = pNetwork->GetIRCSock(); - if (pIRCSock) { - pIRCSock->Quit(); - } + (*it2)->SetIRCConnectEnabled(false); } - // ...and don't reconnect - pUser->SetIRCConnectEnabled(false); - SetNV(pUser->GetUserName(), ""); return true; } diff --git a/modules/data/webadmin/tmpl/add_edit_network.tmpl b/modules/data/webadmin/tmpl/add_edit_network.tmpl index 3131add1..24c715df 100644 --- a/modules/data/webadmin/tmpl/add_edit_network.tmpl +++ b/modules/data/webadmin/tmpl/add_edit_network.tmpl @@ -38,6 +38,12 @@
+
+
Active:
+
checked="checked" /> +
+
+
Servers: