X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_rline.cpp;h=88e40811bb878a267ad571d44862bcb76c34d510;hb=b07868e77c0527642ed72bce84bf5895bf921e87;hp=189479efc138eebf373ae6bbd4f3bbc85167c82d;hpb=dd36852a52e8541306b76c5b88bce8ab9b36654c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_rline.cpp b/src/modules/extra/m_rline.cpp index 189479efc..88e40811b 100644 --- a/src/modules/extra/m_rline.cpp +++ b/src/modules/extra/m_rline.cpp @@ -62,7 +62,7 @@ class CoreExport RLine : public XLine { std::string compare = std::string(u->nick) + "!" + u->ident + "@" + u->host + " " + u->fullname; - ServerInstance->Log(DEBUG, "Matching " + matchtext + " against string " + compare); + ServerInstance->Logs->Log("m_rline",DEBUG, "Matching " + matchtext + " against string " + compare); if (pcre_exec(regex, NULL, compare.c_str(), compare.length(), 0, 0, NULL, 0) > -1) { @@ -91,7 +91,7 @@ class CoreExport RLine : public XLine void DisplayExpiry() { - ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed R-Line %s (set by %s %d seconds ago)", this->matchtext.c_str(), this->source, this->duration); + ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed R-Line %s (set by %s %ld seconds ago)", this->matchtext.c_str(), this->source, this->duration); } const char* Displayable() @@ -205,6 +205,10 @@ class ModuleRLine : public Module f = new RLineFactory(ServerInstance); ServerInstance->XLines->RegisterFactory(f); + + Implementation eventlist[] = { I_OnUserConnect }; + ServerInstance->Modules->Attach(eventlist, this, 1); + } virtual ~ModuleRLine() @@ -214,7 +218,19 @@ class ModuleRLine : public Module virtual Version GetVersion() { - return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION); + return Version(1,2,0,0,VF_COMMON|VF_VENDOR,API_VERSION); + } + + virtual void OnUserConnect(User* user) + { + // Apply lines on user connect + XLine *rl = ServerInstance->XLines->MatchesLine("R", user); + + if (rl) + { + // Bang. :P + rl->Apply(user); + } } };