1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 09:03:14 +02:00

Check virtual mode bases better

This commit is contained in:
Adam
2015-01-26 15:10:18 -05:00
parent d324e91520
commit 2264a206d2
2 changed files with 12 additions and 1 deletions
+4
View File
@@ -107,6 +107,8 @@ class CoreExport ChannelMode : public Mode
bool CanSet(User *u) const anope_override;
virtual void Check() { }
/** 'wrap' this channel mode and param to the underlying mode and param
*/
virtual ChannelMode *Wrap(Anope::string &param);
@@ -215,6 +217,8 @@ class CoreExport ChannelModeVirtual : public T
~ChannelModeVirtual();
void Check() anope_override;
ChannelMode *Wrap(Anope::string &param) anope_override;
ChannelMode *Unwrap(ChannelMode *cm, Anope::string &param) = 0;
+8 -1
View File
@@ -213,7 +213,7 @@ ChannelModeVirtual<T>::~ChannelModeVirtual()
}
template<typename T>
ChannelMode *ChannelModeVirtual<T>::Wrap(Anope::string &param)
void ChannelModeVirtual<T>::Check()
{
if (basech == NULL)
{
@@ -221,7 +221,11 @@ ChannelMode *ChannelModeVirtual<T>::Wrap(Anope::string &param)
if (basech)
basech->listeners.push_back(this);
}
}
template<typename T>
ChannelMode *ChannelModeVirtual<T>::Wrap(Anope::string &param)
{
return basech;
}
@@ -453,6 +457,9 @@ bool ModeManager::AddChannelMode(ChannelMode *cm)
FOREACH_MOD(OnChannelModeAdd, (cm));
for (unsigned int i = 0; i < ChannelModes.size(); ++i)
ChannelModes[i]->Check();
return true;
}