updates.
authorPekka Riikonen <priikone@silcnet.org>
Thu, 18 Apr 2002 12:21:50 +0000 (12:21 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 18 Apr 2002 12:21:50 +0000 (12:21 +0000)
CHANGES
apps/irssi/src/silc/core/client_ops.c

diff --git a/CHANGES b/CHANGES
index 6abf33222ca1a93303a6eb19cb8feb40304d71da..5708445f65e84ff444512b7be2b9b54591cd2cc2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,10 @@ Thu Apr 18 14:09:51 CEST 2002  Pekka Riikonen <priikone@silcnet.org>
        * Added silc_mime_parse function to parse MIME headers.
          Affected files are lib/silcutil/silcstruti.[ch].
 
+       * Added MIME header parsing in Irssi SILC Client.  It displays
+         all textual MIME objects, others it ignores.  Affected file
+         is irssi/src/silc/core/clien_ops.c.
+
 Wed Apr 17 22:07:59 CEST 2002  Johnny Mnemonic <johnny@themnemonic.org>
 
        * Fixed a bug in the pid writing function, which couldn't be
index f460b2dd2e919e2c3891f0eb906af8654d37eb3c..d2807c47ce8ea7b5b9320999b24a282f60641a9e 100644 (file)
@@ -106,35 +106,38 @@ void silc_channel_message(SilcClient client, SilcClientConnection conn,
       nick = silc_nicklist_insert(chanrec, chu, FALSE);
   }
 
-  if (flags & SILC_MESSAGE_FLAG_ACTION)
-    printformat_module("fe-common/silc", server, channel->channel_name,
-                      MSGLEVEL_ACTIONS, SILCTXT_CHANNEL_ACTION, 
-                       nick == NULL ? "[<unknown>]" : nick->nick, message);
-  else if (flags & SILC_MESSAGE_FLAG_NOTICE)
-    printformat_module("fe-common/silc", server, channel->channel_name,
-                      MSGLEVEL_NOTICES, SILCTXT_CHANNEL_NOTICE, 
-                       nick == NULL ? "[<unknown>]" : nick->nick, message);
-  else if (flags & SILC_MESSAGE_FLAG_DATA) {
+  if (flags & SILC_MESSAGE_FLAG_DATA) {
     /* MIME object received, try to display it as well as we can */
     char type[128];
     unsigned char *data;
 
     memset(type, 0, sizeof(type));
     if (!silc_mime_parse(message, message_len, NULL, 0, type, sizeof(type) - 1,
-                       NULL, 0, &data, NULL))
+                        NULL, 0, &data, NULL))
       return;
 
     /* Then figure out what we can display */
     if (strstr(type, "text/") && !strstr(type, "text/t140") &&
        !strstr(type, "text/vnd")) {
-
-      /* It is something textual */
-      signal_emit("message public", 6, server, data,
-                 nick == NULL ? "[<unknown>]" : nick->nick,
-                 nick == NULL ? "" : nick->host == NULL ? "" : nick->host,
-                 chanrec->name, nick);
+      /* It is something textual, display it */
+      message = (const unsigned char *)data;
+    } else {
+      message = NULL;
     }
-  } else
+  }
+
+  if (!message)
+    return;
+
+  if (flags & SILC_MESSAGE_FLAG_ACTION)
+    printformat_module("fe-common/silc", server, channel->channel_name,
+                      MSGLEVEL_ACTIONS, SILCTXT_CHANNEL_ACTION, 
+                       nick == NULL ? "[<unknown>]" : nick->nick, message);
+  else if (flags & SILC_MESSAGE_FLAG_NOTICE)
+    printformat_module("fe-common/silc", server, channel->channel_name,
+                      MSGLEVEL_NOTICES, SILCTXT_CHANNEL_NOTICE, 
+                       nick == NULL ? "[<unknown>]" : nick->nick, message);
+  else
     signal_emit("message public", 6, server, message,
                nick == NULL ? "[<unknown>]" : nick->nick,
                nick == NULL ? "" : nick->host == NULL ? "" : nick->host,