X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/8bced6dc398efeff57b077a44d9a90b6acf9a407..157c1f04bd3b04cbdcef5efb3cb280d0e10f1e7f:/src/client.c diff --git a/src/client.c b/src/client.c index 89977fa..534bec2 100644 --- a/src/client.c +++ b/src/client.c @@ -424,10 +424,10 @@ notify_banned_client(struct Client *client_p, struct ConfItem *aconf, int ban) const char *reason = NULL; const char *exit_reason = conn_closed; - if(ConfigFileEntry.kline_with_reason && !EmptyString(aconf->passwd)) + if(ConfigFileEntry.kline_with_reason) { - reason = aconf->passwd; - exit_reason = aconf->passwd; + reason = get_user_ban_reason(aconf); + exit_reason = reason; } else { @@ -1146,6 +1146,9 @@ exit_generic_client(struct Client *client_p, struct Client *source_p, struct Cli if(IsOper(source_p)) rb_dlinkFindDestroy(source_p, &oper_list); + /* get rid of any metadata the user may have */ + user_metadata_clear(source_p); + sendto_common_channels_local(source_p, ":%s!%s@%s QUIT :%s", source_p->name, source_p->username, source_p->host, comment); @@ -1709,9 +1712,6 @@ free_user(struct User *user, struct Client *client_p) { free_away(client_p); - /* get rid of any metadata the user may have */ - user_metadata_clear(client_p); - if(--user->refcnt <= 0) { if(user->away) @@ -1949,9 +1949,6 @@ user_metadata_add(struct Client *target, const char *name, const char *value, in { struct Metadata *md; - if(irc_dictionary_find(target->user->metadata, name) != NULL) - return NULL; - md = rb_malloc(sizeof(struct Metadata)); md->name = rb_strdup(name); md->value = rb_strdup(value); @@ -1960,7 +1957,7 @@ user_metadata_add(struct Client *target, const char *name, const char *value, in if(propegate) sendto_match_servs(&me, "*", CAP_ENCAP, NOCAPS, "ENCAP * METADATA ADD %s %s :%s", - target->name, name, value); + target->id, name, value); return md; } @@ -1988,7 +1985,7 @@ user_metadata_delete(struct Client *target, const char *name, int propegate) if(propegate) sendto_match_servs(&me, "*", CAP_ENCAP, NOCAPS, "ENCAP * METADATA DELETE %s %s", - target->name, name); + target->id, name); } /*