]> jfr.im git - solanum.git/commitdiff
Show d/kline setter to opers in stats/testline.
authorJilles Tjoelker <redacted>
Sat, 6 Mar 2010 21:37:42 +0000 (22:37 +0100)
committerJilles Tjoelker <redacted>
Sat, 6 Mar 2010 21:37:42 +0000 (22:37 +0100)
src/s_conf.c

index 0e9dfa905f7bd18671e7205c57b3bd97b215f87f..946380dbb3c8498f8e993596910c091e11901d6f 100644 (file)
@@ -1253,15 +1253,22 @@ get_printable_kline(struct Client *source_p, struct ConfItem *aconf,
                    char **user, char **oper_reason)
 {
        static char null[] = "<NULL>";
+       static char operreasonbuf[BUFSIZE];
 
        *host = EmptyString(aconf->host) ? null : aconf->host;
        *user = EmptyString(aconf->user) ? null : aconf->user;
        *reason = get_user_ban_reason(aconf);
 
-       if(EmptyString(aconf->spasswd) || !IsOper(source_p))
+       if(!IsOper(source_p))
                *oper_reason = NULL;
        else
-               *oper_reason = aconf->spasswd;
+       {
+               rb_snprintf(operreasonbuf, sizeof operreasonbuf, "%s%s(%s)",
+                               EmptyString(aconf->spasswd) ? "" : aconf->spasswd,
+                               EmptyString(aconf->spasswd) ? "" : " ",
+                               aconf->info.oper);
+               *oper_reason = operreasonbuf;
+       }
 }
 
 /*