From 394320aa05cd37d54dc6761937ed8e03bd16f74f Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Thu, 18 Apr 2002 12:21:50 +0000 Subject: [PATCH] updates. --- apps/irssi/src/silc/core/client_ops.c | 61 ++++++++------------------- 1 file changed, 17 insertions(+), 44 deletions(-) diff --git a/apps/irssi/src/silc/core/client_ops.c b/apps/irssi/src/silc/core/client_ops.c index ba4d6cf2..f460b2dd 100644 --- a/apps/irssi/src/silc/core/client_ops.c +++ b/apps/irssi/src/silc/core/client_ops.c @@ -106,38 +106,35 @@ void silc_channel_message(SilcClient client, SilcClientConnection conn, nick = silc_nicklist_insert(chanrec, chu, FALSE); } - if (flags & SILC_MESSAGE_FLAG_DATA) { + if (flags & SILC_MESSAGE_FLAG_ACTION) + printformat_module("fe-common/silc", server, channel->channel_name, + MSGLEVEL_ACTIONS, SILCTXT_CHANNEL_ACTION, + nick == NULL ? "[]" : 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 ? "[]" : nick->nick, message); + else 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, display it */ - message = (const unsigned char *)data; - } else { - message = NULL; - } - } - 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 ? "[]" : 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 ? "[]" : nick->nick, message); - else + /* It is something textual */ + signal_emit("message public", 6, server, data, + nick == NULL ? "[]" : nick->nick, + nick == NULL ? "" : nick->host == NULL ? "" : nick->host, + chanrec->name, nick); + } + } else signal_emit("message public", 6, server, message, nick == NULL ? "[]" : nick->nick, nick == NULL ? "" : nick->host == NULL ? "" : nick->host, @@ -162,30 +159,6 @@ void silc_private_message(SilcClient client, SilcClientConnection conn, if (sender->username) snprintf(userhost, sizeof(userhost) - 1, "%s@%s", sender->username, sender->hostname); - - 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)) - return; - - /* Then figure out what we can display */ - if (strstr(type, "text/") && !strstr(type, "text/t140") && - !strstr(type, "text/vnd")) { - /* It is something textual, display it */ - message = (const unsigned char *)data; - } else { - message = NULL; - } - } - - if (!message) - return; - signal_emit("message private", 4, server, message, sender->nickname ? sender->nickname : "[]", sender->username ? userhost : NULL); -- 2.43.0