diff options
Diffstat (limited to 'src/modes')
-rw-r--r-- | src/modes/cmode_b.cpp | 7 | ||||
-rw-r--r-- | src/modes/cmode_h.cpp | 7 | ||||
-rw-r--r-- | src/modes/cmode_k.cpp | 8 | ||||
-rw-r--r-- | src/modes/cmode_o.cpp | 6 | ||||
-rw-r--r-- | src/modes/cmode_v.cpp | 6 |
5 files changed, 10 insertions, 24 deletions
diff --git a/src/modes/cmode_b.cpp b/src/modes/cmode_b.cpp index f82c1296b..1c6fe3fa5 100644 --- a/src/modes/cmode_b.cpp +++ b/src/modes/cmode_b.cpp @@ -53,21 +53,18 @@ void ModeChannelBan::RemoveMode(chanrec* channel) { BanList copy; char moderemove[MAXBUF]; - userrec* n = new userrec(ServerInstance); - n->SetFd(FD_MAGIC_NUMBER); for (BanList::iterator i = channel->bans.begin(); i != channel->bans.end(); i++) { copy.push_back(*i); } + for (BanList::iterator i = copy.begin(); i != copy.end(); i++) { sprintf(moderemove,"-%c",this->GetModeChar()); const char* parameters[] = { channel->name, moderemove, i->data }; - ServerInstance->SendMode(parameters, 3, n); + ServerInstance->SendMode(parameters, 3, ServerInstance->FakeClient); } - - delete n; } void ModeChannelBan::RemoveMode(userrec* user) diff --git a/src/modes/cmode_h.cpp b/src/modes/cmode_h.cpp index ecee93388..831ec809c 100644 --- a/src/modes/cmode_h.cpp +++ b/src/modes/cmode_h.cpp @@ -50,21 +50,20 @@ void ModeChannelHalfOp::RemoveMode(chanrec* channel) CUList* list = channel->GetHalfoppedUsers(); 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++) { userrec* 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); + ServerInstance->SendMode(parameters, 3, ServerInstance->FakeClient); } - delete n; + } void ModeChannelHalfOp::RemoveMode(userrec* user) diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index eb59714f7..f6a29af35 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -43,14 +43,8 @@ void ModeChannelKey::RemoveMode(chanrec* channel) if (channel->IsModeSet(this->GetModeChar())) { - userrec* n = new userrec(ServerInstance); - sprintf(moderemove,"-%c",this->GetModeChar()); - n->SetFd(FD_MAGIC_NUMBER); - - ServerInstance->SendMode(parameters, 3, n); - - delete n; + ServerInstance->SendMode(parameters, 3, ServerInstance->FakeClient); } } diff --git a/src/modes/cmode_o.cpp b/src/modes/cmode_o.cpp index 47d191ff8..27bc62100 100644 --- a/src/modes/cmode_o.cpp +++ b/src/modes/cmode_o.cpp @@ -51,21 +51,19 @@ void ModeChannelOp::RemoveMode(chanrec* channel) CUList* list = channel->GetOppedUsers(); 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++) { userrec* 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); + ServerInstance->SendMode(parameters, 3, ServerInstance->FakeClient); } - delete n; } void ModeChannelOp::RemoveMode(userrec* user) diff --git a/src/modes/cmode_v.cpp b/src/modes/cmode_v.cpp index 1e244c606..0ea887073 100644 --- a/src/modes/cmode_v.cpp +++ b/src/modes/cmode_v.cpp @@ -50,21 +50,19 @@ void ModeChannelVoice::RemoveMode(chanrec* channel) CUList* list = 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++) { userrec* 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); + ServerInstance->SendMode(parameters, 3, ServerInstance->FakeClient); } - delete n; } void ModeChannelVoice::RemoveMode(userrec* user) |