From d1de138cb1ddba42b71d736176c9b2bd29de96f5 Mon Sep 17 00:00:00 2001 From: TingPing Date: Fri, 25 Oct 2013 09:27:59 -0400 Subject: [PATCH] Sensitize banlist buttons if half-op For #647 --- src/fe-gtk/banlist.c | 9 +++++++-- 1 file 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);