Added usermode printing on statusbar.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 8 Mar 2002 16:32:37 +0000 (16:32 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 8 Mar 2002 16:32:37 +0000 (16:32 +0000)
CHANGES
TODO
apps/irssi/silc.conf
apps/irssi/src/silc/core/client_ops.c
apps/irssi/src/silc/core/silc-expandos.c

diff --git a/CHANGES b/CHANGES
index d4ebaed5ab003c536903e3feff8bd314bc71db02..6bd7de1e99ea14b4826606d348e8a92ac5637e8d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,10 @@ Fri Mar  8 17:16:41 EET 2002  Pekka Riikonen <priikone@silcnet.org>
          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 <priikone@silcnet.org>
 
        * Changed silc_mutex_[un]lock calls in lib/silcutil/silcschedule.c
diff --git a/TODO b/TODO
index a2361fbc0aa759e52b5b06b4cc1fc01895c0b57d..6b95e0b9f2b6d23228866714e011e3cbd7ad7550 100644 (file)
--- 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.
 
 
index 38c4e1c32c0a06f0460762a2e2de2e83dcd253c8..4e7356ca0db9e8cc3a7092e5730bffb89596e32b 100644 (file)
@@ -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"; };
       };
     };
index e3a31a5a6e8a006d1149111eea8a0f872a0c6517..daff073bb9387756474190f93aef588db94a18a3 100644 (file)
@@ -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;
index 2f176266b7fb091f15f5b5ff5808e3800f64b2bc..3bffb9e63fb80c16e7ceeb55a93bef0355b64578 100644 (file)
 
 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 */