diff options
author | TingPing <tingping@tingping.se> | 2013-10-25 09:27:59 -0400 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2013-10-25 09:28:09 -0400 |
commit | d1de138cb1ddba42b71d736176c9b2bd29de96f5 (patch) | |
tree | c387e9d04502cb2024965d438ca5be746dc0c0cb /src/fe-gtk | |
parent | cff05cef6855217b0d12115a34cd815eddd7cd90 (diff) |
Sensitize banlist buttons if half-op
For #647
Diffstat (limited to 'src/fe-gtk')
-rw-r--r-- | src/fe-gtk/banlist.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fe-gtk/banlist.c b/src/fe-gtk/banlist.c index be7873d5..33b6da68 100644 --- a/src/fe-gtk/banlist.c +++ b/src/fe-gtk/banlist.c @@ -237,9 +237,14 @@ static void banlist_sensitize (banlist_info *banl) { int checkable, i; + gboolean is_op = FALSE; + + /* FIXME: More access levels than these can unban */ + if (banl->sess->me->op || banl->sess->me->hop) + is_op = TRUE; /* CHECKBOXES -- */ - checkable = banl->sess->me->op? banl->writeable: banl->readable; + checkable = is_op? banl->writeable: banl->readable; for (i = 0; i < MODE_CT; i++) { if (banl->checkboxes[i] == NULL) @@ -258,7 +263,7 @@ banlist_sensitize (banlist_info *banl) } /* BUTTONS --- */ - if (banl->sess->me->op == 0 || banl->line_ct == 0) + if (!is_op || banl->line_ct == 0) { /* If user is not op or list is empty, buttons should be all greyed */ gtk_widget_set_sensitive (banl->but_clear, FALSE); |