X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Flistmode.cpp;h=2e6703df38bc62394fbc033b4e78f91c91fde59d;hb=a5ca8b892c384d5926bf03353ef878023f0f573d;hp=4ab15b2dc03290ce7f34af0f57fc6f0cf8c596b3;hpb=52e4d9c96c83ca4bbbeb487966ac2897a384907d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/listmode.cpp b/src/listmode.cpp index 4ab15b2dc..2e6703df3 100644 --- a/src/listmode.cpp +++ b/src/listmode.cpp @@ -34,15 +34,15 @@ void ListModeBase::DisplayList(User* user, Channel* channel) { for (ModeList::reverse_iterator it = cd->list.rbegin(); it != cd->list.rend(); ++it) { - user->WriteNumeric(listnumeric, "%s %s %s %s %lu", user->nick.c_str(), channel->name.c_str(), it->mask.c_str(), (!it->setter.empty() ? it->setter.c_str() : ServerInstance->Config->ServerName.c_str()), (unsigned long) it->time); + user->WriteNumeric(listnumeric, "%s %s %s %lu", channel->name.c_str(), it->mask.c_str(), (!it->setter.empty() ? it->setter.c_str() : ServerInstance->Config->ServerName.c_str()), (unsigned long) it->time); } } - user->WriteNumeric(endoflistnumeric, "%s %s :%s", user->nick.c_str(), channel->name.c_str(), endofliststring.c_str()); + user->WriteNumeric(endoflistnumeric, "%s :%s", channel->name.c_str(), endofliststring.c_str()); } void ListModeBase::DisplayEmptyList(User* user, Channel* channel) { - user->WriteNumeric(endoflistnumeric, "%s %s :%s", user->nick.c_str(), channel->name.c_str(), endofliststring.c_str()); + user->WriteNumeric(endoflistnumeric, "%s :%s", channel->name.c_str(), endofliststring.c_str()); } void ListModeBase::RemoveMode(Channel* channel, irc::modestacker& stack) @@ -156,7 +156,6 @@ ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, std { /* List is full, give subclass a chance to send a custom message */ TellListTooLong(source, channel, parameter); - parameter.clear(); return MODEACTION_DENY; } @@ -199,33 +198,10 @@ ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, std /* Tried to remove something that wasn't set */ TellNotSet(source, channel, parameter); - parameter.clear(); return MODEACTION_DENY; } } -void ListModeBase::DoSyncChannel(Channel* chan, Module* proto, void* opaque) -{ - ChanData* cd = extItem.get(chan); - if (!cd) - return; - - irc::modestacker modestack(true); - std::vector stackresult; - std::vector types; - types.push_back(TR_TEXT); - - for (ModeList::iterator it = cd->list.begin(); it != cd->list.end(); it++) - modestack.Push(mode, it->mask); - - while (modestack.GetStackedLine(stackresult)) - { - types.assign(stackresult.size(), this->GetTranslateType()); - proto->ProtoSendMode(opaque, TYPE_CHANNEL, chan, stackresult, types); - stackresult.clear(); - } -} - bool ListModeBase::ValidateParam(User*, Channel*, std::string&) { return true; @@ -233,7 +209,7 @@ bool ListModeBase::ValidateParam(User*, Channel*, std::string&) void ListModeBase::TellListTooLong(User* source, Channel* channel, std::string& parameter) { - source->WriteNumeric(478, "%s %s %s :Channel ban list is full", source->nick.c_str(), channel->name.c_str(), parameter.c_str()); + source->WriteNumeric(ERR_BANLISTFULL, "%s %s :Channel ban list is full", channel->name.c_str(), parameter.c_str()); } void ListModeBase::TellAlreadyOnList(User*, Channel*, std::string&)