updates.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 28 May 2002 17:05:29 +0000 (17:05 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 28 May 2002 17:05:29 +0000 (17:05 +0000)
CHANGES
apps/irssi/src/silc/core/client_ops.c
apps/irssi/src/silc/core/silc-expandos.c

diff --git a/CHANGES b/CHANGES
index 3f38c5edae6f43ab454fe40e892532eaf448bca0..e0c7eae79d5d31704f15c1dc755ecb39fb0262ce 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+Tue May 28 20:11:41 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+       * Display the user mode on the status bar.  Affected file
+         irssi/src/silc/core/silc-expandos.c.
+
 Tue May 28 13:56:26 CEST 2002 Pekka Riikonen <priikone@silcnet.org>
 
        * If private message key is not set, but the flag is set in
index 1dc966874e99f0bcf5be62c29621d33db4e4a038..4a5e1583cd8f7724ab2b36455de9b85c60840f07 100644 (file)
@@ -75,6 +75,10 @@ static void silc_get_umode_string(SilcUInt32 mode, char *buf,
     strcat(buf, " [blocks private messages]");
   if (mode & SILC_UMODE_DETACHED)
     strcat(buf, " [detached]");
+  if (mode & SILC_UMODE_REJECT_WATCHING)
+    strcat(buf, " [rejects watching]");
+  if (mode & SILC_UMODE_BLOCK_INVITE)
+    strcat(buf, " [blocks invites]");
 }
 
 void silc_say(SilcClient client, SilcClientConnection conn,
index d29a31d4f2262b56810388c6631ca9014eb82b7c..cecdfab19e947152ee5939992442da961d14b57c 100644 (file)
 static char *expando_usermode(SERVER_REC *server, void *item, int *free_ret)
 {
   SILC_SERVER_REC *s = SILC_SERVER(server);
+  static char modes[128], stat[128];
+  bool se;
 
   if (!s)
     return "";
 
-  return (s->umode & SILC_UMODE_SERVER_OPERATOR) ? "Server Operator" :
-    (s->umode & SILC_UMODE_ROUTER_OPERATOR) ? "Router Operator" : "";
+  memset(modes, 0, sizeof(modes));
+  memset(stat, 0, sizeof(stat));
+
+  if (s->umode & SILC_UMODE_GONE)
+    strcat(stat, "g");
+  if (s->umode & SILC_UMODE_INDISPOSED)
+    strcat(stat, "i");
+  if (s->umode & SILC_UMODE_BUSY)
+    strcat(stat, "b");
+  if (s->umode & SILC_UMODE_PAGE)
+    strcat(stat, "p");
+  if (s->umode & SILC_UMODE_HYPER)
+    strcat(stat, "h");
+  if (s->umode & SILC_UMODE_ROBOT)
+    strcat(stat, "t");
+  if (s->umode & SILC_UMODE_ANONYMOUS)
+    strcat(stat, "?");
+  if (s->umode & SILC_UMODE_BLOCK_PRIVMSG)
+    strcat(stat, "P");
+  if (s->umode & SILC_UMODE_REJECT_WATCHING)
+    strcat(stat, "w");
+  if (s->umode & SILC_UMODE_BLOCK_INVITE)
+    strcat(stat, "I");
+
+  se = strlen(stat) > 0;
+  snprintf(modes, sizeof(modes) - 1, "%s%s%s%s",
+          ((s->umode & SILC_UMODE_SERVER_OPERATOR) ? "Server Operator" :
+           (s->umode & SILC_UMODE_ROUTER_OPERATOR) ? "Router Operator" : ""),
+          se ? "[" : "", se ? stat : "", se ? "]" : "");
+
+  return modes;
 }
 
 /* Expands to your usermode on channel */