1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 18:36:38 +02:00

Added 4 new events for (un)setting modes on channels and users

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2583 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Adam-
2009-10-25 04:12:21 +00:00
parent 8330009373
commit 338cb38ee8
3 changed files with 29 additions and 0 deletions
+25
View File
@@ -923,6 +923,30 @@ class CoreExport Module
*/
virtual void OnInsertHostCore(HostCore *hc) { }
/** Called when a mode is set on a channel
* @param c The channel
* @param Name The mode name
*/
virtual void OnChannelModeSet(Channel *c, ChannelModeName Name) { }
/** Called when a mode is unset on a channel
* @param c The channel
* @param Name The mode name
*/
virtual void OnChannelModeUnset(Channel *c, ChannelModeName Name) { }
/** Called when a mode is set on a user
* @param u The user
* @param Name The mode name
*/
virtual void OnUserModeSet(User *u, UserModeName Name) { }
/** Called when a mode is unset from a user
* @param u The user
* @param Name The mode name
*/
virtual void OnUserModeUnset(User *u, UserModeName Name) { }
};
@@ -960,6 +984,7 @@ enum Implementation
I_OnPreDatabaseExpire, I_OnDatabaseExpire, I_OnPreRestart, I_OnRestart, I_OnPreShutdown, I_OnShutdown, I_OnSignal,
I_OnServerQuit, I_OnTopicUpdated,
I_OnEncrypt, I_OnEncryptInPlace, I_OnEncryptCheckLen, I_OnDecrypt, I_OnCheckPassword,
I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset,
I_END
};
+2
View File
@@ -39,6 +39,7 @@ bool Channel::HasMode(ChannelModeName Name)
void Channel::SetMode(ChannelModeName Name)
{
modes[(size_t)Name] = true;
FOREACH_MOD(I_OnChannelModeSet, OnChannelModeSet(this, Name));
}
/**
@@ -62,6 +63,7 @@ void Channel::SetMode(char Mode)
void Channel::RemoveMode(ChannelModeName Name)
{
modes[(size_t)Name] = false;
FOREACH_MOD(I_OnChannelModeUnset, OnChannelModeUnset(this, Name));
}
/**
+2
View File
@@ -490,6 +490,7 @@ const bool User::HasMode(UserModeName Name) const
void User::SetMode(UserModeName Name)
{
modes[(size_t)Name] = true;
FOREACH_MOD(I_OnUserModeSet, OnUserModeSet(this, Name));
}
/* Set a mode on the user
@@ -511,6 +512,7 @@ void User::SetMode(char ModeChar)
void User::RemoveMode(UserModeName Name)
{
modes[(size_t)Name] = false;
FOREACH_MOD(I_OnUserModeUnset, OnUserModeUnset(this, Name));
}
/** Remove a mode from the user