mirror of
https://github.com/anope/anope.git
synced 2026-06-30 04:56:38 +02:00
Removed set_mod_current_buffer() function from old IRCDProto struct, was never used.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1287 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -1066,7 +1066,6 @@ struct session_ {
|
||||
* functions, we then call the correct function for the anope_ commands.
|
||||
**/
|
||||
typedef struct ircd_proto_ {
|
||||
void (*ircd_set_mod_current_buffer)(int ac, char **av);
|
||||
void (*ircd_cmd_372)(const char *source, const char *msg);
|
||||
void (*ircd_cmd_372_error)(const char *source);
|
||||
void (*ircd_cmd_375)(const char *source);
|
||||
|
||||
+1
-14
@@ -44,8 +44,6 @@ void pmodule_ircd_proto(IRCDProtoNew *proto)
|
||||
**/
|
||||
void initIrcdProto()
|
||||
{
|
||||
ircdproto.ircd_set_mod_current_buffer = NULL;
|
||||
ircdproto.ircd_set_umode = NULL;
|
||||
ircdproto.ircd_cmd_372 = NULL;
|
||||
ircdproto.ircd_cmd_372_error = NULL;
|
||||
ircdproto.ircd_cmd_375 = NULL;
|
||||
@@ -68,18 +66,7 @@ void initIrcdProto()
|
||||
ircdproto.ircd_valid_chan = NULL;
|
||||
}
|
||||
|
||||
/* Special function, returns 1 if executed, 0 if not */
|
||||
int anope_set_mod_current_buffer(int ac, char **av)
|
||||
{
|
||||
if (ircdproto.ircd_set_mod_current_buffer) {
|
||||
ircdproto.ircd_set_mod_current_buffer(ac, av);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void anope_set_umode(User * user, int ac, const char **av)
|
||||
void anope_set_umode(User *user, int ac, const char **av)
|
||||
{
|
||||
ircdproto.ircd_set_umode(user, ac, av);
|
||||
}
|
||||
|
||||
+86
-62
@@ -27,9 +27,9 @@ IgnoreData *ignore;
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Add a mask/nick to the ignorelits for delta seconds.
|
||||
* @param nick Nick or (nick!)user@host to add to the ignorelist.
|
||||
* @param delta Seconds untill new entry is set to expire. 0 for permanent.
|
||||
* Add a mask/nick to the ignorelits for delta seconds.
|
||||
* @param nick Nick or (nick!)user@host to add to the ignorelist.
|
||||
* @param delta Seconds untill new entry is set to expire. 0 for permanent.
|
||||
*/
|
||||
void add_ignore(const char *nick, time_t delta)
|
||||
{
|
||||
@@ -38,35 +38,38 @@ void add_ignore(const char *nick, time_t delta)
|
||||
char *mask, *user, *host;
|
||||
User *u;
|
||||
time_t now;
|
||||
|
||||
|
||||
if (!nick)
|
||||
return;
|
||||
now = time(NULL);
|
||||
now = time(NULL);
|
||||
|
||||
|
||||
|
||||
/* If it s an existing user, we ignore the hostmask. */
|
||||
if ((u = finduser(nick))) {
|
||||
snprintf(tmp, sizeof(tmp), "*!*@%s", u->host);
|
||||
mask = sstrdup(tmp);
|
||||
snprintf(tmp, sizeof(tmp), "*!*@%s", u->host);
|
||||
mask = sstrdup(tmp);
|
||||
|
||||
/* Determine whether we get a nick or a mask. */
|
||||
} else if ((host = strchr(nick, '@'))) {
|
||||
/* Determine whether we get a nick or a mask. */
|
||||
/* Check whether we have a nick too.. */
|
||||
if ((user = strchr(nick, '!'))) {
|
||||
/* Check whether we have a nick too.. */
|
||||
/* this should never happen */
|
||||
if (user > host)
|
||||
return;
|
||||
mask = sstrdup(nick);
|
||||
} else {
|
||||
mask = sstrdup(nick);
|
||||
/* We have user@host. Add nick wildcard. */
|
||||
snprintf(tmp, sizeof(tmp), "*!%s", nick);
|
||||
mask = sstrdup(tmp);
|
||||
}
|
||||
mask = sstrdup(tmp);
|
||||
}
|
||||
|
||||
/* We only got a nick.. */
|
||||
} else {
|
||||
/* We only got a nick.. */
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
|
||||
mask = sstrdup(tmp);
|
||||
}
|
||||
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
|
||||
|
||||
/* Check if we already got an identical entry. */
|
||||
for (ign = ignore; ign; ign = ign->next)
|
||||
if (stricmp(ign->mask, mask) == 0)
|
||||
@@ -99,7 +102,7 @@ void add_ignore(const char *nick, time_t delta)
|
||||
* Retrieve an ignorance record for a nick or mask.
|
||||
* If the nick isn't being ignored, we return NULL and if necesary
|
||||
* flush the record from the ignore list (i.e. ignore timed out).
|
||||
* Retrieve an ignorance record for a nick or mask.
|
||||
* @param nick Nick or (nick!)user@host to look for on the ignorelist.
|
||||
* @return Pointer to the ignore record, NULL if none was found.
|
||||
*/
|
||||
IgnoreData *get_ignore(const char *nick)
|
||||
@@ -109,15 +112,20 @@ IgnoreData *get_ignore(const char *nick)
|
||||
char *user, *host;
|
||||
time_t now;
|
||||
User *u;
|
||||
char *user, *host;
|
||||
|
||||
if (!nick)
|
||||
return NULL;
|
||||
User *u;
|
||||
|
||||
|
||||
/* User has disabled the IGNORE system */
|
||||
if (!allow_ignore)
|
||||
return NULL;
|
||||
|
||||
|
||||
/* User has disabled the IGNORE system */
|
||||
|
||||
now = time(NULL);
|
||||
|
||||
u = finduser(nick);
|
||||
|
||||
|
||||
/* If we find a real user, match his mask against the ignorelist. */
|
||||
if (u) {
|
||||
/* Opers are not ignored, even if a matching entry may be present. */
|
||||
@@ -126,8 +134,9 @@ IgnoreData *get_ignore(const char *nick)
|
||||
for (ign = ignore; ign; ign = ign->next)
|
||||
if (match_usermask(ign->mask, u))
|
||||
break;
|
||||
/* If we find a real user, match his mask against the ignorelist. */
|
||||
if (u) {
|
||||
|
||||
} else {
|
||||
/* We didn't get a user.. generate a valid mask. */
|
||||
if ((host = strchr(nick, '@'))) {
|
||||
if ((user = strchr(nick, '!'))) {
|
||||
/* this should never happen */
|
||||
@@ -135,19 +144,21 @@ IgnoreData *get_ignore(const char *nick)
|
||||
return NULL;
|
||||
snprintf(tmp, sizeof(tmp), "%s", nick);
|
||||
} else {
|
||||
} else {
|
||||
/* We have user@host. Add nick wildcard. */
|
||||
snprintf(tmp, sizeof(tmp), "*!%s", nick);
|
||||
}
|
||||
if ((user = strchr(nick, '!'))) {
|
||||
/* this should never happen */
|
||||
|
||||
/* We only got a nick.. */
|
||||
} else
|
||||
return NULL;
|
||||
snprintf(tmp, sizeof(tmp), "%s", nick);
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
|
||||
|
||||
for (ign = ignore; ign; ign = ign->next)
|
||||
if (match_wild_nocase(ign->mask, tmp))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Check whether the entry has timed out */
|
||||
if (ign && ign->time != 0 && ign->time <= now) {
|
||||
if (debug)
|
||||
alog("debug: Expiring ignore entry %s", ign->mask);
|
||||
@@ -161,7 +172,8 @@ IgnoreData *get_ignore(const char *nick)
|
||||
free(ign);
|
||||
ign = NULL;
|
||||
}
|
||||
alog("debug: Expiring ignore entry %s", ign->mask);
|
||||
|
||||
if (ign && debug)
|
||||
alog("debug: Found ignore entry (%s) for %s", ign->mask, nick);
|
||||
return ign;
|
||||
}
|
||||
@@ -180,67 +192,77 @@ int delete_ignore(const char *nick)
|
||||
char tmp[BUFSIZE];
|
||||
char *user, *host;
|
||||
User *u;
|
||||
|
||||
|
||||
if (!nick)
|
||||
return 0;
|
||||
* Deletes a given nick/mask from the ignorelist.
|
||||
* @param nick Nick or (nick!)user@host to delete from the ignorelist.
|
||||
|
||||
/* If it s an existing user, we ignore the hostmask. */
|
||||
if ((u = finduser(nick))) {
|
||||
snprintf(tmp, sizeof(tmp), "*!*@%s", u->host);
|
||||
int delete_ignore(const char *nick)
|
||||
{
|
||||
|
||||
/* Determine whether we get a nick or a mask. */
|
||||
} else if ((host = strchr(nick, '@'))) {
|
||||
char tmp[BUFSIZE];
|
||||
/* Check whether we have a nick too.. */
|
||||
if ((user = strchr(nick, '!'))) {
|
||||
User *u;
|
||||
/* this should never happen */
|
||||
if (user > host)
|
||||
return 0;
|
||||
snprintf(tmp, sizeof(tmp), "%s", nick);
|
||||
} else {
|
||||
/* If it s an existing user, we ignore the hostmask. */
|
||||
/* We have user@host. Add nick wildcard. */
|
||||
snprintf(tmp, sizeof(tmp), "*!%s", nick);
|
||||
}
|
||||
|
||||
/* Determine whether we get a nick or a mask. */
|
||||
|
||||
/* We only got a nick.. */
|
||||
} else
|
||||
/* Check whether we have a nick too.. */
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
|
||||
|
||||
for (ign = ignore; ign; ign = ign->next)
|
||||
if (stricmp(ign->mask, tmp) == 0)
|
||||
break;
|
||||
snprintf(tmp, sizeof(tmp), "%s", nick);
|
||||
} else {
|
||||
|
||||
/* No matching ignore found. */
|
||||
if (!ign)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
alog("Deleting ignore entry %s", ign->mask);
|
||||
/* We only got a nick.. */
|
||||
} else
|
||||
|
||||
/* Delete the entry and all references to it. */
|
||||
if (ign->prev)
|
||||
ign->prev->next = ign->next;
|
||||
else if (ignore == ign)
|
||||
ignore = ign->next;
|
||||
if (ign->next)
|
||||
ign->next->prev = ign->prev;
|
||||
|
||||
|
||||
|
||||
free(ign->mask);
|
||||
free(ign);
|
||||
ign = NULL;
|
||||
return 0;
|
||||
|
||||
|
||||
return 1;
|
||||
|
||||
alog("Deleting ignore entry %s", ign->mask);
|
||||
|
||||
/* Delete the entry and all references to it. */
|
||||
if (ign->prev)
|
||||
ign->prev->next = ign->next;
|
||||
else if (ignore == ign)
|
||||
ignore = ign->next;
|
||||
if (ign->next)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Clear the ignorelist.
|
||||
* @return The number of entries deleted.
|
||||
*/
|
||||
int clear_ignores()
|
||||
{
|
||||
IgnoreData *ign, *next;
|
||||
int i = 0;
|
||||
free(ign->mask);
|
||||
|
||||
if (!ignore)
|
||||
return 0;
|
||||
ign = NULL;
|
||||
|
||||
for (ign = ignore; ign; ign = next) {
|
||||
next = ign->next;
|
||||
if (debug)
|
||||
alog("Deleting ignore entry %s", ign->mask);
|
||||
@@ -248,9 +270,11 @@ int clear_ignores()
|
||||
free(ign);
|
||||
i++;
|
||||
}
|
||||
/*************************************************************************/
|
||||
|
||||
ignore = NULL;
|
||||
return i;
|
||||
/**
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user