X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodes%2Fcmode_v.cpp;h=15196d4a89c3d75164e196efb27630e8cfa6232a;hb=0376f1d8be09a242befe207be4fa9e809d098557;hp=1e244c606eaf74d8b26b142543d1ad8c8d7ce8ae;hpb=f2acdbc3820f0f4f5ef76a0a64e73d2a320df91f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modes/cmode_v.cpp b/src/modes/cmode_v.cpp index 1e244c606..15196d4a8 100644 --- a/src/modes/cmode_v.cpp +++ b/src/modes/cmode_v.cpp @@ -1,8 +1,9 @@ + /* +------------------------------------+ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * InspIRCd: (C) 2002-2008 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -28,9 +29,9 @@ unsigned int ModeChannelVoice::GetPrefixRank() return VOICE_VALUE; } -ModePair ModeChannelVoice::ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) +ModePair ModeChannelVoice::ModeSet(User*, User*, Channel* channel, const std::string ¶meter) { - userrec* x = ServerInstance->FindNick(parameter); + User* x = ServerInstance->FindNick(parameter); if (x) { if (channel->GetStatusFlags(x) & UCMODE_VOICE) @@ -45,33 +46,36 @@ ModePair ModeChannelVoice::ModeSet(userrec* source, userrec* dest, chanrec* chan return std::make_pair(false, parameter); } -void ModeChannelVoice::RemoveMode(chanrec* channel) +void ModeChannelVoice::RemoveMode(Channel* channel, irc::modestacker* stack) { - CUList* list = channel->GetVoicedUsers(); + CUList* clist = channel->GetVoicedUsers(); CUList copy; char moderemove[MAXBUF]; - userrec* n = new userrec(ServerInstance); - n->SetFd(FD_MAGIC_NUMBER); - for (CUList::iterator i = list->begin(); i != list->end(); i++) + for (CUList::iterator i = clist->begin(); i != clist->end(); i++) { - userrec* n = i->first; + User* n = i->first; copy.insert(std::make_pair(n,n->nick)); } + for (CUList::iterator i = copy.begin(); i != copy.end(); i++) { - sprintf(moderemove,"-%c",this->GetModeChar()); - const char* parameters[] = { channel->name, moderemove, i->first->nick }; - ServerInstance->SendMode(parameters, 3, n); + if (stack) + stack->Push(this->GetModeChar(), i->first->nick); + else + { + sprintf(moderemove,"-%c",this->GetModeChar()); + const char* parameters[] = { channel->name, moderemove, i->first->nick }; + ServerInstance->SendMode(parameters, 3, ServerInstance->FakeClient); + } } - delete n; } -void ModeChannelVoice::RemoveMode(userrec* user) +void ModeChannelVoice::RemoveMode(User*, irc::modestacker* stack) { } -ModeAction ModeChannelVoice::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) +ModeAction ModeChannelVoice::OnModeChange(User* source, User*, Channel* channel, std::string ¶meter, bool adding, bool servermode) { int status = channel->GetStatus(source); @@ -95,9 +99,9 @@ ModeAction ModeChannelVoice::OnModeChange(userrec* source, userrec* dest, chanre return MODEACTION_DENY; } -std::string ModeChannelVoice::AddVoice(userrec *user,const char* dest,chanrec *chan,int status) +std::string ModeChannelVoice::AddVoice(User *user,const char* dest,Channel *chan,int status) { - userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); + User *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); if (d) { @@ -123,9 +127,9 @@ std::string ModeChannelVoice::AddVoice(userrec *user,const char* dest,chanrec *c return ""; } -std::string ModeChannelVoice::DelVoice(userrec *user,const char *dest,chanrec *chan,int status) +std::string ModeChannelVoice::DelVoice(User *user,const char *dest,Channel *chan,int status) { - userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); + User *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); if (d) {