summaryrefslogtreecommitdiff
path: root/src/kike.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-08-09 01:36:21 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-08-09 01:36:21 +0200
commit4b3af280fa8b09415fd148a959e328662e276890 (patch)
treec7c24287eebd8ad9648d3271e94a5fa12d38d157 /src/kike.c
parenta7ba1eb15fbb902347f453070e2b76984c76cd0d (diff)
downloadxK-4b3af280fa8b09415fd148a959e328662e276890.tar.gz
xK-4b3af280fa8b09415fd148a959e328662e276890.tar.xz
xK-4b3af280fa8b09415fd148a959e328662e276890.zip
kike: channel user limit is also secret
Diffstat (limited to 'src/kike.c')
-rw-r--r--src/kike.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/kike.c b/src/kike.c
index 5a250b2..2b429d3 100644
--- a/src/kike.c
+++ b/src/kike.c
@@ -414,12 +414,14 @@ channel_get_mode (struct channel *self, bool disclose_secrets)
if (self->user_limit != -1) str_append_c (&mode, 'l');
if (self->key) str_append_c (&mode, 'k');
- if (self->user_limit != -1)
- str_append_printf (&mode, " %ld", self->user_limit);
-
- // XXX: is this correct? Try it on an existing implementation.
- if (self->key && disclose_secrets)
- str_append_printf (&mode, " %s", self->key);
+ // XXX: is it correct to split it? Try it on an existing implementation.
+ if (disclose_secrets)
+ {
+ if (self->user_limit != -1)
+ str_append_printf (&mode, " %ld", self->user_limit);
+ if (self->key)
+ str_append_printf (&mode, " %s", self->key);
+ }
return str_steal (&mode);
}