git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8951
e03df62e-2008-0410-955e-
edbf42e46eb7
* type of line this is.
*/
const std::string type;
+
+ virtual bool IsBurstable();
};
/** KLine class
virtual const char* Displayable();
+ virtual bool IsBurstable();
+
/** Ident mask (ident part only)
*/
char* identmask;
{
for (LookupIter i = lookup->begin(); i != lookup->end(); ++i)
{
- if (i->second->type == "K")
- continue;
+ /* Is it burstable? this is better than an explicit check for type 'K'.
+ * We break the loop as NONE of the items in this group are worth iterating.
+ */
+ if (!i->second->IsBurstable())
+ break;
snprintf(data,MAXBUF,":%s ADDLINE %s %s %s %lu %lu :%s\r\n",sn, it->c_str(), i->second->Displayable(),
i->second->source,
{
}
+bool XLine::IsBurstable()
+{
+ return true;
+}
+
void XLine::DefaultApply(User* u, const std::string &line, bool bancache)
{
char sreason[MAXBUF];
return nick;
}
+bool KLine::IsBurstable()
+{
+ return false;
+}
+
bool XLineManager::RegisterFactory(XLineFactory* xlf)
{
XLineFactMap::iterator n = line_factory.find(xlf->GetType());