+ /** Display the list for this mode
+ * @param user The user to send the list to
+ * @param channel The channel the user is requesting the list for
+ */
+ virtual void DisplayList(User* user, Channel* channel)
+ {
+ modelist* el;
+ channel->GetExt(infokey, el);
+ if (el)
+ {
+ for (modelist::reverse_iterator it = el->rbegin(); it != el->rend(); ++it)
+ {
+ user->WriteNumeric(listnumeric, "%s %s %s %s %s", user->nick.c_str(), channel->name.c_str(), it->mask.c_str(), it->nick.c_str(), it->time.c_str());
+ }
+ }
+ user->WriteNumeric(endoflistnumeric, "%s %s :%s", user->nick.c_str(), channel->name.c_str(), endofliststring.c_str());
+ }
+
+ virtual void DisplayEmptyList(User* user, Channel* channel)
+ {
+ user->WriteNumeric(endoflistnumeric, "%s %s :%s", user->nick.c_str(), channel->name.c_str(), endofliststring.c_str());
+ }
+
+ /** Remove all instances of the mode from a channel.
+ * See mode.h
+ * @param channel The channel to remove all instances of the mode from
+ */
+ virtual void RemoveMode(Channel* channel, irc::modestacker* stack)
+ {
+ modelist* el;
+ channel->GetExt(infokey, el);
+ if (el)
+ {
+ irc::modestacker modestack(false);
+ std::deque<std::string> stackresult;
+ std::vector<std::string> mode_junk;
+ mode_junk.push_back(channel->name);
+
+ for (modelist::iterator it = el->begin(); it != el->end(); it++)
+ {
+ if (stack)
+ stack->Push(this->GetModeChar(), it->mask);
+ else
+ modestack.Push(this->GetModeChar(), it->mask);
+ }
+
+ if (stack)
+ return;
+
+ while (modestack.GetStackedLine(stackresult))
+ {
+ for (size_t j = 0; j < stackresult.size(); j++)
+ {
+ mode_junk.push_back(stackresult[j]);
+ }
+
+ ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);
+ }
+ }
+ }
+
+ /** See mode.h
+ */
+ virtual void RemoveMode(User*, irc::modestacker* stack)
+ {
+ /* Listmodes dont get set on users */
+ }
+
+ /** Perform a rehash of this mode's configuration data
+ */