X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_callerid.cpp;h=c7ec7a4dbe93528a65fc4039d6a647d7e96f5d32;hb=de69e28a4a1aea89e410b693bbbb67890ecb0bd3;hp=94dd009c3c42cf9f46b4b30032bc6571afb1cd97;hpb=e80a1296a096ff2c495b3cd2a3913d5e5f6ec450;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 94dd009c3..c7ec7a4db 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -18,7 +18,7 @@ /* $ModDesc: Implementation of callerid (umode +g & /accept, ala hybrid etc) */ -class callerid_data : public classbase +class callerid_data { public: time_t lastnotify; @@ -93,7 +93,7 @@ struct CallerIDExtInfo : public ExtensionItem callerid_data* get(User* user, bool create) { callerid_data* dat = static_cast(get_raw(user)); - if (!dat) + if (create && !dat) { dat = new callerid_data; set_raw(user, dat); @@ -362,7 +362,7 @@ public: virtual Version GetVersion() { - return Version("Implementation of callerid (umode +g & /accept, ala hybrid etc)", VF_COMMON | VF_VENDOR, API_VERSION); + return Version("Implementation of callerid (umode +g & /accept, ala hybrid etc)", VF_COMMON | VF_VENDOR); } virtual void On005Numeric(std::string& output) @@ -389,7 +389,7 @@ public: 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()); - ServerInstance->DumpText(dest, ":%s 718 %s %s %s@%s :is messaging you, and you have umode +g. Use /ACCEPT +%s to allow.", + dest->SendText(":%s 718 %s %s %s@%s :is messaging you, and you have umode +g. Use /ACCEPT +%s to allow.", ServerInstance->Config->ServerName.c_str(), dest->nick.c_str(), user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), user->nick.c_str()); dat->lastnotify = now; }