- chanrec* cr = Srv->FindChannel(i->channel);
- again = true;
- if (cr)
- {
- Srv->SendChannelServerNotice(Srv->GetServerName(),cr,"NOTICE "+std::string(cr->name)+" :Timed ban on "+i->mask+" expired.");
- const char *setban[3];
- setban[0] = i->channel.c_str();
- setban[1] = "-b";
- setban[2] = i->mask.c_str();
- // kludge alert!
- // ::SendMode expects a userrec* to send the numeric replies
- // back to, so we create it a fake user that isnt in the user
- // hash and set its descriptor to FD_MAGIC_NUMBER so the data
- // falls into the abyss :p
- userrec* temp = new userrec;
- temp->fd = FD_MAGIC_NUMBER;
- temp->server = "";
- Srv->SendMode(setban,3,temp);
- /* FIX: Send mode remotely*/
- std::deque<std::string> n;
- n.push_back(i->channel);
- n.push_back("-b");
- n.push_back(i->mask);
- Event rmode((char *)&n, NULL, "send_mode");
- rmode.Send();
- DELETE(temp);
- }
- else
+ std::vector<std::string> setban;
+ setban.push_back(chan);
+ setban.push_back("-b");
+ setban.push_back(mask);
+
+ CUList empty;
+ std::string expiry = "*** Timed ban on " + chan + " expired.";
+ cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :%s", cr->name.c_str(), expiry.c_str());
+ ServerInstance->PI->SendChannelNotice(cr, '@', expiry);
+ if (ServerInstance->Config->AllowHalfop)