$OpenBSD: patch-irssi_src_silc_core_silc-servers_c,v 1.1 2002/09/24 17:20:10 fgsch Exp $
--- irssi/src/silc/core/silc-servers.c.orig	Sat Jul  6 05:42:27 2002
+++ irssi/src/silc/core/silc-servers.c	Tue Sep 24 02:28:01 2002
@@ -69,8 +69,6 @@ static void silc_send_channel(SILC_SERVE
 typedef struct {
   char *nick;
   char *msg;
-  int len;
-  SilcMessageFlags flags;
   SILC_SERVER_REC *server;
 } PRIVMSG_REC;
 
@@ -123,8 +121,8 @@ static void silc_send_msg_clients(SilcCl
 
     /* Send the private message */
     silc_client_send_private_message(client, conn, target, 
-				     rec->flags,
-				     rec->msg, rec->len,
+				     SILC_MESSAGE_FLAG_UTF8,
+				     rec->msg, strlen(rec->msg),
 				     TRUE);
   }
   
@@ -134,8 +132,7 @@ static void silc_send_msg_clients(SilcCl
   g_free(rec);
 }
 
-static void silc_send_msg(SILC_SERVER_REC *server, char *nick, char *msg,
-			int msg_len, SilcMessageFlags flags)
+static void silc_send_msg(SILC_SERVER_REC *server, char *nick, char *msg)
 {
   PRIVMSG_REC *rec;
   SilcClientEntry *clients;
@@ -156,8 +153,6 @@ static void silc_send_msg(SILC_SERVER_RE
     rec->nick = g_strdup(nick);
     rec->msg = g_strdup(msg);
     rec->server = server;
-    rec->flags = flags;
-    rec->len = msg_len;
 
     /* Could not find client with that nick, resolve it from server. */
     silc_client_get_clients(silc_client, server->conn,
@@ -169,51 +164,8 @@ static void silc_send_msg(SILC_SERVER_RE
   /* Send the private message directly */
   silc_free(nickname);
   silc_client_send_private_message(silc_client, server->conn, 
-				   clients[0], flags,
-				   msg, msg_len, TRUE);
-}
-
-void silc_send_mime(SILC_SERVER_REC *server, WI_ITEM_REC *to,
-		    const char *data, int data_len,
-		    const char *enc, const char *type)
-{
-  SILC_CHANNEL_REC *channel;
-  QUERY_REC *query;
-  char *mime_data;
-  int mime_data_len;
-  
-  if (!(IS_SILC_SERVER(server)) || (data == NULL) || (to == NULL) || 
-      (enc == NULL) || (type == NULL))
-    return;
-	    
-#define SILC_MIME_HEADER "MIME-Version: 1.0\r\nContent-Type: %s\r\nContent-Transfer-Encoding: %s\r\n\r\n"
-
-  mime_data_len = data_len + strlen(SILC_MIME_HEADER) - 4
-    + strlen(enc) + strlen(type);
-  if (mime_data_len >= SILC_PACKET_MAX_LEN)
-    return;
-
-  /* we risk to large packets here... */
-  mime_data = silc_calloc(mime_data_len, sizeof(*mime_data));
-  snprintf(mime_data, mime_data_len, SILC_MIME_HEADER, type, enc);
-  memmove(mime_data + strlen(SILC_MIME_HEADER) - 4 + strlen(enc) + strlen(type),
-	  data, data_len);
-
-#undef SILC_MIME_HEADER
-
-  if (IS_SILC_CHANNEL(to)) {
-    channel = SILC_CHANNEL(to);
-    silc_client_send_channel_message(silc_client, server->conn, channel->entry, 
-				     NULL, SILC_MESSAGE_FLAG_DATA,
-				     mime_data, mime_data_len, TRUE);
-  } else if (IS_SILC_QUERY(to)) {
-    query = SILC_QUERY(to);
-    silc_send_msg(server, query->name, mime_data, mime_data_len,
-		  SILC_MESSAGE_FLAG_DATA);
-    
-  }
-
-  silc_free(mime_data);
+				   clients[0], SILC_MESSAGE_FLAG_UTF8,
+				   msg, strlen(msg), TRUE);
 }
 
 static int isnickflag_func(char flag)
@@ -251,9 +203,7 @@ static void send_message(SILC_SERVER_REC
   if (target_type == SEND_TARGET_CHANNEL)
     silc_send_channel(server, target, message ? message : msg);
   else
-    silc_send_msg(server, target, message ? message : msg,
-		  message ? strlen(message) : strlen(msg),
-		  SILC_MESSAGE_FLAG_UTF8);
+    silc_send_msg(server, target, message ? message : msg);
 
   silc_free(message);
 }
@@ -940,7 +890,6 @@ void silc_server_init(void)
 
   signal_add_first("server connected", (SIGNAL_FUNC) sig_connected);
   signal_add("server disconnected", (SIGNAL_FUNC) sig_disconnected);
-  signal_add("mime-send", (SIGNAL_FUNC)silc_send_mime);
   command_bind_silc("whois", MODULE_NAME, (SIGNAL_FUNC) command_self);
   command_bind_silc("whowas", MODULE_NAME, (SIGNAL_FUNC) command_self);
   command_bind_silc("nick", MODULE_NAME, (SIGNAL_FUNC) command_self);
@@ -976,7 +925,6 @@ void silc_server_deinit(void)
 
   signal_remove("server connected", (SIGNAL_FUNC) sig_connected);
   signal_remove("server disconnected", (SIGNAL_FUNC) sig_disconnected);
-  signal_remove("mime-send", (SIGNAL_FUNC)silc_send_mime);
   command_unbind("whois", (SIGNAL_FUNC) command_self);
   command_unbind("whowas", (SIGNAL_FUNC) command_self);
   command_unbind("nick", (SIGNAL_FUNC) command_self);
