X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_callerid.cpp;h=0edea714cc6838aea40c5146c8e527aba7e9b137;hb=95fd083b589d7b16df98fe00711e8ac2cf9cc871;hp=95e663a5bc10251079ae0e7f679057d031343c05;hpb=49d8629c3f7dd38b21abe8c5d13f356efc21db4d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 95e663a5b..0edea714c 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -1,12 +1,19 @@ -#include "inspircd.h" -#include "users.h" -#include "channels.h" -#include "modules.h" +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits + * + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ +#include "inspircd.h" #include - #include - #include /* $ModDesc: Implementation of callerid (umode +g & /accept, ala hybrid etc) */ @@ -49,7 +56,7 @@ class callerid_data : public classbase { std::ostringstream oss; oss << lastnotify; - for (std::set::iterator i = accepting.begin(); i != accepting.end(); ++i) + for (std::set::const_iterator i = accepting.begin(); i != accepting.end(); ++i) { // Encode UIDs. oss << "," << (displayable ? (*i)->nick : (*i)->uuid); @@ -232,6 +239,8 @@ public: return false; } + + user->WriteServ("NOTICE %s :%s is now on your accept list", user->nick.c_str(), whotoadd->nick.c_str()); return true; } @@ -253,6 +262,8 @@ public: return false; } + + user->WriteServ("NOTICE %s :%s is no longer on your accept list", user->nick.c_str(), whotoremove->nick.c_str()); dat->accepting.erase(i); return true; } @@ -306,7 +317,7 @@ public: virtual Version GetVersion() { - return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); } virtual void On005Numeric(std::string& output) @@ -323,17 +334,17 @@ public: return 0; callerid_data* dat = GetData(dest, true); - std::set::iterator i = dat->accepting.find(dest); + std::set::iterator i = dat->accepting.find(user); if (i == dat->accepting.end()) { - time_t now = time(NULL); + time_t now = ServerInstance->Time(); /* +g and *not* accepted */ user->WriteNumeric(716, "%s %s :is in +g mode (server-side ignore).", user->nick.c_str(), dest->nick.c_str()); if (now > (dat->lastnotify + (time_t)notify_cooldown)) { user->WriteNumeric(717, "%s %s :has been informed that you messaged them.", user->nick.c_str(), dest->nick.c_str()); - dest->WriteNumeric(718, "%s %s %s@%s :is messaging you, and you have umode +g", dest->nick.c_str(), user->nick.c_str(), user->ident.c_str(), user->dhost.c_str()); + dest->WriteNumeric(718, "%s %s %s@%s :is messaging you, and you have umode +g. Use /ACCEPT +%s to allow.", dest->nick.c_str(), user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), user->nick.c_str()); dat->lastnotify = now; } return 1;