# HG changeset patch # User Stu Tomlinson # Date 1181440480 0 # Node ID 9a96d87113035e705738cd7c2d3825f1638e0d7a # Parent d74d716f814db87e6927c478d87cfca6ec5e0819 We now depend on SILC Toolkit 1.1 for this copy of this prpl so we can lose a whole bunch of "#ifdef SILC_ATTRIBUTE_USER_ICON" and "#ifdef HAVE_SILCMIME_H" because they will always be true diff -r d74d716f814d -r 9a96d8711303 libpurple/protocols/silc/buddy.c --- a/libpurple/protocols/silc/buddy.c Sat Jun 09 18:03:12 2007 +0000 +++ b/libpurple/protocols/silc/buddy.c Sun Jun 10 01:54:40 2007 +0000 @@ -739,9 +739,7 @@ SilcAttribute attribute; SilcVCardStruct vcard; SilcMime message = NULL, extension = NULL; -#ifdef SILC_ATTRIBUTE_USER_ICON SilcMime usericon = NULL; -#endif SilcAttributeObjPk serverpk, usersign, serversign; gboolean usign_success = TRUE, ssign_success = TRUE; char filename[512], filename2[512], *fingerprint = NULL, *tmp; @@ -827,14 +825,12 @@ continue; break; -#ifdef SILC_ATTRIBUTE_USER_ICON case SILC_ATTRIBUTE_USER_ICON: usericon = silc_mime_alloc(); if (!silc_attribute_get_object(attr, (void *)usericon, sizeof(*usericon))) continue; break; -#endif case SILC_ATTRIBUTE_SERVER_PUBLIC_KEY: if (serverpk.type) @@ -974,7 +970,6 @@ silc_mime_free(extension); } -#ifdef SILC_ATTRIBUTE_USER_ICON /* Save user icon */ if (usericon) { const char *type = silc_mime_get_field(usericon, "Content-Type"); @@ -993,7 +988,6 @@ } silc_mime_free(usericon); } -#endif } /* Save the public key path to buddy properties, as it is used @@ -1369,9 +1363,7 @@ SILC_ATTRIBUTE_PREFERRED_CONTACT, SILC_ATTRIBUTE_TIMEZONE, SILC_ATTRIBUTE_GEOLOCATION, -#ifdef SILC_ATTRIBUTE_USER_ICON SILC_ATTRIBUTE_USER_ICON, -#endif SILC_ATTRIBUTE_DEVICE_INFO, 0); userpk.type = "silc-rsa"; userpk.data = silc_pkcs_public_key_encode(public_key, &userpk.data_len); @@ -1691,7 +1683,6 @@ return m; } -#ifdef SILC_ATTRIBUTE_USER_ICON void silcpurple_buddy_set_icon(PurpleConnection *gc, PurpleStoredImage *img) { SilcPurple sg = gc->proto_data; @@ -1729,4 +1720,3 @@ silc_mime_free(mime); } -#endif diff -r d74d716f814d -r 9a96d8711303 libpurple/protocols/silc/chat.c --- a/libpurple/protocols/silc/chat.c Sat Jun 09 18:03:12 2007 +0000 +++ b/libpurple/protocols/silc/chat.c Sun Jun 10 01:54:40 2007 +0000 @@ -1238,9 +1238,7 @@ char *msg2, *tmp; gboolean found = FALSE; gboolean sign = purple_account_get_bool(sg->account, "sign-verify", FALSE); -#ifdef HAVE_SILCMIME_H SilcDList list; -#endif if (!msg || !conn) return 0; @@ -1309,7 +1307,6 @@ channel = chu->channel; } -#ifdef HAVE_SILCMIME_H /* Check for images */ if (msgflags & PURPLE_MESSAGE_IMAGES) { list = silcpurple_image_message(msg, &flags); @@ -1334,7 +1331,6 @@ return ret; } } -#endif /* Send channel message */ ret = silc_client_send_channel_message(client, conn, channel, key, diff -r d74d716f814d -r 9a96d8711303 libpurple/protocols/silc/ops.c --- a/libpurple/protocols/silc/ops.c Sat Jun 09 18:03:12 2007 +0000 +++ b/libpurple/protocols/silc/ops.c Sun Jun 10 01:54:40 2007 +0000 @@ -61,7 +61,6 @@ } } -#ifdef HAVE_SILCMIME_H /* Processes incoming MIME message. Can be private message or channel message. Returns TRUE if the message `mime' was displayed. */ @@ -233,7 +232,6 @@ silc_mime_free(mime); return ret; } -#endif /* HAVE_SILCMIME_H */ /* Message for a channel. The `sender' is the sender of the message The `channel' is the channel. The `message' is the message. Note @@ -282,30 +280,10 @@ if (flags & SILC_MESSAGE_FLAG_DATA) { /* Process MIME message */ -#ifdef HAVE_SILCMIME_H SilcMime mime; mime = silc_mime_decode(NULL, message, message_len); silcpurple_mime_message(client, conn, sender, channel, payload, key, flags, mime, FALSE); -#else - char type[128], enc[128]; - unsigned char *data; - SilcUInt32 data_len; - - memset(type, 0, sizeof(type)); - memset(enc, 0, sizeof(enc)); - - if (!silc_mime_parse(message, message_len, NULL, 0, - type, sizeof(type) - 1, enc, sizeof(enc) - 1, &data, - &data_len)) - return; - - if (!strcmp(type, "application/x-wb") && - !strcmp(enc, "binary") && - !purple_account_get_bool(sg->account, "block-wb", FALSE)) - silcpurple_wb_receive_ch(client, conn, sender, channel, - payload, flags, data, data_len); -#endif return; } @@ -378,31 +356,11 @@ } if (flags & SILC_MESSAGE_FLAG_DATA) { -#ifdef HAVE_SILCMIME_H /* Process MIME message */ SilcMime mime; mime = silc_mime_decode(NULL, message, message_len); silcpurple_mime_message(client, conn, sender, NULL, payload, NULL, flags, mime, FALSE); -#else - char type[128], enc[128]; - unsigned char *data; - SilcUInt32 data_len; - - memset(type, 0, sizeof(type)); - memset(enc, 0, sizeof(enc)); - - if (!silc_mime_parse(message, message_len, NULL, 0, - type, sizeof(type) - 1, enc, sizeof(enc) - 1, &data, - &data_len)) - return; - - if (!strcmp(type, "application/x-wb") && - !strcmp(enc, "binary") && - !purple_account_get_bool(sg->account, "block-wb", FALSE)) - silcpurple_wb_receive(client, conn, sender, payload, - flags, data, data_len); -#endif return; } diff -r d74d716f814d -r 9a96d8711303 libpurple/protocols/silc/silc.c --- a/libpurple/protocols/silc/silc.c Sat Jun 09 18:03:12 2007 +0000 +++ b/libpurple/protocols/silc/silc.c Sun Jun 10 01:54:40 2007 +0000 @@ -145,9 +145,7 @@ SilcPurple sg; SilcUInt32 mask; char tz[16]; -#ifdef SILC_ATTRIBUTE_USER_ICON PurpleStoredImage *img; -#endif #ifdef HAVE_SYS_UTSNAME_H struct utsname u; #endif @@ -201,12 +199,10 @@ SILC_ATTRIBUTE_TIMEZONE, (void *)tz, strlen(tz)); -#ifdef SILC_ATTRIBUTE_USER_ICON /* Set our buddy icon */ img = purple_buddy_icons_find_account_icon(sg->account); silcpurple_buddy_set_icon(gc, img); purple_imgstore_unref(img); -#endif return; break; @@ -461,10 +457,8 @@ SilcPurple sg = (SilcPurple)context; silc_client_stop(sg->client, NULL, NULL); silc_client_free(sg->client); -#ifdef HAVE_SILCMIME_H if (sg->mimeass) silc_mime_assembler_free(sg->mimeass); -#endif silc_free(sg); return 0; } @@ -1127,9 +1121,7 @@ PurpleConversation *convo; char tmp[256]; SilcClientEntry client_entry; -#ifdef HAVE_SILCMIME_H SilcDList list; -#endif convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, im->nick, sg->account); @@ -1151,7 +1143,6 @@ silc_dlist_start(clients); client_entry = silc_dlist_get(clients); -#ifdef HAVE_SILCMIME_H /* Check for images */ if (im->gflags & PURPLE_MESSAGE_IMAGES) { list = silcpurple_image_message(im->message, @@ -1173,7 +1164,6 @@ goto out; } } -#endif /* Send the message */ silc_client_send_private_message(client, conn, client_entry, im->flags, @@ -1206,9 +1196,7 @@ char *msg, *tmp; int ret = 0; gboolean sign = purple_account_get_bool(sg->account, "sign-verify", FALSE); -#ifdef HAVE_SILCMIME_H SilcDList list; -#endif if (!who || !message) return 0; @@ -1259,7 +1247,6 @@ silc_dlist_start(clients); client_entry = silc_dlist_get(clients); -#ifdef HAVE_SILCMIME_H /* Check for images */ if (flags & PURPLE_MESSAGE_IMAGES) { list = silcpurple_image_message(message, &mflags); @@ -1281,7 +1268,6 @@ return ret; } } -#endif /* Send private message directly */ ret = silc_client_send_private_message(client, conn, client_entry, @@ -1800,20 +1786,11 @@ static PurplePluginProtocolInfo prpl_info = { -#ifdef HAVE_SILCMIME_H OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_PASSWORD_OPTIONAL | OPT_PROTO_IM_IMAGE, -#else - OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | - OPT_PROTO_PASSWORD_OPTIONAL, -#endif NULL, /* user_splits */ NULL, /* protocol_options */ -#ifdef SILC_ATTRIBUTE_USER_ICON {"jpeg,gif,png,bmp", 0, 0, 96, 96, 0, PURPLE_ICON_SCALE_DISPLAY}, /* icon_spec */ -#else - NO_BUDDY_ICONS, -#endif silcpurple_list_icon, /* list_icon */ NULL, /* list_emblems */ silcpurple_status_text, /* status_text */ @@ -1857,11 +1834,7 @@ NULL, /* buddy_free */ NULL, /* convo_closed */ NULL, /* normalize */ -#ifdef SILC_ATTRIBUTE_USER_ICON silcpurple_buddy_set_icon, /* set_buddy_icon */ -#else - NULL, -#endif NULL, /* remove_group */ NULL, /* get_cb_real_name */ silcpurple_chat_set_topic, /* set_chat_topic */ diff -r d74d716f814d -r 9a96d8711303 libpurple/protocols/silc/silcpurple.h --- a/libpurple/protocols/silc/silcpurple.h Sat Jun 09 18:03:12 2007 +0000 +++ b/libpurple/protocols/silc/silcpurple.h Sun Jun 10 01:54:40 2007 +0000 @@ -77,9 +77,7 @@ char *motd; PurpleRoomlist *roomlist; -#ifdef HAVE_SILCMIME_H SilcMimeAssembler mimeass; -#endif unsigned int detaching : 1; unsigned int resuming : 1; unsigned int roomlist_canceled : 1; @@ -148,13 +146,9 @@ void silcpurple_parse_attrs(SilcDList attrs, char **moodstr, char **statusstr, char **contactstr, char **langstr, char **devicestr, char **tzstr, char **geostr); -#ifdef SILC_ATTRIBUTE_USER_ICON void silcpurple_buddy_set_icon(PurpleConnection *gc, PurpleStoredImage *img); -#endif -#ifdef HAVE_SILCMIME_H char *silcpurple_file2mime(const char *filename); SilcDList silcpurple_image_message(const char *msg, SilcUInt32 *mflags); -#endif #ifdef _WIN32 typedef int uid_t; diff -r d74d716f814d -r 9a96d8711303 libpurple/protocols/silc/util.c --- a/libpurple/protocols/silc/util.c Sat Jun 09 18:03:12 2007 +0000 +++ b/libpurple/protocols/silc/util.c Sun Jun 10 01:54:40 2007 +0000 @@ -614,7 +614,6 @@ geo.accuracy ? geo.accuracy : ""); } -#ifdef HAVE_SILCMIME_H /* Returns MIME type of filetype */ char *silcpurple_file2mime(const char *filename) @@ -772,5 +771,3 @@ return list; } - -#endif /* HAVE_SILCMIME_H */