From a3ca059a76a0f065f38451be547fa02c8997a892 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 8 Mar 2002 16:32:37 +0000 Subject: [PATCH] Added usermode printing on statusbar. --- CHANGES | 4 ++++ TODO | 2 -- apps/irssi/silc.conf | 6 ++++-- apps/irssi/src/silc/core/client_ops.c | 7 +++++++ apps/irssi/src/silc/core/silc-expandos.c | 8 +++++++- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index d4ebaed5..6bd7de1e 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,10 @@ Fri Mar 8 17:16:41 EET 2002 Pekka Riikonen Now Irssi SILC client prints channel user modes etc. on the statusbar. + * The user mode (like server/router operator changes) is now shown + on the Irssi SILC client's statusbar. The affected files are + irssi/src/silc/core/client_ops.c, silc-expandos.c. + Thu Mar 7 19:21:22 EET 2002 Pekka Riikonen * Changed silc_mutex_[un]lock calls in lib/silcutil/silcschedule.c diff --git a/TODO b/TODO index a2361fbc..6b95e0b9 100644 --- a/TODO +++ b/TODO @@ -11,8 +11,6 @@ TODO/bugs in Irssi SILC client keys is not possible because changing the key is not possible by the user. - o Add the server/router operator info to the statusbar. - o /cumode for unknown nick does not give any error message. diff --git a/apps/irssi/silc.conf b/apps/irssi/silc.conf index 38c4e1c3..4e7356ca 100644 --- a/apps/irssi/silc.conf +++ b/apps/irssi/silc.conf @@ -81,7 +81,8 @@ statusbar = { # treated "normally", you could change the time/user name to whatever time = "{sb $Z}"; - user = "{sb $cumode$N{sbmode $usermode}{sbaway $A}}"; + user = "{sb $cumode$N{sbaway $A}}"; + usermode = " {sbmode $usermode}"; topic = " $topic"; # treated specially .. window is printed with non-empty windows, @@ -124,7 +125,8 @@ statusbar = { window_empty = { }; lag = { priority = "-1"; }; act = { priority = "10"; }; - more = { priority = "-1"; alignment = "right"; }; + usermode = { priority = "-1"; }; + more = { priority = "10"; alignment = "right"; }; barend = { priority = "100"; alignment = "right"; }; }; }; diff --git a/apps/irssi/src/silc/core/client_ops.c b/apps/irssi/src/silc/core/client_ops.c index e3a31a5a..daff073b 100644 --- a/apps/irssi/src/silc/core/client_ops.c +++ b/apps/irssi/src/silc/core/client_ops.c @@ -1085,6 +1085,7 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, MSGLEVEL_CRAP, SILCTXT_ROUTER_OPER); server->umode = mode; + signal_emit("user mode changed", 2, server, NULL); } break; @@ -1092,6 +1093,9 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (!success) return; + server->umode |= SILC_UMODE_SERVER_OPERATOR; + signal_emit("user mode changed", 2, server, NULL); + printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP, SILCTXT_SERVER_OPER); break; @@ -1100,6 +1104,9 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, if (!success) return; + server->umode |= SILC_UMODE_ROUTER_OPERATOR; + signal_emit("user mode changed", 2, server, NULL); + printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP, SILCTXT_ROUTER_OPER); break; diff --git a/apps/irssi/src/silc/core/silc-expandos.c b/apps/irssi/src/silc/core/silc-expandos.c index 2f176266..3bffb9e6 100644 --- a/apps/irssi/src/silc/core/silc-expandos.c +++ b/apps/irssi/src/silc/core/silc-expandos.c @@ -34,7 +34,13 @@ static char *expando_usermode(SERVER_REC *server, void *item, int *free_ret) { - return ""; + SILC_SERVER_REC *s = SILC_SERVER(server); + + if (!s) + return ""; + + return (s->umode & SILC_UMODE_SERVER_OPERATOR) ? "Server Operator" : + (s->umode & SILC_UMODE_ROUTER_OPERATOR) ? "Router Operator" : ""; } /* Expands to your usermode on channel */ -- 2.43.0