From af1c4c5de80b26effbbd036aa014d7e317f0369a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Enrico=20Tr=C3=B6ger?= Date: Thu, 10 Jul 2008 19:39:56 +0200 Subject: [PATCH] De-op ourselves only if we hadn't op status before. --- src/irc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/irc.c b/src/irc.c index 8520cc0..285fce6 100644 --- a/src/irc.c +++ b/src/irc.c @@ -652,6 +652,7 @@ static gboolean irc_amiop(irc_conn_t *irc_conn) static void irc_kick(irc_conn_t *irc_conn, const gchar *nickname) { static gchar msg[1024]; + gboolean need_deop = FALSE; guint msg_len; TRACE @@ -662,11 +663,13 @@ static void irc_kick(irc_conn_t *irc_conn, const gchar *nickname) // give the server a chance to set the op status for us before we make us of it, // and let the victim read his *bang* message g_usleep(1500000); + need_deop = TRUE; } msg_len = g_snprintf(msg, sizeof msg, "KICK #%s %s\r\n", config->channel, nickname); irc_send(irc_conn, msg, msg_len); - irc_toggle_op(irc_conn, FALSE); /// TODO de-op ourselves only if we were not op before + if (need_deop) + irc_toggle_op(irc_conn, FALSE); } -- 2.11.4.GIT