updates.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 27 Mar 2001 11:08:03 +0000 (11:08 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 27 Mar 2001 11:08:03 +0000 (11:08 +0000)
lib/silcclient/client.c

index ae08c2ffc0dacbb8d0847391033ae9b05a99b14e..4ea2a2d8e34d62c349b285bbfb8cfee777f6008a 100644 (file)
@@ -1254,9 +1254,9 @@ void silc_client_replace_from_channels(SilcClient client,
 
 /* Parses mode mask and returns the mode as string. */
 
-char *silc_client_chmode(unsigned int mode)
+char *silc_client_chmode(unsigned int mode, SilcChannelEntry channel)
 {
-  char string[20];
+  char string[100];
 
   if (!mode)
     return NULL;
@@ -1284,6 +1284,22 @@ char *silc_client_chmode(unsigned int mode)
   if (mode & SILC_CHANNEL_MODE_PASSPHRASE)
     strncat(string, "a", 1);
 
+  if (mode & SILC_CHANNEL_MODE_CIPHER) {
+    char cipher[50];
+    memset(cipher, 0, sizeof(cipher));
+    snprintf(cipher, sizeof(cipher), "c (%s)", 
+            channel->channel_key->cipher->name);
+    strncat(string, cipher, strlen(cipher));
+  }
+
+  if (mode & SILC_CHANNEL_MODE_HMAC) {
+    char hmac[50];
+    memset(hmac, 0, sizeof(hmac));
+    snprintf(hmac, sizeof(hmac), "h (%s)", 
+            channel->hmac->hmac->name);
+    strncat(string, hmac, strlen(hmac));
+  }
+
   /* Rest of mode is ignored */
 
   return strdup(string);