summaryrefslogtreecommitdiff
path: root/src/modes.cpp
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-17 15:45:19 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-17 15:45:19 +0000
commit00494c9020bfddcfde6707eab03803570c9f7dbd (patch)
tree9ea923ad11d6b1095234549263fd29a70941cff7 /src/modes.cpp
parentbbea1b56798d8dc0e91fa1c0bf04f9bd3690bf60 (diff)
dos2unix on files.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2568 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modes.cpp')
-rw-r--r--src/modes.cpp250
1 files changed, 125 insertions, 125 deletions
diff --git a/src/modes.cpp b/src/modes.cpp
index 948eee97f..bc595fdad 100644
--- a/src/modes.cpp
+++ b/src/modes.cpp
@@ -191,43 +191,43 @@ bool ChannelModeRegistered::CanSet(User *u)
* @param mask The ban
*/
void ChannelModeBan::AddMask(Channel *chan, const char *mask)
-{
- Entry *ban;
-
- /* check for NULL values otherwise we will segfault */
- if (!chan || !mask)
- {
- if (debug)
- alog("debug: add_ban called with NULL values");
- return;
- }
-
- /* Check if the list already exists, if not create it.
- * Create a new ban and add it to the list.. ~ Viper */
- if (!chan->bans)
- chan->bans = list_create();
- ban = entry_add(chan->bans, mask);
-
- if (!ban)
- fatal("Creating new ban entry failed");
-
- /* Check whether it matches a botserv bot after adding internally
- * and parsing it through cidr support. ~ Viper */
- if (s_BotServ && BSSmartJoin && chan->ci && chan->ci->bi
- && chan->usercount >= BSMinUsers)
- {
- BotInfo *bi = chan->ci->bi;
-
- if (entry_match(ban, bi->nick, bi->user, bi->host, 0))
- {
- ircdproto->SendMode(bi, chan->name, "-b %s", mask);
- entry_delete(chan->bans, ban);
- return;
- }
- }
-
- if (debug)
- alog("debug: Added ban %s to channel %s", mask, chan->name);
+{
+ Entry *ban;
+
+ /* check for NULL values otherwise we will segfault */
+ if (!chan || !mask)
+ {
+ if (debug)
+ alog("debug: add_ban called with NULL values");
+ return;
+ }
+
+ /* Check if the list already exists, if not create it.
+ * Create a new ban and add it to the list.. ~ Viper */
+ if (!chan->bans)
+ chan->bans = list_create();
+ ban = entry_add(chan->bans, mask);
+
+ if (!ban)
+ fatal("Creating new ban entry failed");
+
+ /* Check whether it matches a botserv bot after adding internally
+ * and parsing it through cidr support. ~ Viper */
+ if (s_BotServ && BSSmartJoin && chan->ci && chan->ci->bi
+ && chan->usercount >= BSMinUsers)
+ {
+ BotInfo *bi = chan->ci->bi;
+
+ if (entry_match(ban, bi->nick, bi->user, bi->host, 0))
+ {
+ ircdproto->SendMode(bi, chan->name, "-b %s", mask);
+ entry_delete(chan->bans, ban);
+ return;
+ }
+ }
+
+ if (debug)
+ alog("debug: Added ban %s to channel %s", mask, chan->name);
}
/** Remove a ban from the channel
@@ -236,26 +236,26 @@ void ChannelModeBan::AddMask(Channel *chan, const char *mask)
*/
void ChannelModeBan::DelMask(Channel *chan, const char *mask)
{
- AutoKick *akick;
- Entry *ban;
-
- /* Sanity check as it seems some IRCD will just send -b without a mask */
- if (!mask || !chan->bans || (chan->bans->count == 0))
- return;
-
- ban = elist_find_mask(chan->bans, mask);
-
- if (ban)
- {
- entry_delete(chan->bans, ban);
-
- if (debug)
- alog("debug: Deleted ban %s from channel %s", mask,
- chan->name);
- }
-
- if (chan->ci && (akick = is_stuck(chan->ci, mask)))
- stick_mask(chan->ci, akick);
+ AutoKick *akick;
+ Entry *ban;
+
+ /* Sanity check as it seems some IRCD will just send -b without a mask */
+ if (!mask || !chan->bans || (chan->bans->count == 0))
+ return;
+
+ ban = elist_find_mask(chan->bans, mask);
+
+ if (ban)
+ {
+ entry_delete(chan->bans, ban);
+
+ if (debug)
+ alog("debug: Deleted ban %s from channel %s", mask,
+ chan->name);
+ }
+
+ if (chan->ci && (akick = is_stuck(chan->ci, mask)))
+ stick_mask(chan->ci, akick);
}
@@ -265,25 +265,25 @@ void ChannelModeBan::DelMask(Channel *chan, const char *mask)
*/
void ChannelModeExcept::AddMask(Channel *chan, const char *mask)
{
- Entry *exception;
-
- if (!chan || !mask)
- {
- if (debug)
- alog("debug: add_exception called with NULL values");
- return;
- }
-
- /* Check if the list already exists, if not create it.
- * Create a new exception and add it to the list.. ~ Viper */
- if (!chan->excepts)
- chan->excepts = list_create();
- exception = entry_add(chan->excepts, mask);
-
- if (!exception)
- fatal("Creating new exception entry failed");
-
- if (debug)
+ Entry *exception;
+
+ if (!chan || !mask)
+ {
+ if (debug)
+ alog("debug: add_exception called with NULL values");
+ return;
+ }
+
+ /* Check if the list already exists, if not create it.
+ * Create a new exception and add it to the list.. ~ Viper */
+ if (!chan->excepts)
+ chan->excepts = list_create();
+ exception = entry_add(chan->excepts, mask);
+
+ if (!exception)
+ fatal("Creating new exception entry failed");
+
+ if (debug)
alog("debug: Added except %s to channel %s", mask, chan->name);
}
@@ -293,20 +293,20 @@ void ChannelModeExcept::AddMask(Channel *chan, const char *mask)
*/
void ChannelModeExcept::DelMask(Channel *chan, const char *mask)
{
- Entry *exception;
-
- /* Sanity check as it seems some IRCD will just send -e without a mask */
- if (!mask || !chan->excepts || (chan->excepts->count == 0))
- return;
-
- exception = elist_find_mask(chan->excepts, mask);
-
- if (exception)
- {
- entry_delete(chan->excepts, exception);
-
- if (debug)
- alog("debug: Deleted except %s to channel %s", mask, chan->name);
+ Entry *exception;
+
+ /* Sanity check as it seems some IRCD will just send -e without a mask */
+ if (!mask || !chan->excepts || (chan->excepts->count == 0))
+ return;
+
+ exception = elist_find_mask(chan->excepts, mask);
+
+ if (exception)
+ {
+ entry_delete(chan->excepts, exception);
+
+ if (debug)
+ alog("debug: Deleted except %s to channel %s", mask, chan->name);
}
}
@@ -316,26 +316,26 @@ void ChannelModeExcept::DelMask(Channel *chan, const char *mask)
*/
void ChannelModeInvite::AddMask(Channel *chan, const char *mask)
{
- Entry *invite;
-
- if (!chan || !mask)
- {
- if (debug)
- alog("debug: add_invite called with NULL values");
- return;
- }
-
- /* Check if the list already exists, if not create it.
- * Create a new invite and add it to the list.. ~ Viper */
- if (!chan->invites)
- chan->invites = list_create();
- invite = entry_add(chan->invites, mask);
-
- if (!invite)
- fatal("Creating new exception entry failed");
-
- if (debug)
- alog("debug: Added invite %s to channel %s", mask, chan->name);
+ Entry *invite;
+
+ if (!chan || !mask)
+ {
+ if (debug)
+ alog("debug: add_invite called with NULL values");
+ return;
+ }
+
+ /* Check if the list already exists, if not create it.
+ * Create a new invite and add it to the list.. ~ Viper */
+ if (!chan->invites)
+ chan->invites = list_create();
+ invite = entry_add(chan->invites, mask);
+
+ if (!invite)
+ fatal("Creating new exception entry failed");
+
+ if (debug)
+ alog("debug: Added invite %s to channel %s", mask, chan->name);
}
@@ -345,20 +345,20 @@ void ChannelModeInvite::AddMask(Channel *chan, const char *mask)
*/
void ChannelModeInvite::DelMask(Channel *chan, const char *mask)
{
- Entry *invite;
-
- /* Sanity check as it seems some IRCD will just send -I without a mask */
- if (!mask || !chan->invites || (chan->invites->count == 0))
- return;
-
- invite = elist_find_mask(chan->invites, mask);
-
- if (invite)
- {
- entry_delete(chan->invites, invite);
-
- if (debug)
- alog("debug: Deleted invite %s to channel %s", mask,
- chan->name);
+ Entry *invite;
+
+ /* Sanity check as it seems some IRCD will just send -I without a mask */
+ if (!mask || !chan->invites || (chan->invites->count == 0))
+ return;
+
+ invite = elist_find_mask(chan->invites, mask);
+
+ if (invite)
+ {
+ entry_delete(chan->invites, invite);
+
+ if (debug)
+ alog("debug: Deleted invite %s to channel %s", mask,
+ chan->name);
}
}