When removing a temp kline, show removed mask, not given mask.

Example: when temp klining 10.0.0.0/16 and unklining 10.0.0.1/16,
it showed 10.0.0.1/16 being removed before, and shows
10.0.0.0/16 now.
This commit is contained in:
Jilles Tjoelker 2007-12-26 00:18:22 +01:00
parent a58cdfa3f4
commit d922ddedfd

View file

@ -86,7 +86,7 @@ static void handle_remote_unkline(struct Client *source_p,
const char *user, const char *host); const char *user, const char *host);
static void remove_permkline_match(struct Client *, struct ConfItem *); static void remove_permkline_match(struct Client *, struct ConfItem *);
static int flush_write(struct Client *, FILE *, const char *, const char *); static int flush_write(struct Client *, FILE *, const char *, const char *);
static int remove_temp_kline(struct ConfItem *); static int remove_temp_kline(struct Client *, struct ConfItem *);
/* mo_kline() /* mo_kline()
* *
@ -420,16 +420,8 @@ mo_unkline(struct Client *client_p, struct Client *source_p, int parc, const cha
return 0; return 0;
} }
if(remove_temp_kline(aconf)) if(remove_temp_kline(source_p, aconf))
{
sendto_one_notice(source_p, ":Un-klined [%s@%s] from temporary k-lines", user, host);
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s has removed the temporary K-Line for: [%s@%s]",
get_oper_name(source_p), user, host);
ilog(L_KLINE, "UK %s %s %s",
get_oper_name(source_p), user, host);
return 0; return 0;
}
remove_permkline_match(source_p, aconf); remove_permkline_match(source_p, aconf);
@ -487,20 +479,8 @@ handle_remote_unkline(struct Client *source_p, const char *user, const char *hos
return; return;
} }
if(remove_temp_kline(aconf)) if(remove_temp_kline(source_p, aconf))
{
sendto_one_notice(source_p,
":Un-klined [%s@%s] from temporary k-lines",
user, host);
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s has removed the temporary K-Line for: [%s@%s]",
get_oper_name(source_p), user, host);
ilog(L_KLINE, "UK %s %s %s",
get_oper_name(source_p), user, host);
return; return;
}
remove_permkline_match(source_p, aconf); remove_permkline_match(source_p, aconf);
} }
@ -915,7 +895,7 @@ flush_write(struct Client *source_p, FILE * out, const char *buf, const char *te
* side effects - tries to unkline anything that matches * side effects - tries to unkline anything that matches
*/ */
static int static int
remove_temp_kline(struct ConfItem *aconf) remove_temp_kline(struct Client *source_p, struct ConfItem *aconf)
{ {
dlink_node *ptr; dlink_node *ptr;
int i; int i;
@ -926,6 +906,16 @@ remove_temp_kline(struct ConfItem *aconf)
{ {
if (aconf == ptr->data) if (aconf == ptr->data)
{ {
sendto_one_notice(source_p,
":Un-klined [%s@%s] from temporary k-lines",
aconf->user, aconf->host);
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s has removed the temporary K-Line for: [%s@%s]",
get_oper_name(source_p), aconf->user, aconf->host);
ilog(L_KLINE, "UK %s %s %s",
get_oper_name(source_p),
aconf->user, aconf->host);
dlinkDestroy(ptr, &temp_klines[i]); dlinkDestroy(ptr, &temp_klines[i]);
remove_reject_mask(aconf->user, aconf->host); remove_reject_mask(aconf->user, aconf->host);
delete_one_address_conf(aconf->host, aconf); delete_one_address_conf(aconf->host, aconf);