X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_auditorium.cpp;h=023cb7adf431f0194aae55111773aaa956cab399;hb=77954a2e31213ce355e9e319229c767dfbd698a4;hp=0a1555b29caa702293e4d81b3e754b6edf58a042;hpb=6f8972c518efe0f7485126289f8fcbe15b979567;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp index 0a1555b29..023cb7adf 100644 --- a/src/modules/m_auditorium.cpp +++ b/src/modules/m_auditorium.cpp @@ -26,7 +26,7 @@ class AuditoriumMode : public ModeHandler { if (IS_LOCAL(source) && (channel->GetStatus(source) < STATUS_OP)) { - source->WriteNumeric(482, "%s %s :Only channel operators may %sset channel mode +u", source->nick.c_str(), channel->name, adding ? "" : "un"); + source->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :Only channel operators may %sset channel mode +u", source->nick.c_str(), channel->name.c_str(), adding ? "" : "un"); return MODEACTION_DENY; } else @@ -67,7 +67,7 @@ class ModuleAuditorium : public Module Me->Modules->Attach(eventlist, this, 6); } - + virtual ~ModuleAuditorium() { ServerInstance->Modes->DelMode(aum); @@ -83,10 +83,10 @@ class ModuleAuditorium : public Module 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 OnNamesListItem(User* issuer, User* user, Channel* channel, std::string &prefixes, std::string &nick) + virtual void OnNamesListItem(User* issuer, User* user, Channel* channel, std::string &prefixes, std::string &nick) { if (!channel->IsModeSet('u')) return; @@ -113,31 +113,31 @@ class ModuleAuditorium : public Module return; } } - + virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent) { if (channel->IsModeSet('u')) { silent = true; /* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */ - user->WriteFrom(user, "JOIN %s", channel->name); + user->WriteFrom(user, "JOIN %s", channel->name.c_str()); if (ShowOps) - channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "JOIN %s", channel->name); + channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "JOIN %s", channel->name.c_str()); } } - void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent) + void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent) { if (channel->IsModeSet('u')) { silent = true; /* Because we silenced the event, make sure it reaches the user whos leaving (but only them of course) */ - user->WriteFrom(user, "PART %s%s%s", channel->name, + user->WriteFrom(user, "PART %s%s%s", channel->name.c_str(), partmessage.empty() ? "" : " :", partmessage.empty() ? "" : partmessage.c_str()); if (ShowOps) { - channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "PART %s%s%s", channel->name, partmessage.empty() ? "" : " :", + channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "PART %s%s%s", channel->name.c_str(), partmessage.empty() ? "" : " :", partmessage.empty() ? "" : partmessage.c_str()); } } @@ -149,11 +149,11 @@ class ModuleAuditorium : public Module { silent = true; /* Send silenced event only to the user being kicked and the user doing the kick */ - source->WriteFrom(source, "KICK %s %s %s", chan->name, user->nick.c_str(), reason.c_str()); + source->WriteFrom(source, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str()); if (ShowOps) - chan->WriteAllExcept(source, false, chan->GetStatus(source) >= STATUS_OP ? 0 : '@', except_list, "KICK %s %s %s", chan->name, user->nick.c_str(), reason.c_str()); + chan->WriteAllExcept(source, false, chan->GetStatus(source) >= STATUS_OP ? 0 : '@', except_list, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str()); else - user->WriteFrom(source, "KICK %s %s %s", chan->name, user->nick.c_str(), reason.c_str()); + user->WriteFrom(source, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str()); } }