# HG changeset patch # User Yoshiki Yazawa # Date 1212985051 0 # Node ID 81ebe4fac9ce812b2807d3ee4832ee8308cf4cdf # Parent d201287d3a0ec7955ba2fc15befbd5980561537d# Parent 9776a2fc2370c61a0268178fc37bf7167d682e89 propagate from branch 'im.pidgin.pidgin' (head 6f45eed99c94f8e63e46ad382a70c0c4e266b833) to branch 'im.pidgin.pidgin.yaz' (head 54c86e064bc819611a530ea0420351be7bebeffe) diff -r d201287d3a0e -r 81ebe4fac9ce ChangeLog --- a/ChangeLog Wed Jun 04 05:13:07 2008 +0000 +++ b/ChangeLog Mon Jun 09 04:17:31 2008 +0000 @@ -7,12 +7,17 @@ Marcus Lundblad, Jorge Villaseñor and other contributors) * Yahoo! Japan now uses UTF-8, matching the behavior of official clients and restoring compatibility with the web messenger (Yusuke Odate) + * Add a configure option, --with-ssl-certificates to allow packagers + to specify a system-wide SSL CA certificates directory. Also, when + set, we don't install our SSL CA certs. Pidgin: - * Custom buddy icons can now be added and removed to buddy list + * Custom buddy icons can now be added to and removed from buddy list entries via the buddy list entry right-click menu. * Resize large incoming custom smileys to a maximum of 96px on either side. + * Offer to add new buddies into the same contact as existing buddies + in the same group if the alias given is the same. General: * Group and Chat buddy list entries can now be given custom buddy @@ -20,6 +25,10 @@ Finch: * Added "Invite..." menu to chats. + * Added "View All Logs" menu in the buddylist to display a list of all IM + logs. + * Added '/msgcolor' command to change colors of different classes of + messages in a conversation. See '/help msgcolor' for details. version 2.4.2 (05/17/2008): libpurple: diff -r d201287d3a0e -r 81ebe4fac9ce configure.ac --- a/configure.ac Wed Jun 04 05:13:07 2008 +0000 +++ b/configure.ac Mon Jun 09 04:17:31 2008 +0000 @@ -1207,8 +1207,8 @@ dnl # Check for D-Bus libraries dnl ####################################################################### -AC_ARG_ENABLE(dbus, [AC_HELP_STRING([--enable-dbus], [enable D-Bus support])], , enable_dbus=yes) -AC_ARG_ENABLE(nm, [AC_HELP_STRING([--enable-nm], [enable NetworkManager support (requires D-Bus)])], enable_nm=$enableval, enable_nm=yes) +AC_ARG_ENABLE(dbus, [AC_HELP_STRING([--disable-dbus], [disable D-Bus support])], , enable_dbus=yes) +AC_ARG_ENABLE(nm, [AC_HELP_STRING([--disable-nm], [disable NetworkManager support (requires D-Bus)])], enable_nm=$enableval, enable_nm=yes) if test "x$enable_dbus" = "xyes" ; then AC_CHECK_PROG(enable_dbus, dbus-binding-tool, yes, no) @@ -1561,6 +1561,18 @@ dnl # Thanks go to Evolution for the checks. dnl ####################################################################### +AC_ARG_WITH(ssl-certificates, [AC_HELP_STRING([--with-ssl-certificates=], [directory containing system-wide SSL CA certificates])]) + +SSL_CERTIFICATES_DIR="" +if ! test -z "$with_ssl_certificates" ; then + if ! test -d "$with_ssl_certificates" ; then + AC_MSG_ERROR([$with_ssl_certificates does not exist, if this is the correct location please make sure that it exists.]) + fi + SSL_CERTIFICATES_DIR="$with_ssl_certificates" +fi +AC_SUBST(SSL_CERTIFICATES_DIR) +AM_CONDITIONAL(INSTALL_SSL_CERTIFICATES, test "x$SSL_CERTIFICATES_DIR" = "x") + dnl These two are inverses of each other <-- stolen from evolution! AC_ARG_ENABLE(gnutls, @@ -2409,6 +2421,9 @@ fi echo Build with NetworkManager..... : $enable_nm echo SSL Library/Libraries......... : $msg_ssl +if test "x$SSL_CERTIFICATES_DIR" != "x" ; then + eval eval echo SSL CA certificates directory. : $SSL_CERTIFICATES_DIR +fi echo Build with Cyrus SASL support. : $enable_cyrus_sasl echo Use kerberos 4 with zephyr.... : $kerberos echo Use external libzephyr........ : $zephyr diff -r d201287d3a0e -r 81ebe4fac9ce finch/gntblist.c --- a/finch/gntblist.c Wed Jun 04 05:13:07 2008 +0000 +++ b/finch/gntblist.c Mon Jun 09 04:17:31 2008 +0000 @@ -2722,6 +2722,7 @@ PurpleConnection *gc; PurpleChat *chat; GHashTable *hash = NULL; + PurpleConversation *conv; account = purple_request_fields_get_account(fields, "account"); name = purple_request_fields_get_string(fields, "chat"); @@ -2730,7 +2731,16 @@ return; gc = purple_account_get_connection(account); - purple_conversation_new(PURPLE_CONV_TYPE_CHAT, account, name); + /* Create a new conversation now. This will give focus to the new window. + * But it's necessary to pretend that we left the chat, because otherwise + * a new conversation window will pop up when we finally join the chat. */ + if (!(conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, name, account))) { + conv = purple_conversation_new(PURPLE_CONV_TYPE_CHAT, account, name); + purple_conv_chat_left(PURPLE_CONV_CHAT(conv)); + } else { + purple_conversation_present(conv); + } + chat = purple_blist_find_chat(account, name); if (chat == NULL) { PurplePluginProtocolInfo *info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); @@ -2841,6 +2851,12 @@ } static void +view_all_logs_cb(GntMenuItem *item, gpointer n) +{ + finch_log_show(PURPLE_LOG_IM, NULL, NULL); +} + +static void menu_add_buddy_cb(GntMenuItem *item, gpointer null) { purple_blist_request_add_buddy(NULL, NULL, NULL, NULL); @@ -2905,6 +2921,11 @@ gnt_menu_add_item(GNT_MENU(sub), item); gnt_menuitem_set_callback(GNT_MENU_ITEM(item), view_log_cb, NULL); + item = gnt_menuitem_new(_("View All Logs")); + gnt_menuitem_set_id(GNT_MENU_ITEM(item), "view-all-logs"); + gnt_menu_add_item(GNT_MENU(sub), item); + gnt_menuitem_set_callback(GNT_MENU_ITEM(item), view_all_logs_cb, NULL); + item = gnt_menuitem_new(_("Show")); gnt_menu_add_item(GNT_MENU(sub), item); subsub = gnt_menu_new(GNT_MENU_POPUP); diff -r d201287d3a0e -r 81ebe4fac9ce finch/gntconv.c --- a/finch/gntconv.c Wed Jun 04 05:13:07 2008 +0000 +++ b/finch/gntconv.c Mon Jun 09 04:17:31 2008 +0000 @@ -1241,6 +1241,47 @@ } static PurpleCmdRet +cmd_message_color(PurpleConversation *conv, const char *cmd, char **args, char **error, gpointer data) +{ + int *msgclass = NULL; + int fg, bg; + + if (strcmp(args[0], "receive") == 0) + msgclass = &color_message_receive; + else if (strcmp(args[0], "send") == 0) + msgclass = &color_message_send; + else if (strcmp(args[0], "highlight") == 0) + msgclass = &color_message_highlight; + else if (strcmp(args[0], "action") == 0) + msgclass = &color_message_action; + else if (strcmp(args[0], "timestamp") == 0) + msgclass = &color_timestamp; + else { + if (error) + *error = g_strdup_printf(_("%s is not a valid message class. See '/help msgcolor' for valid message classes."), args[0]); + return PURPLE_CMD_STATUS_FAILED; + } + + fg = gnt_colors_get_color(args[1]); + if (fg == -EINVAL) { + if (error) + *error = g_strdup_printf(_("%s is not a valid color. See '/help msgcolor' for valid colors."), args[1]); + return PURPLE_CMD_STATUS_FAILED; + } + + bg = gnt_colors_get_color(args[2]); + if (bg == -EINVAL) { + if (error) + *error = g_strdup_printf(_("%s is not a valid color. See '/help msgcolor' for valid colors."), args[2]); + return PURPLE_CMD_STATUS_FAILED; + } + + init_pair(*msgclass, fg, bg); + + return PURPLE_CMD_STATUS_OK; +} + +static PurpleCmdRet users_command_cb(PurpleConversation *conv, const char *cmd, char **args, char **error, gpointer data) { FinchConv *fc = FINCH_GET_DATA(conv); @@ -1324,6 +1365,16 @@ PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL, cmd_show_window, _("statuses: Show the savedstatuses window."), finch_savedstatus_show_all); + /* Allow customizing the message colors using a command during run-time */ + purple_cmd_register("msgcolor", "www", PURPLE_CMD_P_DEFAULT, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM, NULL, + cmd_message_color, _("msgcolor <class> <foreground> <background>: " + "Set the color for different classes of messages in the conversation window.
" + " <class>: receive, send, highlight, action, timestamp
" + " <foreground/background>: black, red, green, blue, white, gray, darkgray, magenta, cyan, default

" + "EXAMPLE:
msgcolor send cyan default"), + NULL); + purple_signal_connect(purple_conversations_get_handle(), "buddy-typing", finch_conv_get_handle(), PURPLE_CALLBACK(update_buddy_typing), NULL); purple_signal_connect(purple_conversations_get_handle(), "buddy-typing-stopped", finch_conv_get_handle(), diff -r d201287d3a0e -r 81ebe4fac9ce finch/gntft.c --- a/finch/gntft.c Wed Jun 04 05:13:07 2008 +0000 +++ b/finch/gntft.c Mon Jun 09 04:17:31 2008 +0000 @@ -117,7 +117,9 @@ total_pct = 100 * total_bytes_xferred / total_file_size; } - title = g_strdup_printf(_("File Transfers - %d%% of %d files"), + title = g_strdup_printf(ngettext("File Transfers - %d%% of %d file", + "File Transfers - %d%% of %d files", + num_active_xfers), total_pct, num_active_xfers); gnt_screen_rename_widget((xfer_dialog->window), title); g_free(title); diff -r d201287d3a0e -r 81ebe4fac9ce finch/gntlog.c --- a/finch/gntlog.c Wed Jun 04 05:13:07 2008 +0000 +++ b/finch/gntlog.c Mon Jun 09 04:17:31 2008 +0000 @@ -61,8 +61,12 @@ if (viewer->contact != NULL) return g_direct_hash(viewer->contact); - return g_str_hash(viewer->screenname) + - g_str_hash(purple_account_get_username(viewer->account)); + if (viewer->account) { + return g_str_hash(viewer->screenname) + + g_str_hash(purple_account_get_username(viewer->account)); + } + + return (guint)viewer; } static gboolean log_viewer_equal(gconstpointer y, gconstpointer z) @@ -84,10 +88,14 @@ return FALSE; } - normal = g_strdup(purple_normalize(a->account, a->screenname)); - ret = (a->account == b->account) && - !strcmp(normal, purple_normalize(b->account, b->screenname)); - g_free(normal); + if (a->screenname && b->screenname) { + normal = g_strdup(purple_normalize(a->account, a->screenname)); + ret = (a->account == b->account) && + !strcmp(normal, purple_normalize(b->account, b->screenname)); + g_free(normal); + } else { + ret = (a == b); + } return ret; } @@ -348,14 +356,28 @@ return lv; } -void finch_log_show(PurpleLogType type, const char *screenname, PurpleAccount *account) { +static void +our_logging_blows(PurpleLogSet *set, PurpleLogSet *setagain, GList **list) +{ + /* The iteration happens on the first list. So we use the shorter list in front */ + if (set->type != PURPLE_LOG_IM) + return; + *list = g_list_concat(purple_log_get_logs(PURPLE_LOG_IM, set->name, set->account), *list); +} + +void finch_log_show(PurpleLogType type, const char *screenname, PurpleAccount *account) +{ struct log_viewer_hash_t *ht; FinchLogViewer *lv = NULL; const char *name = screenname; char *title; + GList *logs = NULL; + int size = 0; - g_return_if_fail(account != NULL); - g_return_if_fail(screenname != NULL); + if (type != PURPLE_LOG_IM) { + g_return_if_fail(account != NULL); + g_return_if_fail(screenname != NULL); + } ht = g_new0(struct log_viewer_hash_t, 1); @@ -383,20 +405,35 @@ } else { PurpleBuddy *buddy; - buddy = purple_find_buddy(account, screenname); - if (buddy != NULL) - name = purple_buddy_get_contact_alias(buddy); - - title = g_strdup_printf(_("Conversations with %s"), name); + if (screenname) { + buddy = purple_find_buddy(account, screenname); + if (buddy != NULL) + name = purple_buddy_get_contact_alias(buddy); + title = g_strdup_printf(_("Conversations with %s"), name); + } else { + title = g_strdup(_("All Conversations")); + } } - display_log_viewer(ht, purple_log_get_logs(type, screenname, account), - title, purple_log_get_total_size(type, screenname, account)); + if (screenname) { + logs = purple_log_get_logs(type, screenname, account); + size = purple_log_get_total_size(type, screenname, account); + } else { + /* This will happen only for IMs */ + GHashTable *table = purple_log_get_log_sets(); + g_hash_table_foreach(table, (GHFunc)our_logging_blows, &logs); + g_hash_table_destroy(table); + logs = g_list_sort(logs, purple_log_compare); + size = 0; + } + + display_log_viewer(ht, logs, title, size); g_free(title); } -void finch_log_show_contact(PurpleContact *contact) { +void finch_log_show_contact(PurpleContact *contact) +{ struct log_viewer_hash_t *ht; PurpleBlistNode *child; FinchLogViewer *lv = NULL; diff -r d201287d3a0e -r 81ebe4fac9ce finch/libgnt/gntcolors.c --- a/finch/libgnt/gntcolors.c Wed Jun 04 05:13:07 2008 +0000 +++ b/finch/libgnt/gntcolors.c Mon Jun 09 04:17:31 2008 +0000 @@ -29,6 +29,7 @@ #include +#include #include #include @@ -168,7 +169,7 @@ color = -1; else { g_warning("Invalid color name: %s\n", key); - color = -1; + color = -EINVAL; } return color; } diff -r d201287d3a0e -r 81ebe4fac9ce finch/libgnt/gntcolors.h --- a/finch/libgnt/gntcolors.h Wed Jun 04 05:13:07 2008 +0000 +++ b/finch/libgnt/gntcolors.h Mon Jun 09 04:17:31 2008 +0000 @@ -91,7 +91,7 @@ * * @param kfile The string value * - * @return A color + * @return A color. For an unknown color name, returns -EINVAL. * * @since 2.4.0 */ diff -r d201287d3a0e -r 81ebe4fac9ce finch/libgnt/gntentry.c --- a/finch/libgnt/gntentry.c Wed Jun 04 05:13:07 2008 +0000 +++ b/finch/libgnt/gntentry.c Mon Jun 09 04:17:31 2008 +0000 @@ -580,11 +580,13 @@ while (text && text < end && g_unichar_isspace(g_utf8_get_char(text))) text = g_utf8_find_next_char(text, end); - ch = g_utf8_get_char(text); - while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) { - gunichar cur = g_utf8_get_char(text); - if (!SAME(ch, cur)) - break; + if (text) { + ch = g_utf8_get_char(text); + while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) { + gunichar cur = g_utf8_get_char(text); + if (!SAME(ch, cur)) + break; + } } return (text ? text : end); } diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/Makefile.am --- a/libpurple/Makefile.am Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/Makefile.am Mon Jun 09 04:17:31 2008 +0000 @@ -261,3 +261,9 @@ $(DBUS_CFLAGS) \ $(LIBXML_CFLAGS) \ $(NETWORKMANAGER_CFLAGS) + +# INSTALL_SSL_CERTIFICATES is true when SSL_CERTIFICATES_DIR is empty. +# We want to use SSL_CERTIFICATES_DIR when it's not empty. +if ! INSTALL_SSL_CERTIFICATES +AM_CPPFLAGS += -DSSL_CERTIFICATES_DIR=\"$(SSL_CERTIFICATES_DIR)\" +endif diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/certificate.c --- a/libpurple/certificate.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/certificate.c Mon Jun 09 04:17:31 2008 +0000 @@ -745,8 +745,12 @@ x509_ca_paths = g_list_append(NULL, g_build_filename(DATADIR, "ca-certs", NULL)); #else +# ifdef SSL_CERTIFICATES_DIR + x509_ca_paths = g_list_append(NULL, SSL_CERTIFICATES_DIR); +# else x509_ca_paths = g_list_append(NULL, g_build_filename(DATADIR, "purple", "ca-certs", NULL)); +# endif #endif } @@ -787,8 +791,7 @@ for (cur = lst; cur; cur = cur->next) { x509_ca_element *el = cur->data; - /* TODO: Unsafe? */ - if ( !strcmp(dn, el->dn) ) { + if (el->dn && !strcmp(dn, el->dn)) { return el; } } diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/conversation.c --- a/libpurple/conversation.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/conversation.c Mon Jun 09 04:17:31 2008 +0000 @@ -98,7 +98,7 @@ char *displayed = NULL, *sent = NULL; int err = 0; - if (strlen(message) == 0) + if (*message == '\0') return; account = purple_conversation_get_account(conv); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/log.c --- a/libpurple/log.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/log.c Mon Jun 09 04:17:31 2008 +0000 @@ -1067,7 +1067,7 @@ set->normalized_name = g_strdup(purple_normalize(account, name)); /* Chat for .chat or .system at the end of the name to determine the type. */ - if (len > 7) { + if (len >= 7) { gchar *tmp = &name[len - 7]; if (!strcmp(tmp, ".system")) { set->type = PURPLE_LOG_SYSTEM; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/plugins/perl/perl-handlers.c --- a/libpurple/plugins/perl/perl-handlers.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/plugins/perl/perl-handlers.c Mon Jun 09 04:17:31 2008 +0000 @@ -383,6 +383,9 @@ case PURPLE_TYPE_BOXED: *((void **)copy_args[i]) = (void *)SvIV(sv_args[i]); break; + case PURPLE_TYPE_SUBTYPE: + *((void **)copy_args[i]) = purple_perl_ref_object(sv_args[i]); + break; default: break; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/irc/msgs.c --- a/libpurple/protocols/irc/msgs.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/irc/msgs.c Mon Jun 09 04:17:31 2008 +0000 @@ -122,7 +122,11 @@ void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args) { - purple_debug(PURPLE_DEBUG_INFO, "irc", "Unrecognized message: %s\n", args[0]); + char *clean; + /* This, too, should be escaped somehow (smarter) */ + clean = purple_utf8_salvage(args[0]); + purple_debug(PURPLE_DEBUG_INFO, "irc", "Unrecognized message: %s\n", clean); + g_free(clean); } void irc_msg_features(struct irc_conn *irc, const char *name, const char *from, char **args) @@ -211,7 +215,9 @@ /* This is an extended syntax, not in RFC 1459 */ int t1 = atoi(args[4]); time_t t2 = time(NULL); - msg = g_strdup_printf(_("Ban on %s by %s, set %ld seconds ago"), + msg = g_strdup_printf(ngettext("Ban on %s by %s, set %ld second ago", + "Ban on %s by %s, set %ld seconds ago", + t2 - t1), args[2], args[3], t2 - t1); } else { msg = g_strdup_printf(_("Ban on %s"), args[2]); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/irc/parse.c --- a/libpurple/protocols/irc/parse.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/irc/parse.c Mon Jun 09 04:17:31 2008 +0000 @@ -911,5 +911,10 @@ static void irc_parse_error_cb(struct irc_conn *irc, char *input) { - purple_debug(PURPLE_DEBUG_WARNING, "irc", "Unrecognized string: %s\n", input); + char *clean; + /* This really should be escaped somehow that you can tell what + * the junk was -- but as it is, it can crash glib. */ + clean = purple_utf8_salvage(input); + purple_debug(PURPLE_DEBUG_WARNING, "irc", "Unrecognized string: %s\n", clean); + g_free(clean); } diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/jabber/jabber.c Mon Jun 09 04:17:31 2008 +0000 @@ -629,7 +629,7 @@ js->write_buffer = purple_circ_buffer_new(512); js->old_length = 0; js->keepalive_timeout = -1; - js->certificate_CN = g_strdup(connect_server[0] ? connect_server : js->user->domain); + js->certificate_CN = g_strdup(connect_server[0] ? connect_server : js->user ? js->user->domain : NULL); if(!js->user) { purple_connection_error_reason (gc, diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/jabber/si.c --- a/libpurple/protocols/jabber/si.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/jabber/si.c Mon Jun 09 04:17:31 2008 +0000 @@ -65,6 +65,7 @@ char *rxqueue; size_t rxlen; gsize rxmaxlen; + int local_streamhost_fd; } JabberSIXfer; static PurpleXfer* @@ -349,7 +350,11 @@ g_free(jsx->rxqueue); jsx->rxqueue = NULL; - purple_xfer_start(xfer, source, NULL, -1); + /* Before actually starting sending the file, we need to wait until the + * recipient sends the IQ result with + */ + purple_debug_info("jabber", "SOCKS5 connection negotiation completed. " + "Waiting for IQ result to start file transfer.\n"); } static void @@ -610,6 +615,7 @@ PurpleInputCondition cond) { PurpleXfer *xfer = data; + JabberSIXfer *jsx = xfer->data; int acceptfd; purple_debug_info("jabber", "in jabber_si_xfer_bytestreams_send_connected_cb\n"); @@ -625,6 +631,7 @@ purple_input_remove(xfer->watcher); close(source); + jsx->local_streamhost_fd = -1; xfer->watcher = purple_input_add(acceptfd, PURPLE_INPUT_READ, jabber_si_xfer_bytestreams_send_read_cb, xfer); @@ -635,17 +642,25 @@ gpointer data) { PurpleXfer *xfer = data; - JabberSIXfer *jsx = xfer->data; + JabberSIXfer *jsx; xmlnode *query, *streamhost_used; const char *from, *type, *jid; GList *matched; /* TODO: This need to send errors if we don't see what we're looking for */ + /* Make sure that the xfer is actually still valid and we're not just receiving an old iq response */ + if (!g_list_find(js->file_transfers, xfer)) { + purple_debug_error("jabber", "Got bytestreams response for no longer existing xfer (%p)\n", xfer); + return; + } + /* In the case of a direct file transfer, this is expected to return */ - if(!jsx) + if(!xfer->data) return; + jsx = xfer->data; + if(!(type = xmlnode_get_attrib(packet, "type")) || strcmp(type, "result")) return; @@ -661,22 +676,33 @@ if(!(jid = xmlnode_get_attrib(streamhost_used, "jid"))) return; - purple_debug_info("jabber", "jabber_si_connect_proxy_cb() will be looking at jsx %p: jsx->streamhosts is %p and jid is %p", + purple_debug_info("jabber", "jabber_si_connect_proxy_cb() will be looking at jsx %p: jsx->streamhosts is %p and jid is %s\n", jsx, jsx->streamhosts, jid); if(!(matched = g_list_find_custom(jsx->streamhosts, jid, jabber_si_compare_jid))) { gchar *my_jid = g_strdup_printf("%s@%s/%s", jsx->js->user->node, jsx->js->user->domain, jsx->js->user->resource); - if (!strcmp(jid, my_jid)) + if (!strcmp(jid, my_jid)) { purple_debug_info("jabber", "Got local SOCKS5 streamhost-used.\n"); - else + purple_xfer_start(xfer, xfer->fd, NULL, -1); + } else { purple_debug_info("jabber", "streamhost-used does not match any proxy that was offered to target\n"); + purple_xfer_cancel_local(xfer); + } g_free(my_jid); return; } - /* TODO: Clean up the local SOCKS5 proxy - it isn't going to be used.*/ + /* Clean up the local streamhost - it isn't going to be used.*/ + if (xfer->watcher > 0) { + purple_input_remove(xfer->watcher); + xfer->watcher = 0; + } + if (jsx->local_streamhost_fd >= 0) { + close(jsx->local_streamhost_fd); + jsx->local_streamhost_fd = -1; + } jsx->streamhosts = g_list_remove_link(jsx->streamhosts, matched); g_list_foreach(jsx->streamhosts, jabber_si_free_streamhost, NULL); @@ -714,6 +740,8 @@ return; } + jsx->local_streamhost_fd = sock; + iq = jabber_iq_new_query(jsx->js, JABBER_IQ_SET, "http://jabber.org/protocol/bytestreams"); xmlnode_set_attrib(iq->node, "to", xfer->who); @@ -967,7 +995,8 @@ purple_network_listen_cancel(jsx->listen_data); if (jsx->iq_id != NULL) jabber_iq_remove_callback_by_id(js, jsx->iq_id); - + if (jsx->local_streamhost_fd >= 0) + close(jsx->local_streamhost_fd); if (jsx->connect_timeout > 0) purple_timeout_remove(jsx->connect_timeout); @@ -1175,6 +1204,7 @@ { xfer->data = jsx = g_new0(JabberSIXfer, 1); jsx->js = js; + jsx->local_streamhost_fd = -1; purple_xfer_set_init_fnc(xfer, jabber_si_xfer_init); purple_xfer_set_cancel_send_fnc(xfer, jabber_si_xfer_cancel_send); @@ -1248,6 +1278,7 @@ return; jsx = g_new0(JabberSIXfer, 1); + jsx->local_streamhost_fd = -1; for(field = xmlnode_get_child(x, "field"); field; field = xmlnode_get_next_twin(field)) { const char *var = xmlnode_get_attrib(field, "var"); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/contact.c --- a/libpurple/protocols/msn/contact.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/contact.c Mon Jun 09 04:17:31 2008 +0000 @@ -1,5 +1,5 @@ /** - * @file contact.c + * @file contact.c * get MSN contacts via SOAP request * created by MaYuan * @@ -80,7 +80,7 @@ state->session = session; return state; -} +} void msn_callback_state_free(MsnCallbackState *state) @@ -217,7 +217,7 @@ g_return_if_fail(contact->session != NULL); g_return_if_fail(contact->session->user != NULL); g_return_if_fail(contact->session->user->passport != NULL); - + purple_debug_info("msnab","Creating an Address Book.\n"); body = g_strdup_printf(MSN_ADD_ADDRESSBOOK_TEMPLATE, contact->session->user->passport); @@ -247,7 +247,7 @@ user->membership_id[list] = atoi(member_id); } - msn_got_lst_user(session, user, 1 << list, NULL); + msn_got_lst_user(session, user, 1 << list, NULL); g_free(passport); g_free(type); @@ -269,7 +269,7 @@ char *lastchange_str = xmlnode_get_data(lastchange); xmlnode *membership; - purple_debug_info("msncl","last change: %s\n", lastchange_str); + purple_debug_info("msncl","last change: %s\n", lastchange_str); purple_account_set_string(session->account, "CLLastChange", lastchange_str); @@ -480,7 +480,7 @@ if (phone_type && !strcmp(phone_type, "ContactPhoneMobile")) { xmlnode *number; - + if ((number = xmlnode_get_child(contact_phone, "number"))) { xmlnode *messenger_enabled; char *is_messenger_enabled = NULL; @@ -489,8 +489,8 @@ mobile_number = xmlnode_get_data(number); if (mobile_number && - (messenger_enabled = xmlnode_get_child(contact_phone, "isMessengerEnabled")) - && (is_messenger_enabled = xmlnode_get_data(messenger_enabled)) + (messenger_enabled = xmlnode_get_child(contact_phone, "isMessengerEnabled")) + && (is_messenger_enabled = xmlnode_get_data(messenger_enabled)) && !strcmp(is_messenger_enabled, "true")) mobile = TRUE; @@ -679,7 +679,7 @@ gchar *errorcode = xmlnode_get_data(faultnode); purple_debug_info("MSNAB", "Error Code: %s\n", errorcode); - + if (g_str_equal(errorcode, "ABDoesNotExist")) { g_free(errorcode); return TRUE; @@ -823,7 +823,7 @@ if (resp != NULL) { MsnUserList *userlist = session->userlist; MsnUser *user; - + purple_debug_info("MSNCL","Contact added successfully\n"); // the code this block is replacing didn't send ADL for yahoo contacts, @@ -921,7 +921,7 @@ } void -msn_add_contact_to_group(MsnContact *contact, MsnCallbackState *state, +msn_add_contact_to_group(MsnContact *contact, MsnCallbackState *state, const char *passport, const char *groupId) { MsnUserList *userlist; @@ -934,11 +934,11 @@ g_return_if_fail(contact != NULL); g_return_if_fail(contact->session != NULL); g_return_if_fail(contact->session->userlist != NULL); - + userlist = contact->session->userlist; if (!strcmp(groupId, MSN_INDIVIDUALS_GROUP_ID) || !strcmp(groupId, MSN_NON_IM_GROUP_ID)) { - + user = msn_userlist_find_add_user(userlist, passport, passport); if (state->action & MSN_ADD_BUDDY) { @@ -956,13 +956,13 @@ return; } - purple_debug_info("MSNCL", "Adding user %s to group %s\n", passport, + purple_debug_info("MSNCL", "Adding user %s to group %s\n", passport, msn_userlist_find_group_name(userlist, groupId)); user = msn_userlist_find_user(userlist, passport); if (user == NULL) { purple_debug_warning("MSNCL", "Unable to retrieve user %s from the userlist!\n", passport); - msn_callback_state_free(state); + msn_callback_state_free(state); return; /* guess this never happened! */ } @@ -1007,7 +1007,7 @@ /*delete a Contact*/ void msn_delete_contact(MsnContact *contact, const char *contactId) -{ +{ gchar *body = NULL; gchar *contact_id_xml = NULL ; MsnCallbackState *state; @@ -1045,7 +1045,7 @@ purple_debug_info("MSNCL", "Contact %s deleted successfully from group %s in the server, but failed in the local list\n", state->who, state->old_group_name); } } - + msn_callback_state_free(state); } @@ -1057,15 +1057,15 @@ MsnCallbackState *state; gchar *body, *contact_id_xml; const gchar *groupId; - + g_return_if_fail(passport != NULL); g_return_if_fail(group_name != NULL); g_return_if_fail(contact != NULL); g_return_if_fail(contact->session != NULL); g_return_if_fail(contact->session->userlist != NULL); - + userlist = contact->session->userlist; - + groupId = msn_userlist_find_group_id(userlist, group_name); if (groupId != NULL) { purple_debug_info("MSNCL", "Deleting user %s from group %s\n", passport, group_name); @@ -1073,9 +1073,9 @@ purple_debug_warning("MSNCL", "Unable to retrieve group id from group %s !\n", group_name); return; } - + user = msn_userlist_find_user(userlist, passport); - + if (user == NULL) { purple_debug_warning("MSNCL", "Unable to retrieve user from passport %s!\n", passport); return; @@ -1099,7 +1099,7 @@ xmlnode_from_str(body, -1)), MSN_CONTACT_SERVER, MSN_ADDRESS_BOOK_POST_URL, msn_del_contact_from_group_read_cb, state); - + g_free(contact_id_xml); g_free(body); } @@ -1198,7 +1198,7 @@ } else { /* list == MSN_LIST_AL || list == MSN_LIST_BL */ partner_scenario = MSN_PS_BLOCK_UNBLOCK; - + member = g_strdup_printf(MSN_MEMBER_PASSPORT_XML, passport); } @@ -1226,13 +1226,13 @@ g_return_if_fail(state != NULL); g_return_if_fail(state->session != NULL); g_return_if_fail(state->session->contact != NULL); - + if (resp != NULL) { purple_debug_info("MSN CL", "Contact %s added successfully to %s list on server!\n", state->who, MsnMemberRole[state->list_id]); if (state->list_id == MSN_LIST_RL) { MsnUser *user = msn_userlist_find_user(state->session->userlist, state->who); - + if (user != NULL) { msn_user_set_op(user, MSN_LIST_RL_OP); } @@ -1274,9 +1274,9 @@ member = g_strdup_printf(MSN_MEMBER_PASSPORT_XML, state->who); - body = g_strdup_printf(MSN_CONTACT_ADD_TO_LIST_TEMPLATE, + body = g_strdup_printf(MSN_CONTACT_ADD_TO_LIST_TEMPLATE, MsnSoapPartnerScenarioText[partner_scenario], - MsnMemberRole[list], + MsnMemberRole[list], member); msn_soap_message_send(contact->session, @@ -1323,9 +1323,9 @@ msn_group_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, gpointer data) { MsnCallbackState *state = data; - + purple_debug_info("MSNCL", "Group request successful.\n"); - + g_return_if_fail(state->session != NULL); g_return_if_fail(state->session->userlist != NULL); g_return_if_fail(state->session->contact != NULL); @@ -1338,13 +1338,13 @@ if (state) { MsnSession *session = state->session; MsnUserList *userlist = session->userlist; - + if (state->action & MSN_RENAME_GROUP) { msn_userlist_rename_group_id(session->userlist, state->guid, state->new_group_name); } - + if (state->action & MSN_ADD_GROUP) { /* the response is taken from http://telepathy.freedesktop.org/wiki/Pymsn/MSNP/ContactListActions @@ -1364,7 +1364,7 @@ state->who, state->new_group_name); } else if (state->action & MSN_MOVE_BUDDY) { - msn_add_contact_to_group(session->contact, state, state->who, guid); + msn_add_contact_to_group(session->contact, state, state->who, guid); g_free(guid); return; } @@ -1374,16 +1374,16 @@ state->new_group_name); } } - + if (state->action & MSN_DEL_GROUP) { GList *l; - + msn_userlist_remove_group_id(session->userlist, state->guid); for (l = userlist->users; l != NULL; l = l->next) { msn_user_remove_group_id( (MsnUser *)l->data, state->guid); } } - + msn_callback_state_free(state); } } @@ -1396,7 +1396,7 @@ g_return_if_fail(session != NULL); g_return_if_fail(group_name != NULL); - + purple_debug_info("MSNCL","Adding group %s to contact list.\n", group_name); if (state == NULL) { @@ -1429,13 +1429,13 @@ const gchar *guid; g_return_if_fail(session != NULL); - + g_return_if_fail(group_name != NULL); purple_debug_info("MSNCL","Deleting group %s from contact list\n", group_name); - + guid = msn_userlist_find_group_id(session->userlist, group_name); - - /* if group uid we need to del is NULL, + + /* if group uid we need to del is NULL, * we need to delete nothing */ if (guid == NULL) { @@ -1451,7 +1451,7 @@ state = msn_callback_state_new(session); msn_callback_state_set_action(state, MSN_DEL_GROUP); msn_callback_state_set_guid(state, guid); - + body = g_strdup_printf(MSN_GROUP_DEL_TEMPLATE, guid); msn_soap_message_send(session, @@ -1470,14 +1470,14 @@ gchar *body = NULL; const gchar * guid; MsnCallbackState *state; - + g_return_if_fail(session != NULL); g_return_if_fail(session->userlist != NULL); g_return_if_fail(old_group_name != NULL); g_return_if_fail(new_group_name != NULL); - + purple_debug_info("MSN CL", "Renaming group %s to %s.\n", old_group_name, new_group_name); - + guid = msn_userlist_find_group_id(session->userlist, old_group_name); if (guid == NULL) return; @@ -1492,10 +1492,10 @@ } msn_callback_state_set_action(state, MSN_RENAME_GROUP); - + body = g_markup_printf_escaped(MSN_GROUP_RENAME_TEMPLATE, guid, new_group_name); - + msn_soap_message_send(session, msn_soap_message_new(MSN_GROUP_RENAME_SOAP_ACTION, xmlnode_from_str(body, -1)), diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/contact.h --- a/libpurple/protocols/msn/contact.h Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/contact.h Mon Jun 09 04:17:31 2008 +0000 @@ -349,7 +349,7 @@ #define MSN_GROUP_RENAME_SOAP_ACTION "http://www.msn.com/webservices/AddressBook/ABGroupUpdate" #define MSN_GROUP_RENAME_TEMPLATE "09607671-1C32-421F-A6A6-CBFAA51AB5F4falseTimerfalse00000000-0000-0000-0000-000000000000%s%sGroupName " -typedef enum +typedef enum { MSN_ADD_BUDDY = 0x01, MSN_MOVE_BUDDY = 0x02, @@ -383,7 +383,7 @@ MsnSession *session; }; -typedef enum +typedef enum { MSN_PS_INITIAL, MSN_PS_SAVE_CONTACT, @@ -404,34 +404,34 @@ void msn_callback_state_set_uid(MsnCallbackState *state, const gchar *uid); void msn_callback_state_set_old_group_name(MsnCallbackState *state, const gchar *old_group_name); -void msn_callback_state_set_new_group_name(MsnCallbackState *state, +void msn_callback_state_set_new_group_name(MsnCallbackState *state, const gchar *new_group_name); void msn_callback_state_set_guid(MsnCallbackState *state, const gchar *guid); void msn_callback_state_set_list_id(MsnCallbackState *state, MsnListId list_id); -void msn_callback_state_set_action(MsnCallbackState *state, +void msn_callback_state_set_action(MsnCallbackState *state, MsnCallbackAction action); void msn_contact_connect(MsnContact *contact); -void msn_get_contact_list(MsnContact * contact, +void msn_get_contact_list(MsnContact * contact, const MsnSoapPartnerScenario partner_scenario, const char *update); -void msn_get_address_book(MsnContact *contact, +void msn_get_address_book(MsnContact *contact, const MsnSoapPartnerScenario partner_scenario, const char * update, const char * gupdate); /* contact SOAP operations */ void msn_update_contact(MsnContact *contact, const char* nickname); -void msn_add_contact(MsnContact *contact, MsnCallbackState *state, +void msn_add_contact(MsnContact *contact, MsnCallbackState *state, const char *passport); void msn_delete_contact(MsnContact *contact, const char *contactId); -void msn_add_contact_to_group(MsnContact *contact, MsnCallbackState *state, +void msn_add_contact_to_group(MsnContact *contact, MsnCallbackState *state, const char *passport, const char *groupId); -void msn_del_contact_from_group(MsnContact *contact, const char *passport, +void msn_del_contact_from_group(MsnContact *contact, const char *passport, const char *group_name); /* group operations */ -void msn_add_group(MsnSession *session, MsnCallbackState *state, +void msn_add_group(MsnSession *session, MsnCallbackState *state, const char* group_name); void msn_del_group(MsnSession *session, const gchar *group_name); void msn_contact_rename_group(MsnSession *session, const char *old_group_name, diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/dialog.c --- a/libpurple/protocols/msn/dialog.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/dialog.c Mon Jun 09 04:17:31 2008 +0000 @@ -135,7 +135,7 @@ passport); } - purple_request_action(gc, NULL, msg, reason, PURPLE_DEFAULT_ACTION_NONE, + purple_request_action(gc, NULL, msg, reason, PURPLE_DEFAULT_ACTION_NONE, purple_connection_get_account(gc), data->who, NULL, data, 2, _("Yes"), G_CALLBACK(msn_add_cb), diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/error.c --- a/libpurple/protocols/msn/error.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/error.c Mon Jun 09 04:17:31 2008 +0000 @@ -259,7 +259,7 @@ { char buf[MSN_BUF_LEN]; gboolean debug; - + g_snprintf(buf, sizeof(buf), _("MSN Error: %s\n"), msn_error_get_text(type, &debug)); if (debug) diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/msn.c Mon Jun 09 04:17:31 2008 +0000 @@ -1618,10 +1618,10 @@ MsnSession *session; session = gc->proto_data; - + g_return_if_fail(session != NULL); g_return_if_fail(session->userlist != NULL); - + if (msn_userlist_find_group_with_name(session->userlist, old_name) != NULL) { msn_contact_rename_group(session, old_name, group->name); @@ -1701,7 +1701,7 @@ purple_debug_info("MSN", "This group can't be removed, returning.\n"); return ; } - + msn_del_group(session, group->name); } diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/msnutils.c --- a/libpurple/protocols/msn/msnutils.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/msnutils.c Mon Jun 09 04:17:31 2008 +0000 @@ -169,7 +169,7 @@ gchar *base64, *retval; g_return_val_if_fail(str != NULL, NULL); - + base64 = purple_base64_encode((guchar *)str, strlen(str)); retval = g_strdup_printf("=?utf-8?B?%s?=", base64); g_free(base64); @@ -509,7 +509,7 @@ *This algorithm reference with http://msnpiki.msnfanatic.com/index.php/MSNP11:Challenges */ #define BUFSIZE 256 -void +void msn_handle_chl(char *input, char *output) { PurpleCipher *cipher; @@ -538,7 +538,7 @@ /* Split it into four integers */ md5Parts = (unsigned int *)md5Hash; - for(i=0; i<4; i++){ + for(i=0; i<4; i++){ /* adjust endianess */ md5Parts[i] = GUINT_TO_LE(md5Parts[i]); @@ -578,7 +578,7 @@ /* adjust endianness */ for(i=0; i<4; i++) - newHashParts[i] = GUINT_TO_LE(newHashParts[i]); + newHashParts[i] = GUINT_TO_LE(newHashParts[i]); /* make a string of the parts */ newHash = (unsigned char *)newHashParts; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/notification.c --- a/libpurple/protocols/msn/notification.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/notification.c Mon Jun 09 04:17:31 2008 +0000 @@ -34,15 +34,6 @@ static MsnTable *cbs_table; -/**************************************************************************** - * Local Function Prototype - ****************************************************************************/ - -static void msn_notification_post_adl(MsnCmdProc *cmdproc, const char *payload, int payload_len); -static void -msn_add_contact_xml(MsnSession *session, xmlnode *mlNode,const char *passport, - MsnListOp list_op, MsnUserType type); - /************************************************************************** * Main **************************************************************************/ @@ -336,7 +327,7 @@ } /* - * Windows Live Messenger 8.0 + * Windows Live Messenger 8.0 * Notice :CVR String discriminate! * reference of http://www.microsoft.com/globaldev/reference/oslocversion.mspx * to see the Local ID @@ -430,7 +421,7 @@ char *payload; gsize payload_len; int type; - + cmdproc = session->notification->cmdproc; g_return_if_fail(msg != NULL); payload = msn_message_gen_payload(msg, &payload_len); @@ -649,7 +640,7 @@ { MsnTransaction *trans; purple_debug_info("MSN Notification","Sending ADL with payload: %s\n", payload); - trans = msn_transaction_new(cmdproc, "ADL","%" G_GSIZE_FORMAT, payload_len); + trans = msn_transaction_new(cmdproc, "ADL", "%i", payload_len); msn_transaction_set_payload(trans, payload, payload_len); msn_cmdproc_send_trans(cmdproc, trans); } @@ -709,8 +700,8 @@ } display_name = purple_connection_get_display_name(session->account->gc); - if (display_name - && strcmp(display_name, + if (display_name + && strcmp(display_name, purple_account_get_username(session->account))) { msn_act_id(session->account->gc, display_name); } @@ -755,15 +746,15 @@ purple_debug_misc("MSN Notification", "Parsing received ADL XML data\n"); g_return_if_fail(payload != NULL); - + root = xmlnode_from_str(payload, (gssize) len); - + if (root == NULL) { purple_debug_info("MSN Notification", "Invalid XML!\n"); return; } for (domain_node = xmlnode_get_child(root, "d"); domain_node; domain_node = xmlnode_get_next_twin(domain_node)) { - const gchar * domain = NULL; + const gchar * domain = NULL; xmlnode *contact_node = NULL; domain = xmlnode_get_attrib(domain_node, "n"); @@ -1300,7 +1291,7 @@ type = cmd->params[1]; if (!strcmp(type, "MFN")) { friendlyname = purple_url_decode(cmd->params[2]); - + msn_update_contact(session->contact, friendlyname); purple_connection_set_display_name( @@ -1649,12 +1640,12 @@ purple_debug_error("MSN","Unable to parse GCF payload into a XML tree"); return; } - + buf = xmlnode_to_formatted_str(root, &xmllen); /* get the payload content */ purple_debug_info("MSNP14","GCF command payload:\n%.*s\n", xmllen, buf); - + g_free(buf); xmlnode_free(root); } @@ -1698,7 +1689,7 @@ passport = cmd->params[0]; user = msn_userlist_find_user(session->userlist, passport); - + psm_str = msn_get_psm(cmd->payload,len); msn_user_set_statusline(user, psm_str); g_free(psm_str); @@ -2005,7 +1996,7 @@ { case 1: minutes = atoi(g_hash_table_lookup(table, "Arg1")); - g_snprintf(buf, sizeof(buf), dngettext(PACKAGE, + g_snprintf(buf, sizeof(buf), dngettext(PACKAGE, "The MSN server will shut down for maintenance " "in %d minute. You will automatically be " "signed out at that time. Please finish any " @@ -2032,7 +2023,7 @@ void msn_notification_add_buddy_to_list(MsnNotification *notification, MsnListId list_id, - const char *who) + const char *who) { MsnCmdProc *cmdproc; MsnListOp list_op = 1 << list_id; @@ -2045,12 +2036,12 @@ adl_node = xmlnode_new("ml"); adl_node->child = NULL; - msn_add_contact_xml(notification->session, adl_node, who, list_op, + msn_add_contact_xml(notification->session, adl_node, who, list_op, MSN_USER_TYPE_PASSPORT); payload = xmlnode_to_str(adl_node,&payload_len); xmlnode_free(adl_node); - + msn_notification_post_adl(notification->servconn->cmdproc, payload,payload_len); g_free(payload); @@ -2155,11 +2146,11 @@ /*initial OIM notification*/ msn_table_add_msg_type(cbs_table, "text/x-msmsgsinitialmdatanotification", - initial_mdata_msg); + initial_mdata_msg); /*OIM notification when user online*/ msn_table_add_msg_type(cbs_table, "text/x-msmsgsoimnotification", - initial_mdata_msg); + initial_mdata_msg); msn_table_add_msg_type(cbs_table, "text/x-msmsgsinitialemailnotification", initial_email_msg); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/notification.h --- a/libpurple/protocols/msn/notification.h Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/notification.h Mon Jun 09 04:17:31 2008 +0000 @@ -30,7 +30,7 @@ #define MSNP13_WLM_PRODUCT_ID "PROD01065C%ZFN6F" #define MSNP10_PRODUCT_KEY "VT6PX?UQTM4WM%YR" -#define MSNP10_PRODUCT_ID "PROD0038W!61ZTF9" +#define MSNP10_PRODUCT_ID "PROD0038W!61ZTF9" typedef struct _MsnNotification MsnNotification; @@ -71,7 +71,7 @@ * Closes a notification. * * It's first closed, and then disconnected. - * + * * @param notification The notification object to close. */ void msn_notification_close(MsnNotification *notification); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/object.c --- a/libpurple/protocols/msn/object.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/object.c Mon Jun 09 04:17:31 2008 +0000 @@ -172,7 +172,7 @@ base64 = purple_base64_encode(digest, sizeof(digest)); msn_object_set_sha1c(msnobj, base64); g_free(base64); - + return msnobj; } diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/oim.c --- a/libpurple/protocols/msn/oim.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/oim.c Mon Jun 09 04:17:31 2008 +0000 @@ -1,5 +1,5 @@ /** - * @file oim.c + * @file oim.c * get and send MSN offline Instant Message via SOAP request * Author * MaYuan @@ -91,7 +91,7 @@ const char* to_member, const char *msg) { MsnOimSendReq *request; - + request = g_new0(MsnOimSendReq, 1); request->from_member = g_strdup(from_member); request->friendname = g_strdup(friendname); @@ -109,7 +109,7 @@ g_free(req->friendname); g_free(req->to_member); g_free(req->oim_msg); - + g_free(req); } @@ -121,10 +121,10 @@ msn_oim_msg_to_str(MsnOim *oim, const char *body) { char *oim_body,*oim_base64; - - purple_debug_info("MSN OIM","encode OIM Message...\n"); + + purple_debug_info("MSN OIM","encode OIM Message...\n"); oim_base64 = purple_base64_encode((const guchar *)body, strlen(body)); - purple_debug_info("MSN OIM","encoded base64 body:{%s}\n",oim_base64); + purple_debug_info("MSN OIM","encoded base64 body:{%s}\n",oim_base64); oim_body = g_strdup_printf(MSN_OIM_MSG_TEMPLATE, oim->run_id,oim->send_seq,oim_base64); g_free(oim_base64); @@ -213,7 +213,7 @@ } /*post send single message request to oim server*/ -void +void msn_oim_send_msg(MsnOim *oim) { MsnOimSendReq *oim_request; @@ -333,7 +333,7 @@ gboolean offset_positive = TRUE; int tzhrs; int tzmins; - + for (t.tm_mon = 0; months[t.tm_mon] != NULL && strcmp(months[t.tm_mon], month_str) != 0; t.tm_mon++); @@ -462,7 +462,7 @@ } } -/* parse the oim XML data +/* parse the oim XML data * and post it to the soap server to get the Offline Message * */ void diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/servconn.c --- a/libpurple/protocols/msn/servconn.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/servconn.c Mon Jun 09 04:17:31 2008 +0000 @@ -396,15 +396,15 @@ if (len <= 0) { switch (errno) { - case 0: + case 0: case EBADF: case EAGAIN: return; - + default: purple_debug_error("msn", "servconn read error," "len: %d, errno: %d, error: %s\n", len, errno, g_strerror(errno)); - msn_servconn_got_error(servconn, + msn_servconn_got_error(servconn, MSN_SERVCONN_ERROR_READ); return; } diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/slp.c --- a/libpurple/protocols/msn/slp.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/slp.c Mon Jun 09 04:17:31 2008 +0000 @@ -947,15 +947,15 @@ msn_release_buddy_icon_request_timeout(gpointer data) { MsnUserList *userlist = (MsnUserList *)data; - + /* Free one window slot */ - userlist->buddy_icon_window++; - + userlist->buddy_icon_window++; + /* Clear the tag for our former request timer */ userlist->buddy_icon_request_timer = 0; - + msn_release_buddy_icon_request(userlist); - + return FALSE; } @@ -1062,7 +1062,7 @@ } /* Wait BUDDY_ICON_DELAY ms before freeing our window slot and requesting the next icon. */ - userlist->buddy_icon_request_timer = purple_timeout_add(BUDDY_ICON_DELAY, + userlist->buddy_icon_request_timer = purple_timeout_add(BUDDY_ICON_DELAY, msn_release_buddy_icon_request_timeout, userlist); } diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/soap.c --- a/libpurple/protocols/msn/soap.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/soap.c Mon Jun 09 04:17:31 2008 +0000 @@ -1,5 +1,5 @@ /** - * @file soap.c + * @file soap.c * SOAP connection related process * Author * MaYuan @@ -107,7 +107,7 @@ /*ssl soap error callback*/ static void msn_soap_error_cb(PurpleSslConnection *gsc, PurpleSslErrorType error, void *data) -{ +{ MsnSoapConn * soapconn = data; g_return_if_fail(data != NULL); @@ -159,7 +159,7 @@ if (*handler > 0) { purple_input_remove(*handler); *handler = 0; - } + } #ifdef MSN_SOAP_DEBUG else { purple_debug_misc("MSN SOAP", "Handler inactive, not removing\n"); @@ -250,7 +250,7 @@ { gssize len, requested_len; char temp_buf[MSN_SOAP_READ_BUFF_SIZE]; - + if ( soapconn->need_to_read == 0 || soapconn->need_to_read > MSN_SOAP_READ_BUFF_SIZE) { requested_len = MSN_SOAP_READ_BUFF_SIZE; } @@ -264,7 +264,7 @@ len = read(soapconn->fd, temp_buf, requested_len); } - + if ( len <= 0 ) { switch (errno) { @@ -298,7 +298,7 @@ soapconn->read_len + len + 1); exit(EXIT_FAILURE); } - + } #if defined(MSN_SOAP_DEBUG) @@ -312,7 +312,7 @@ } /*read the whole SOAP server response*/ -static void +static void msn_soap_read_cb(gpointer data, gint source, PurpleInputCondition cond) { MsnSoapConn *soapconn = data; @@ -331,10 +331,10 @@ session = soapconn->session; g_return_if_fail(session != NULL); - + /*read the request header*/ len = msn_soap_read(soapconn); - + if ( len < 0 ) return; @@ -342,7 +342,7 @@ return; } - if ( (strstr(soapconn->read_buf, "HTTP/1.1 302") != NULL) + if ( (strstr(soapconn->read_buf, "HTTP/1.1 302") != NULL) || ( strstr(soapconn->read_buf, "HTTP/1.1 301") != NULL ) ) { /* Redirect. */ @@ -382,14 +382,14 @@ g_free(soapconn->login_host); soapconn->login_host = g_strdup(location); - + msn_soap_close_handler( &(soapconn->input_handler) ); msn_soap_close(soapconn); if (purple_ssl_connect(session->account, soapconn->login_host, PURPLE_SSL_DEFAULT_PORT, msn_soap_connect_cb, msn_soap_error_cb, soapconn) == NULL) { - + purple_debug_error("MSN SOAP", "Unable to connect to %s !\n", soapconn->login_host); // dispatch next request msn_soap_post(soapconn, NULL); @@ -429,7 +429,7 @@ g_free(soapconn->login_host); soapconn->login_host = g_strdup(location); - + msn_soap_close_handler( &(soapconn->input_handler) ); msn_soap_close(soapconn); @@ -489,7 +489,7 @@ } } } - + } else if (strstr(soapconn->read_buf, "HTTP/1.1 503 Service Unavailable")) { @@ -539,11 +539,11 @@ #if defined(MSN_SOAP_DEBUG) && !defined(_WIN32) node = xmlnode_from_str(soapconn->body, soapconn->body_len); - + if (node != NULL) { formattedxml = xmlnode_to_formatted_str(node, NULL); http_headers = g_strndup(soapconn->read_buf, soapconn->body - soapconn->read_buf); - + purple_debug_info("MSN SOAP","Data with XML payload received from the SOAP server:\n%s%s\n", http_headers, formattedxml); g_free(http_headers); g_free(formattedxml); @@ -572,22 +572,22 @@ if ( soapconn->read_cb != NULL ) { soapconn_is_valid = soapconn->read_cb(soapconn); } - + if (!soapconn_is_valid) { return; } /* dispatch next request in queue */ msn_soap_post(soapconn, NULL); - } + } return; } -void +void msn_soap_free_read_buf(MsnSoapConn *soapconn) { g_return_if_fail(soapconn != NULL); - + if (soapconn->read_buf) { g_free(soapconn->read_buf); } @@ -626,7 +626,7 @@ } total_len = strlen(soapconn->write_buf); - /* + /* * write the content to SSL server, */ len = purple_ssl_write(soapconn->gsc, @@ -690,7 +690,7 @@ soapconn->write_buf = write_buf; soapconn->written_len = 0; soapconn->written_cb = written_cb; - + msn_soap_free_read_buf(soapconn); /*clear the read buffer first*/ @@ -748,7 +748,7 @@ { g_return_if_fail(soapconn != NULL); g_return_if_fail(soapconn->soap_queue != NULL); - + if (soapconn->step == MSN_SOAP_CONNECTED || soapconn->step == MSN_SOAP_CONNECTED_IDLE) { @@ -868,7 +868,7 @@ else purple_debug_info("MSN SOAP","Failed to parse SOAP request being sent:\n%s\n", request_str); #endif - + /*free read buffer*/ // msn_soap_free_read_buf(soapconn); /*post it to server*/ diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/soap.h --- a/libpurple/protocols/msn/soap.h Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/soap.h Mon Jun 09 04:17:31 2008 +0000 @@ -66,7 +66,7 @@ char *soap_action; char *body; - + gpointer data_cb; MsnSoapReadCbFunction read_cb; MsnSoapWrittenCbFunction written_cb; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/soap2.c --- a/libpurple/protocols/msn/soap2.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/soap2.c Mon Jun 09 04:17:31 2008 +0000 @@ -82,6 +82,7 @@ static void msn_soap_request_destroy(MsnSoapRequest *req); static void msn_soap_connection_sanitize(MsnSoapConnection *conn, gboolean disconnect); +static void msn_soap_process(MsnSoapConnection *conn); static gboolean msn_soap_cleanup_each(gpointer key, gpointer value, gpointer data) @@ -264,45 +265,53 @@ msn_soap_read_cb(gpointer data, gint fd, PurpleInputCondition cond) { MsnSoapConnection *conn = data; - int count = 0, cnt; - char buf[8192]; - char *linebreak; - char *cursor; - gboolean handled = FALSE; + int count = 0, cnt, perrno; + /* This buffer needs to be larger than any packets received from + login.live.com or Adium will fail to receive the packet + (something weird with the login.live.com server). With NSS it works + fine, so I believe it's some bug with OS X */ + char buf[16 * 1024]; if (conn->message == NULL) { conn->message = msn_soap_message_new(NULL, NULL); } + if (conn->buf == NULL) { + conn->buf = g_string_new_len(buf, 0); + } + while ((cnt = purple_ssl_read(conn->ssl, buf, sizeof(buf))) > 0) { purple_debug_info("soap", "read %d bytes\n", cnt); count += cnt; - if (conn->buf == NULL) { - conn->buf = g_string_new_len(buf, cnt); - } else { - g_string_append_len(conn->buf, buf, cnt); - } + g_string_append_len(conn->buf, buf, cnt); } - if (cnt < 0) { - if (errno != EAGAIN) { - purple_debug_info("soap", "read: %s\n", g_strerror(errno)); + /* && count is necessary for Adium, on OS X the last read always + return an error, so we want to proceed anyway. See #5212 for + discussion on this and the above buffer size issues */ + if(cnt < 0 && errno == EAGAIN && count == 0) + return; + + // msn_soap_process could alter errno + perrno = errno; + msn_soap_process(conn); + + if (cnt < 0 && perrno != EAGAIN) { + purple_debug_info("soap", "read: %s\n", g_strerror(perrno)); + // It's possible msn_soap_process closed the ssl connection + if (conn->ssl) { purple_ssl_close(conn->ssl); conn->ssl = NULL; msn_soap_connection_handle_next(conn); - return; - } else if (count == 0) { - return; } } +} - if (cnt == 0 && count == 0) { - purple_debug_info("soap", "msn_soap_read_cb() called, but no data available?\n"); - purple_ssl_close(conn->ssl); - conn->ssl = NULL; - msn_soap_connection_handle_next(conn); - return; - } +static void +msn_soap_process(MsnSoapConnection *conn) { + gboolean handled = FALSE; + char *cursor; + char *linebreak; purple_debug_info("soap", "current %s\n", conn->buf->str); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/state.c --- a/libpurple/protocols/msn/state.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/state.c Mon Jun 09 04:17:31 2008 +0000 @@ -150,7 +150,7 @@ { xmlnode *payloadNode, *currentmediaNode; char *currentmedia; - + purple_debug_info("msn","msn get CurrentMedia\n"); payloadNode = xmlnode_from_str(xml_str, len); if (!payloadNode){ @@ -176,7 +176,7 @@ { xmlnode *payloadNode, *psmNode; char *psm; - + purple_debug_info("MSNP14","msn get PSM\n"); payloadNode = xmlnode_from_str(xml_str, len); if (!payloadNode){ @@ -217,7 +217,7 @@ return ret; } -/* set the MSN's PSM info,Currently Read from the status Line +/* set the MSN's PSM info,Currently Read from the status Line * Thanks for Cris Code */ void diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/transaction.h --- a/libpurple/protocols/msn/transaction.h Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/transaction.h Mon Jun 09 04:17:31 2008 +0000 @@ -62,7 +62,7 @@ }; MsnTransaction *msn_transaction_new(MsnCmdProc *cmdproc, const char *command, - const char *format, ...) G_GNUC_PRINTF(3, 4); + const char *format, ...) G_GNUC_PRINTF(3, 4); void msn_transaction_destroy(MsnTransaction *trans); char *msn_transaction_to_string(MsnTransaction *trans); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/user.c --- a/libpurple/protocols/msn/user.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/user.c Mon Jun 09 04:17:31 2008 +0000 @@ -122,7 +122,7 @@ NULL); } else { purple_prpl_got_user_status_deactive(account, user->passport, "tune"); - } + } } if (user->idle) @@ -239,7 +239,7 @@ msn_user_unset_op(MsnUser *user, int list_op) { g_return_if_fail(user != NULL); - + user->list_op &= ~list_op; } diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/user.h --- a/libpurple/protocols/msn/user.h Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/user.h Mon Jun 09 04:17:31 2008 +0000 @@ -57,9 +57,6 @@ */ struct _MsnUser { -#if 0 - MsnSession *session; /**< The MSN session. */ -#endif MsnUserList *userlist; char *passport; /**< The passport account. */ @@ -69,7 +66,7 @@ char * uid; /*< User Id */ const char *status; /**< The state of the user. */ - char *statusline; /**< The state of the user. */ + char *statusline; /**< The state of the user. */ CurrentMedia media; /**< Current media of the user. */ gboolean idle; /**< The idle state of the user. */ @@ -135,7 +132,7 @@ /** * Sets the new statusline of user. - * + * * @param user The user. * @param state The statusline string. */ @@ -143,7 +140,7 @@ /** * Sets the current media of user. - * + * * @param user The user. * @param cmedia Current media. */ diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/userlist.c --- a/libpurple/protocols/msn/userlist.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/userlist.c Mon Jun 09 04:17:31 2008 +0000 @@ -48,7 +48,7 @@ { MsnSession *session = pa->gc->proto_data; MsnUserList *userlist = session->userlist; - + msn_userlist_add_buddy_to_list(userlist, pa->who, MSN_LIST_AL); msn_del_contact_from_list(session->contact, NULL, pa->who, MSN_LIST_PL); @@ -127,7 +127,7 @@ if (user == NULL) return FALSE; - + list_op = 1 << list_id; if (user->list_op & list_op) @@ -237,7 +237,7 @@ if (convo) { PurpleBuddy *buddy; char *msg; - + buddy = purple_find_buddy(account, passport); msg = g_strdup_printf( _("%s has added you to his or her buddy list."), @@ -246,7 +246,7 @@ PURPLE_MESSAGE_SYSTEM, time(NULL)); g_free(msg); } - + if (!(user->list_op & (MSN_LIST_AL_OP | MSN_LIST_BL_OP))) { /* @@ -341,7 +341,7 @@ passport = msn_user_get_passport(user); store = msn_user_get_store_name(user); - + msn_user_set_op(user, list_op); if (list_op & MSN_LIST_FL_OP) @@ -407,7 +407,7 @@ userlist->session = session; userlist->buddy_icon_requests = g_queue_new(); - + /* buddy_icon_window is the number of allowed simultaneous buddy icon requests. * XXX With smarter rate limiting code, we could allow more at once... 5 was the limit set when * we weren't retrieiving any more than 5 per MSN session. */ @@ -644,12 +644,12 @@ msn_userlist_rem_buddy(MsnUserList *userlist, const char *who) { MsnUser *user = NULL; - + g_return_if_fail(userlist != NULL); g_return_if_fail(userlist->session != NULL); g_return_if_fail(userlist->session->contact != NULL); g_return_if_fail(who != NULL); - + user = msn_userlist_find_user(userlist, who); msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_FL); @@ -669,9 +669,9 @@ MsnListOp list_op = 1 << list_id; user = msn_userlist_find_user(userlist, who); - + g_return_if_fail(user != NULL); - + if ( !msn_userlist_user_is_in_list(user, list_id)) { list = lists[list_id]; purple_debug_info("MSN Userlist", "User %s is not in list %s, not removing.\n", who, list); @@ -690,14 +690,14 @@ MsnUser *user; MsnCallbackState *state = NULL; const char *group_id = NULL, *new_group_name; - + new_group_name = group_name == NULL ? MSN_INDIVIDUALS_GROUP_NAME : group_name; - + g_return_if_fail(userlist != NULL); g_return_if_fail(userlist->session != NULL); - + purple_debug_info("MSN Userlist", "Add user: %s to group: %s\n", who, new_group_name); state = msn_callback_state_new(userlist->session); @@ -709,9 +709,9 @@ /* only notify the user about problems adding to the friends list * maybe we should do something else for other lists, but it probably * won't cause too many problems if we just ignore it */ - + char *str = g_strdup_printf(_("Unable to add \"%s\"."), who); - + purple_notify_error(NULL, NULL, str, _("The username specified is invalid.")); g_free(str); @@ -725,7 +725,7 @@ { /* Whoa, we must add that group first. */ purple_debug_info("MSN Userlist", "Adding user %s to a new group, creating group %s first\n", who, new_group_name); - + msn_callback_state_set_action(state, MSN_ADD_BUDDY); msn_add_group(userlist->session, state, new_group_name); @@ -733,9 +733,9 @@ } else { msn_callback_state_set_guid(state, group_id); } - + /* XXX: adding user here may not be correct (should add them in the - * ACK to the ADL command), but for now we need to make sure they exist + * ACK to the ADL command), but for now we need to make sure they exist * early enough that the ILN command doesn't screw us up */ user = msn_userlist_find_add_user(userlist, who, who); @@ -751,7 +751,7 @@ return; } } - + purple_debug_info("MSN Userlist", "Adding user: %s to group id: %s\n", who, group_id); msn_callback_state_set_action(state, MSN_ADD_BUDDY); @@ -762,7 +762,7 @@ } void -msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, +msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, MsnListId list_id) { MsnUser *user = NULL; @@ -770,9 +770,9 @@ MsnListOp list_op = 1 << list_id; g_return_if_fail(userlist != NULL); - + user = msn_userlist_find_add_user(userlist, who, who); - + /* First we're going to check if it's already there. */ if (msn_userlist_user_is_in_list(user, list_id)) { @@ -780,16 +780,16 @@ purple_debug_info("MSN Userlist", "User '%s' is already in list: %s\n", who, list); return; } - + //store_name = (user != NULL) ? get_store_name(user) : who; - + //purple_debug_info("MSN Userlist", "store_name = %s\n", store_name); - + /* XXX: see XXX above, this should really be done when we get the response from the server */ - + msn_user_set_op(user, list_op); - + msn_notification_add_buddy_to_list(userlist->session->notification, list_id, who); } @@ -799,7 +799,7 @@ { MsnUser *user; gchar * group_id; - + g_return_val_if_fail(userlist != NULL, FALSE); g_return_val_if_fail(group_name != NULL, FALSE); g_return_val_if_fail(who != NULL, FALSE); @@ -815,7 +815,7 @@ purple_debug_error("MSN Userlist", "User %s not found!", who); return FALSE; } - + msn_user_add_group_id(user, group_id); return TRUE; @@ -832,7 +832,7 @@ g_return_val_if_fail(userlist != NULL, FALSE); g_return_val_if_fail(group_name != NULL, FALSE); g_return_val_if_fail(who != NULL, FALSE); - + purple_debug_info("MSN Userlist","Removing buddy with passport %s from group %s\n", who, group_name); if ( (group_id = msn_userlist_find_group_id(userlist, group_name)) == NULL) { @@ -856,7 +856,7 @@ { const char *new_group_id; MsnCallbackState *state; - + g_return_if_fail(userlist != NULL); g_return_if_fail(userlist->session != NULL); g_return_if_fail(userlist->session->contact != NULL); @@ -870,11 +870,11 @@ new_group_id = msn_userlist_find_group_id(userlist, new_group_name); if (new_group_id == NULL) - { + { msn_add_group(userlist->session, state, new_group_name); return; } - + /* add the contact to the new group, and remove it from the old one in * the callback */ @@ -928,6 +928,6 @@ (char *)l->data,NULL); msn_user_set_op(user, MSN_LIST_BL_OP); } - + } diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/msn/userlist.h --- a/libpurple/protocols/msn/userlist.h Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/msn/userlist.h Mon Jun 09 04:17:31 2008 +0000 @@ -94,7 +94,7 @@ void msn_userlist_remove_group_id(MsnUserList *userlist, const char *group_id); void msn_userlist_rem_buddy(MsnUserList *userlist, const char *who); -void msn_userlist_add_buddy(MsnUserList *userlist, +void msn_userlist_add_buddy(MsnUserList *userlist, const char *who, const char *group_name); void msn_userlist_move_buddy(MsnUserList *userlist, const char *who, const char *old_group_name, @@ -106,7 +106,7 @@ const char *who, const char *group_name); -void msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, +void msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who, MsnListId list_id); void msn_userlist_rem_buddy_from_list(MsnUserList *userlist, const char *who, MsnListId list_id); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.c Mon Jun 09 04:17:31 2008 +0000 @@ -1328,7 +1328,10 @@ delta = time(NULL) - session->last_comm; /* purple_debug_info("msim", "msim_check_alive: delta=%d\n", delta); */ if (delta >= MSIM_KEEPALIVE_INTERVAL) { - errmsg = g_strdup_printf(_("Connection to server lost (no data received within %d seconds)"), (int)delta); + errmsg = g_strdup_printf(ngettext("Connection to server lost (no data received within %d second)", + "Connection to server lost (no data received within %d seconds)", + (int)delta), + (int)delta); purple_debug_info("msim", "msim_check_alive: %s > interval of %d, presumed dead\n", errmsg, MSIM_KEEPALIVE_INTERVAL); @@ -2404,7 +2407,7 @@ const char *username; /* If the account does not exist, we can't look up the user. */ - if (!account) + if (!account || !account->gc) return str; id = atol(str); @@ -2946,7 +2949,10 @@ switch (GPOINTER_TO_UINT(user_data)) { case MSIM_CONTACT_LIST_IMPORT_ALL_FRIENDS: - msg = g_strdup_printf(_("%d buddies were added or updated from the server (including buddies already on the server-side list)"), buddy_count); + msg = g_strdup_printf(ngettext("%d buddy was added or updated from the server (including buddies already on the server-side list)", + "%d buddies were added or updated from the server (including buddies already on the server-side list)", + buddy_count), + buddy_count); purple_notify_info(session->account, _("Add contacts from server"), msg, NULL); g_free(msg); break; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_admin.c --- a/libpurple/protocols/oscar/family_admin.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_admin.c Mon Jun 09 04:17:31 2008 +0000 @@ -47,8 +47,8 @@ byte_stream_put16(&bs, info); byte_stream_put16(&bs, 0x0000); - snacid = aim_cachesnac(od, 0x0007, 0x0002, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0007, 0x0002, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_ADMIN, 0x0002, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ADMIN, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -127,8 +127,8 @@ aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - snacid = aim_cachesnac(od, 0x0007, 0x0004, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0007, 0x0004, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -154,8 +154,8 @@ aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - snacid = aim_cachesnac(od, 0x0007, 0x0004, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0007, 0x0004, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -177,8 +177,8 @@ aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - snacid = aim_cachesnac(od, 0x0007, 0x0004, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0007, 0x0004, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -194,11 +194,11 @@ void aim_admin_reqconfirm(OscarData *od, FlapConnection *conn) { - aim_genericreq_n(od, conn, 0x0007, 0x0006); + aim_genericreq_n(od, conn, SNAC_FAMILY_ADMIN, 0x0006); } /** - * Subtype 0x0007 - Account confirmation request acknowledgement. + * Subtype SNAC_FAMILY_ADMIN - Account confirmation request acknowledgement. */ static int accountconfirm(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) @@ -227,7 +227,7 @@ if ((snac->subtype == 0x0003) || (snac->subtype == 0x0005)) { infochange(od, conn, mod, frame, snac, bs); return 1; - } else if (snac->subtype == 0x0007) + } else if (snac->subtype == SNAC_FAMILY_ADMIN) return accountconfirm(od, conn, mod, frame, snac, bs); return 0; @@ -235,7 +235,7 @@ int admin_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0007; + mod->family = SNAC_FAMILY_ADMIN; mod->version = 0x0001; mod->toolid = 0x0010; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_advert.c --- a/libpurple/protocols/oscar/family_advert.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_advert.c Mon Jun 09 04:17:31 2008 +0000 @@ -28,7 +28,7 @@ void aim_ads_requestads(OscarData *od, FlapConnection *conn) { - aim_genericreq_n(od, conn, 0x0005, 0x0002); + aim_genericreq_n(od, conn, SNAC_FAMILY_ADVERT, 0x0002); } static int snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *rx, aim_modsnac_t *snac, ByteStream *bs) @@ -39,7 +39,7 @@ int adverts_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0005; + mod->family = SNAC_FAMILY_ADVERT; mod->version = 0x0001; mod->toolid = 0x0001; mod->toolversion = 0x0001; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_alert.c --- a/libpurple/protocols/oscar/family_alert.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_alert.c Mon Jun 09 04:17:31 2008 +0000 @@ -72,8 +72,8 @@ byte_stream_put16(&bs, 0xb0ee); byte_stream_put16(&bs, 0x0631); - snacid = aim_cachesnac(od, 0x0018, 0x0006, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0018, 0x0006, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_ALERT, 0x0006, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ALERT, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -188,8 +188,8 @@ byte_stream_put32(&bs, 0x04000000); byte_stream_put32(&bs, 0x00000000); - snacid = aim_cachesnac(od, 0x0018, 0x0016, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0018, 0x0006, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_ALERT, 0x0016, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ALERT, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -225,7 +225,7 @@ int email_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0018; + mod->family = SNAC_FAMILY_ALERT; mod->version = 0x0001; mod->toolid = 0x0010; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_auth.c --- a/libpurple/protocols/oscar/family_auth.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_auth.c Mon Jun 09 04:17:31 2008 +0000 @@ -200,9 +200,13 @@ * usually happens for AOL accounts. We are told that we * should truncate it if the 0x0017/0x0007 SNAC contains * a TLV of type 0x0026 with data 0x0000. + * @param allow_multiple_logins Allow multiple logins? If TRUE, the AIM + * server will prompt the user when multiple logins occur. If + * FALSE, existing connections (on other clients) will be + * disconnected automatically as we connect. */ int -aim_send_login(OscarData *od, FlapConnection *conn, const char *sn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key) +aim_send_login(OscarData *od, FlapConnection *conn, const char *sn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key, gboolean allow_multiple_logins) { FlapFrame *frame; GSList *tlvlist = NULL; @@ -221,8 +225,8 @@ frame = flap_frame_new(od, 0x02, 1152); - snacid = aim_cachesnac(od, 0x0017, 0x0002, 0x0000, NULL, 0); - aim_putsnac(&frame->data, 0x0017, 0x0002, 0x0000, snacid); + snacid = aim_cachesnac(od, SNAC_FAMILY_AUTH, 0x0002, 0x0000, NULL, 0); + aim_putsnac(&frame->data, SNAC_FAMILY_AUTH, 0x0002, 0x0000, snacid); aim_tlvlist_add_str(&tlvlist, 0x0001, sn); @@ -256,7 +260,7 @@ * If set, old-fashioned buddy lists will not work. You will need * to use SSI. */ - aim_tlvlist_add_8(&tlvlist, 0x004a, 0x01); + aim_tlvlist_add_8(&tlvlist, 0x004a, (allow_multiple_logins ? 0x01 : 0x02)); aim_tlvlist_write(&frame->data, &tlvlist); @@ -403,7 +407,7 @@ od->authinfo = info; - if ((userfunc = aim_callhandler(od, snac ? snac->family : 0x0017, snac ? snac->subtype : 0x0003))) + if ((userfunc = aim_callhandler(od, snac ? snac->family : SNAC_FAMILY_AUTH, snac ? snac->subtype : 0x0003))) ret = userfunc(od, conn, frame, info); aim_tlvlist_free(tlvlist); @@ -449,7 +453,7 @@ FlapFrame frame; aim_rxcallback_t userfunc; - if ((userfunc = aim_callhandler(od, 0x0017, 0x0007))) + if ((userfunc = aim_callhandler(od, SNAC_FAMILY_AUTH, 0x0007))) userfunc(od, conn, &frame, ""); return 0; @@ -483,8 +487,8 @@ frame = flap_frame_new(od, 0x02, 10+2+2+strlen(sn)+8); - snacid = aim_cachesnac(od, 0x0017, 0x0006, 0x0000, NULL, 0); - aim_putsnac(&frame->data, 0x0017, 0x0006, 0x0000, snacid); + snacid = aim_cachesnac(od, SNAC_FAMILY_AUTH, 0x0006, 0x0000, NULL, 0); + aim_putsnac(&frame->data, SNAC_FAMILY_AUTH, 0x0006, 0x0000, snacid); aim_tlvlist_add_str(&tlvlist, 0x0001, sn); @@ -628,7 +632,7 @@ int auth_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0017; + mod->family = SNAC_FAMILY_AUTH; mod->version = 0x0000; mod->flags = 0; strncpy(mod->name, "auth", sizeof(mod->name)); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_bart.c --- a/libpurple/protocols/oscar/family_bart.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_bart.c Mon Jun 09 04:17:31 2008 +0000 @@ -43,7 +43,7 @@ ByteStream bs; aim_snacid_t snacid; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0010)) || !icon || !iconlen) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_BART)) || !icon || !iconlen) return -EINVAL; byte_stream_new(&bs, 2 + 2 + iconlen); @@ -55,8 +55,8 @@ byte_stream_put16(&bs, iconlen); byte_stream_putraw(&bs, icon, iconlen); - snacid = aim_cachesnac(od, 0x0010, 0x0002, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0010, 0x0002, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_BART, 0x0002, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_BART, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -102,7 +102,7 @@ ByteStream bs; aim_snacid_t snacid; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0010)) || !sn || !strlen(sn) || !iconcsum || !iconcsumlen) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_BART)) || !sn || !strlen(sn) || !iconcsum || !iconcsumlen) return -EINVAL; byte_stream_new(&bs, 1+strlen(sn) + 4 + 1+iconcsumlen); @@ -120,8 +120,8 @@ byte_stream_put8(&bs, iconcsumlen); byte_stream_putraw(&bs, iconcsum, iconcsumlen); - snacid = aim_cachesnac(od, 0x0010, 0x0004, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0010, 0x0004, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_BART, 0x0004, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_BART, 0x0004, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -174,7 +174,7 @@ int bart_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0010; + mod->family = SNAC_FAMILY_BART; mod->version = 0x0001; mod->toolid = 0x0010; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_bos.c --- a/libpurple/protocols/oscar/family_bos.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_bos.c Mon Jun 09 04:17:31 2008 +0000 @@ -32,7 +32,7 @@ void aim_bos_reqrights(OscarData *od, FlapConnection *conn) { - aim_genericreq_n_snacid(od, conn, 0x0009, 0x0002); + aim_genericreq_n_snacid(od, conn, SNAC_FAMILY_BOS, 0x0002); } /* Subtype 0x0003 - BOS Rights. */ @@ -81,7 +81,7 @@ void aim_bos_setgroupperm(OscarData *od, FlapConnection *conn, guint32 mask) { - aim_genericreq_l(od, conn, 0x0009, 0x0004, &mask); + aim_genericreq_l(od, conn, SNAC_FAMILY_BOS, 0x0004, &mask); } /* @@ -153,8 +153,8 @@ } g_free(localcpy); - snacid = aim_cachesnac(od, 0x0009, subtype, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0009, subtype, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_BOS, subtype, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_BOS, subtype, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -173,7 +173,7 @@ int bos_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0009; + mod->family = SNAC_FAMILY_BOS; mod->version = 0x0001; mod->toolid = 0x0110; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_buddy.c --- a/libpurple/protocols/oscar/family_buddy.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_buddy.c Mon Jun 09 04:17:31 2008 +0000 @@ -108,8 +108,8 @@ byte_stream_put8(&bs, strlen(sn)); byte_stream_putstr(&bs, sn); - snacid = aim_cachesnac(od, 0x0003, 0x0004, 0x0000, sn, strlen(sn)+1); - flap_connection_send_snac(od, conn, 0x0003, 0x0004, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_BUDDY, 0x0004, 0x0000, sn, strlen(sn)+1); + flap_connection_send_snac(od, conn, SNAC_FAMILY_BUDDY, 0x0004, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -159,8 +159,8 @@ tmpptr = strtok(NULL, "&"); } - snacid = aim_cachesnac(od, 0x0003, 0x0004, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0003, 0x0004, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_BUDDY, 0x0004, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_BUDDY, 0x0004, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -190,8 +190,8 @@ byte_stream_put8(&bs, strlen(sn)); byte_stream_putstr(&bs, sn); - snacid = aim_cachesnac(od, 0x0003, 0x0005, 0x0000, sn, strlen(sn)+1); - flap_connection_send_snac(od, conn, 0x0003, 0x0005, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_BUDDY, 0x0005, 0x0000, sn, strlen(sn)+1); + flap_connection_send_snac(od, conn, SNAC_FAMILY_BUDDY, 0x0005, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -243,7 +243,7 @@ int buddylist_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0003; + mod->family = SNAC_FAMILY_BUDDY; mod->version = 0x0001; mod->toolid = 0x0110; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_chat.c --- a/libpurple/protocols/oscar/family_chat.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_chat.c Mon Jun 09 04:17:31 2008 +0000 @@ -364,7 +364,7 @@ byte_stream_new(&bs, 1142); - snacid = aim_cachesnac(od, 0x000e, 0x0005, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_CHAT, 0x0005, 0x0000, NULL, 0); /* * Cookie @@ -432,7 +432,7 @@ aim_tlvlist_free(inner_tlvlist); aim_tlvlist_free(tlvlist); - flap_connection_send_snac(od, conn, 0x000e, 0x0005, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_CHAT, 0x0005, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -594,7 +594,7 @@ int chat_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x000e; + mod->family = SNAC_FAMILY_CHAT; mod->version = 0x0001; mod->toolid = 0x0010; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_chatnav.c --- a/libpurple/protocols/oscar/family_chatnav.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_chatnav.c Mon Jun 09 04:17:31 2008 +0000 @@ -42,7 +42,7 @@ return 0; } - if (snac2->family != 0x000d) { + if (snac2->family != SNAC_FAMILY_CHATNAV) { purple_debug_warning("oscar", "chatnav error: received response that maps to corrupt request (fam=%04x)\n", snac2->family); return 0; } @@ -80,7 +80,7 @@ */ void aim_chatnav_reqrights(OscarData *od, FlapConnection *conn) { - aim_genericreq_n_snacid(od, conn, 0x000d, 0x0002); + aim_genericreq_n_snacid(od, conn, SNAC_FAMILY_CHATNAV, 0x0002); } /* @@ -97,7 +97,7 @@ byte_stream_new(&bs, 1142); - snacid = aim_cachesnac(od, 0x000d, 0x0008, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_CHATNAV, 0x0008, 0x0000, NULL, 0); /* exchange */ byte_stream_put16(&bs, exchange); @@ -137,7 +137,7 @@ aim_tlvlist_free(tlvlist); - flap_connection_send_snac(od, conn, 0x000d, 0x0008, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_CHATNAV, 0x0008, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -460,7 +460,7 @@ return 0; } - if (snac2->family != 0x000d) { + if (snac2->family != SNAC_FAMILY_CHATNAV) { purple_debug_misc("oscar", "faim: chatnav_parse_info: received response that maps to corrupt request! (fam=%04x)\n", snac2->family); return 0; } @@ -506,7 +506,7 @@ int chatnav_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x000d; + mod->family = SNAC_FAMILY_CHATNAV; mod->version = 0x0001; mod->toolid = 0x0010; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_icbm.c --- a/libpurple/protocols/oscar/family_icbm.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_icbm.c Mon Jun 09 04:17:31 2008 +0000 @@ -164,7 +164,7 @@ ByteStream bs; aim_snacid_t snacid; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0004))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; if (!params) @@ -182,8 +182,8 @@ byte_stream_put16(&bs, params->maxrecverwarn); byte_stream_put32(&bs, params->minmsginterval); - snacid = aim_cachesnac(od, 0x0004, 0x0002, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0004, 0x0002, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0002, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -198,10 +198,10 @@ { FlapConnection *conn; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0004))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; - aim_genericreq_n_snacid(od, conn, 0x0004, 0x0004); + aim_genericreq_n_snacid(od, conn, SNAC_FAMILY_ICBM, 0x0004); return 0; } @@ -237,7 +237,7 @@ * Possible flags: * AIM_IMFLAGS_AWAY -- Marks the message as an autoresponse * AIM_IMFLAGS_ACK -- Requests that the server send an ack - * when the message is received (of type 0x0004/0x000c) + * when the message is received (of type SNAC_FAMILY_ICBM/0x000c) * AIM_IMFLAGS_OFFLINE--If destination is offline, store it until they are * online (probably ICQ only). * @@ -280,7 +280,7 @@ int msgtlvlen; static const guint8 deffeatures[] = { 0x01, 0x01, 0x01, 0x02 }; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0004))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; if (!args) @@ -410,9 +410,9 @@ } /* XXX - should be optional */ - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, args->destsn, strlen(args->destsn)+1); - - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &data); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, args->destsn, strlen(args->destsn)+1); + + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &data); byte_stream_destroy(&data); /* clean out SNACs over 60sec old */ @@ -465,7 +465,7 @@ char *ucs = NULL; gsize bytes; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0004))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; if (!sn || !msg || !roomname) @@ -475,7 +475,7 @@ byte_stream_new(&bs, 1142+strlen(sn)+strlen(roomname)+strlen(msg)); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, sn, strlen(sn)+1); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, sn, strlen(sn)+1); /* XXX should be uncached by an unwritten 'invite accept' handler */ priv = g_malloc(sizeof(struct aim_invite_priv)); @@ -558,7 +558,7 @@ aim_tlvlist_free(inner_tlvlist); aim_tlvlist_free(outer_tlvlist); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -578,7 +578,7 @@ aim_snacid_t snacid; guchar cookie[8]; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0004))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; if (!sn || !icon || (iconlen <= 0) || (iconlen >= MAXICONLEN)) @@ -588,7 +588,7 @@ byte_stream_new(&bs, 8+2+1+strlen(sn)+2+2+2+8+16+2+2+2+2+2+2+2+4+4+4+iconlen+strlen(AIM_ICONIDENT)+2+2); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ aim_im_puticbm(&bs, cookie, 0x0002, sn); @@ -628,7 +628,7 @@ byte_stream_put16(&bs, 0x0003); byte_stream_put16(&bs, 0x0000); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -659,7 +659,7 @@ const char rtfcap[] = {"{97B12751-243C-4334-AD22-D6ABF73F1492}"}; /* OSCAR_CAPABILITY_ICQRTF capability in string form */ int servdatalen; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0004))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; if (!args || !args->destsn || !args->rtfmsg) @@ -671,7 +671,7 @@ byte_stream_new(&bs, 128+servdatalen); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ aim_im_puticbm(&bs, cookie, 0x0002, args->destsn); @@ -721,7 +721,7 @@ byte_stream_putle32(&bs, strlen(rtfcap)+1); byte_stream_putraw(&bs, (const guint8 *)rtfcap, strlen(rtfcap)+1); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -743,13 +743,13 @@ ByteStream hdrbs; od = peer_conn->od; - conn = flap_connection_findbygroup(od, 0x0004); + conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM); if (conn == NULL) return; byte_stream_new(&bs, 118+strlen(peer_conn->sn)); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ aim_im_puticbm(&bs, peer_conn->cookie, 0x0002, peer_conn->sn); @@ -774,7 +774,7 @@ aim_tlvlist_free(inner_tlvlist); aim_tlvlist_free(outer_tlvlist); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -792,13 +792,13 @@ aim_snacid_t snacid; od = peer_conn->od; - conn = flap_connection_findbygroup(od, 0x0004); + conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM); if (conn == NULL) return; byte_stream_new(&bs, 11+strlen(peer_conn->sn) + 4+2+8+16); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ aim_im_puticbm(&bs, peer_conn->cookie, 0x0002, peer_conn->sn); @@ -809,7 +809,7 @@ byte_stream_putraw(&bs, peer_conn->cookie, 8); byte_stream_putcaps(&bs, peer_conn->type); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -830,13 +830,13 @@ GSList *outer_tlvlist = NULL, *inner_tlvlist = NULL; ByteStream hdrbs; - conn = flap_connection_findbygroup(od, 0x0004); + conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM); if (conn == NULL) return; byte_stream_new(&bs, 246+strlen(sn)); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ aim_im_puticbm(&bs, cookie, 0x0002, sn); @@ -864,7 +864,7 @@ aim_tlvlist_free(inner_tlvlist); aim_tlvlist_free(outer_tlvlist); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -883,13 +883,13 @@ ByteStream hdrbs; guint8 ip_comp[4]; - conn = flap_connection_findbygroup(od, 0x0004); + conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM); if (conn == NULL) return; byte_stream_new(&bs, 246+strlen(sn)); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ aim_im_puticbm(&bs, cookie, 0x0002, sn); @@ -927,7 +927,7 @@ aim_tlvlist_free(inner_tlvlist); aim_tlvlist_free(outer_tlvlist); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -945,13 +945,13 @@ GSList *outer_tlvlist = NULL, *inner_tlvlist = NULL; ByteStream hdrbs; - conn = flap_connection_findbygroup(od, 0x0004); + conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM); if (conn == NULL) return; byte_stream_new(&bs, 1014); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ aim_im_puticbm(&bs, cookie, 0x0002, sn); @@ -1010,7 +1010,7 @@ aim_tlvlist_free(inner_tlvlist); aim_tlvlist_free(outer_tlvlist); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -1029,13 +1029,13 @@ ByteStream hdrbs; guint8 ip_comp[4]; - conn = flap_connection_findbygroup(od, 0x0004); + conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM); if (conn == NULL) return; byte_stream_new(&bs, 1014); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ aim_im_puticbm(&bs, cookie, 0x0002, sn); @@ -1103,7 +1103,7 @@ aim_tlvlist_free(inner_tlvlist); aim_tlvlist_free(outer_tlvlist); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -1124,14 +1124,14 @@ aim_snacid_t snacid; guchar cookie[8]; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0004)) || !sn) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM)) || !sn) return -EINVAL; aim_icbm_makecookie(cookie); byte_stream_new(&bs, 8+2+1+strlen(sn) + 4+0x5e + 4); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); /* ICBM header */ aim_im_puticbm(&bs, cookie, 0x0002, sn); @@ -1199,7 +1199,7 @@ byte_stream_put16(&bs, 0x0003); byte_stream_put16(&bs, 0x0000); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -1235,7 +1235,7 @@ byte_stream_new(&bs, 8+3+strlen(sn)+12+strlen(message)+1+4); - snacid = aim_cachesnac(od, 0x0004, 0x0006, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0006, 0x0000, NULL, 0); aim_icbm_makecookie(cookie); @@ -1268,7 +1268,7 @@ byte_stream_put16(&bs, 0x0006); byte_stream_put16(&bs, 0x0000); - flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0006, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -2307,13 +2307,13 @@ byte_stream_new(&bs, strlen(sn)+3); - snacid = aim_cachesnac(od, 0x0004, 0x0008, 0x0000, sn, strlen(sn)+1); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0008, 0x0000, sn, strlen(sn)+1); byte_stream_put16(&bs, (flags & AIM_WARN_ANON) ? 0x0001 : 0x0000); byte_stream_put8(&bs, strlen(sn)); byte_stream_putstr(&bs, sn); - flap_connection_send_snac(od, conn, 0x0004, 0x0008, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0008, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -2360,12 +2360,12 @@ aim_snacid_t snacid; GSList *tlvlist = NULL; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0004))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICBM))) return -EINVAL; byte_stream_new(&bs, 8+2+1+strlen(sn)+6); - snacid = aim_cachesnac(od, 0x0004, 0x000b, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x000b, 0x0000, NULL, 0); byte_stream_putraw(&bs, cookie, 8); @@ -2377,7 +2377,7 @@ aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - flap_connection_send_snac(od, conn, 0x0004, 0x000b, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x000b, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -2699,7 +2699,7 @@ if (!od || !(conn = flap_connection_findbygroup(od, 0x0002))) return -EINVAL; - aim_genericreq_n(od, conn, 0x0004, 0x0010); + aim_genericreq_n(od, conn, SNAC_FAMILY_ICBM, 0x0010); return 0; } @@ -2725,7 +2725,7 @@ byte_stream_new(&bs, 11+strlen(sn)+2); - snacid = aim_cachesnac(od, 0x0004, 0x0014, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0014, 0x0000, NULL, 0); /* * 8 days of light @@ -2752,7 +2752,7 @@ */ byte_stream_put16(&bs, type2); - flap_connection_send_snac(od, conn, 0x0004, 0x0014, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0014, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -2812,7 +2812,7 @@ int msg_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0004; + mod->family = SNAC_FAMILY_ICBM; mod->version = 0x0001; mod->toolid = 0x0110; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_icq.c --- a/libpurple/protocols/oscar/family_icq.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_icq.c Mon Jun 09 04:17:31 2008 +0000 @@ -33,14 +33,14 @@ aim_snacid_t snacid; int bslen; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0015))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) return -EINVAL; bslen = 2 + 4 + 2 + 2; byte_stream_new(&bs, 4 + bslen); - snacid = aim_cachesnac(od, 0x0015, 0x0002, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); /* For simplicity, don't bother using a tlvlist */ byte_stream_put16(&bs, 0x0001); @@ -51,7 +51,7 @@ byte_stream_putle16(&bs, 0x003c); /* I command thee. */ byte_stream_putle16(&bs, snacid); /* eh. */ - flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -65,14 +65,14 @@ aim_snacid_t snacid; int bslen; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0015))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) return -EINVAL; bslen = 2 + 4 + 2 + 2; byte_stream_new(&bs, 4 + bslen); - snacid = aim_cachesnac(od, 0x0015, 0x0002, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); /* For simplicity, don't bother using a tlvlist */ byte_stream_put16(&bs, 0x0001); @@ -83,7 +83,7 @@ byte_stream_putle16(&bs, 0x003e); /* I command thee. */ byte_stream_putle16(&bs, snacid); /* eh. */ - flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -99,14 +99,14 @@ aim_snacid_t snacid; int bslen; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0015))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) return -EINVAL; bslen = 2+4+2+2+2+2+2+1+1+1+1+1+1; byte_stream_new(&bs, 4 + bslen); - snacid = aim_cachesnac(od, 0x0015, 0x0002, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); /* For simplicity, don't bother using a tlvlist */ byte_stream_put16(&bs, 0x0001); @@ -126,7 +126,7 @@ byte_stream_putle8(&bs, 0x00); byte_stream_putle8(&bs, !auth_required); - flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -151,7 +151,7 @@ if (!passwd) return -EINVAL; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0015))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) return -EINVAL; passwdlen = strlen(passwd); @@ -161,7 +161,7 @@ byte_stream_new(&bs, 4 + bslen); - snacid = aim_cachesnac(od, 0x0015, 0x0002, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); /* For simplicity, don't bother using a tlvlist */ byte_stream_put16(&bs, 0x0001); @@ -176,7 +176,7 @@ byte_stream_putstr(&bs, passwd); byte_stream_putle8(&bs, '\0'); - flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -194,14 +194,14 @@ if (!uin || uin[0] < '0' || uin[0] > '9') return -EINVAL; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0015))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) return -EINVAL; bslen = 2 + 4 + 2 + 2 + 2 + 4; byte_stream_new(&bs, 4 + bslen); - snacid = aim_cachesnac(od, 0x0015, 0x0002, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); /* For simplicity, don't bother using a tlvlist */ byte_stream_put16(&bs, 0x0001); @@ -214,7 +214,7 @@ byte_stream_putle16(&bs, 0x04b2); /* shrug. */ byte_stream_putle32(&bs, atoi(uin)); - flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -239,14 +239,14 @@ if (!uin || uin[0] < '0' || uin[0] > '9') return -EINVAL; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0015))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) return -EINVAL; bslen = 2 + 4 + 2 + 2 + 2 + 4; byte_stream_new(&bs, 4 + bslen); - snacid = aim_cachesnac(od, 0x0015, 0x0002, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); /* For simplicity, don't bother using a tlvlist */ byte_stream_put16(&bs, 0x0001); @@ -259,7 +259,7 @@ byte_stream_putle16(&bs, 0x04ba); /* shrug. */ byte_stream_putle32(&bs, atoi(uin)); - flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -283,14 +283,14 @@ if (!uin || uin[0] < '0' || uin[0] > '9') return -EINVAL; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0015))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) return -EINVAL; bslen = 2 + 4 + 2 + 2 + 2 + 4; byte_stream_new(&bs, 4 + bslen); - snacid = aim_cachesnac(od, 0x0015, 0x0002, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); /* For simplicity, don't bother using a tlvlist */ byte_stream_put16(&bs, 0x0001); @@ -303,7 +303,7 @@ byte_stream_putle16(&bs, 0x051f); /* shrug. */ byte_stream_putle32(&bs, atoi(uin)); - flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -321,14 +321,14 @@ if (!xml || !strlen(xml)) return -EINVAL; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0015))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) return -EINVAL; bslen = 2 + 10 + 2 + strlen(xml) + 1; byte_stream_new(&bs, 4 + bslen); - snacid = aim_cachesnac(od, 0x0015, 0x0002, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); /* For simplicity, don't bother using a tlvlist */ byte_stream_put16(&bs, 0x0001); @@ -342,7 +342,7 @@ byte_stream_putle16(&bs, strlen(xml) + 1); byte_stream_putraw(&bs, (guint8 *)xml, strlen(xml) + 1); - flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -380,7 +380,7 @@ struct tm *tm; gchar *stripped; - if (!od || !(conn = flap_connection_findbygroup(od, 0x0015))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) return -EINVAL; if (!name || !msg || !alias) @@ -411,7 +411,7 @@ byte_stream_new(&bs, 4 + bslen); - snacid = aim_cachesnac(od, 0x0015, 0x0002, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); /* For simplicity, don't bother using a tlvlist */ byte_stream_put16(&bs, 0x0001); @@ -436,7 +436,7 @@ byte_stream_putstr(&bs, xml); byte_stream_put8(&bs, 0x00); - flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -460,7 +460,7 @@ purple_debug_misc("oscar", "aim_icq_getstatusnote: requesting status note for %s.\n", uin); - if (!od || !(conn = flap_connection_findbygroup(od, 0x0015))) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ))) { purple_debug_misc("oscar", "aim_icq_getstatusnote: no connection.\n"); return -EINVAL; @@ -469,7 +469,7 @@ bslen = 2 + 4 + 2 + 2 + 2 + 2 + 58 + strlen(uin); byte_stream_new(&bs, 4 + bslen); - snacid = aim_cachesnac(od, 0x0015, 0x0002, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0); byte_stream_put16(&bs, 0x0001); byte_stream_put16(&bs, bslen); @@ -497,7 +497,7 @@ byte_stream_put16(&bs, strlen(uin)); byte_stream_putstr(&bs, uin); - flap_connection_send_snac(od, conn, 0x0015, 0x0002, 0x000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x000, snacid, &bs); byte_stream_destroy(&bs); @@ -541,7 +541,7 @@ } /** - * Subtype 0x0003 - Response to 0x0015/0x002, contains an ICQesque packet. + * Subtype 0x0003 - Response to SNAC_FAMILY_ICQ/0x002, contains an ICQesque packet. */ static int icqresponse(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) @@ -940,7 +940,7 @@ int icq_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0015; + mod->family = SNAC_FAMILY_ICQ; mod->version = 0x0001; mod->toolid = 0x0110; mod->toolversion = 0x047c; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_invite.c --- a/libpurple/protocols/oscar/family_invite.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_invite.c Mon Jun 09 04:17:31 2008 +0000 @@ -41,7 +41,7 @@ int invite_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0006; + mod->family = SNAC_FAMILY_INVITE; mod->version = 0x0001; mod->toolid = 0x0110; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_locate.c --- a/libpurple/protocols/oscar/family_locate.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_locate.c Mon Jun 09 04:17:31 2008 +0000 @@ -171,7 +171,7 @@ {0x09, 0x46, 0xf0, 0x03, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, - {OSCAR_CAPABILITY_GENERICUNKNOWN, + {OSCAR_CAPABILITY_ICHAT_SCREENSHARE, {0x09, 0x46, 0xf0, 0x04, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}}, @@ -943,7 +943,7 @@ return 0; } - if ((snac2->family != 0x0002) && (snac2->type != 0x0015)) { + if ((snac2->family != SNAC_FAMILY_LOCATE) && (snac2->type != 0x0015)) { purple_debug_misc("oscar", "faim: locate.c, error(): received response from invalid request! %d\n", snac2->family); return 0; } @@ -1094,12 +1094,12 @@ byte_stream_new(&bs, aim_tlvlist_size(tlvlist)); - snacid = aim_cachesnac(od, 0x0002, 0x0004, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x0004, 0x0000, NULL, 0); aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - flap_connection_send_snac(od, conn, 0x0002, 0x0004, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x0004, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -1124,12 +1124,12 @@ byte_stream_new(&bs, aim_tlvlist_size(tlvlist)); - snacid = aim_cachesnac(od, 0x0002, 0x0004, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x0004, 0x0000, NULL, 0); aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - flap_connection_send_snac(od, conn, 0x0002, 0x0004, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x0004, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -1157,13 +1157,13 @@ byte_stream_new(&bs, 2+1+strlen(sn)); - snacid = aim_cachesnac(od, 0x0002, 0x0005, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x0005, 0x0000, NULL, 0); byte_stream_put16(&bs, infotype); byte_stream_put8(&bs, strlen(sn)); byte_stream_putstr(&bs, sn); - flap_connection_send_snac(od, conn, 0x0002, 0x0005, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x0005, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -1274,12 +1274,12 @@ byte_stream_new(&bs, aim_tlvlist_size(tlvlist)); - snacid = aim_cachesnac(od, 0x0002, 0x0009, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x0009, 0x0000, NULL, 0); aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - flap_connection_send_snac(od, conn, 0x0002, 0x0009, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x0009, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -1302,12 +1302,12 @@ byte_stream_new(&bs, 1+strlen(sn)); - snacid = aim_cachesnac(od, 0x0002, 0x000b, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x000b, 0x0000, NULL, 0); byte_stream_put8(&bs, strlen(sn)); byte_stream_putstr(&bs, sn); - flap_connection_send_snac(od, conn, 0x0002, 0x000b, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x000b, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -1347,12 +1347,12 @@ byte_stream_new(&bs, aim_tlvlist_size(tlvlist)); - snacid = aim_cachesnac(od, 0x0002, 0x000f, 0x0000, NULL, 0); + snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x000f, 0x0000, NULL, 0); aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - flap_connection_send_snac(od, conn, 0x0002, 0x000f, 0x0000, snacid, &bs); + flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x000f, 0x0000, snacid, &bs); byte_stream_destroy(&bs); return 0; @@ -1385,8 +1385,8 @@ byte_stream_put8(&bs, strlen(sn)); byte_stream_putstr(&bs, sn); - snacid = aim_cachesnac(od, 0x0002, 0x0015, 0x0000, sn, strlen(sn)+1); - flap_connection_send_snac(od, conn, 0x0002, 0x0015, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_LOCATE, 0x0015, 0x0000, sn, strlen(sn)+1); + flap_connection_send_snac(od, conn, SNAC_FAMILY_LOCATE, 0x0015, 0x0000, snacid, &bs); byte_stream_destroy(&bs); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_odir.c --- a/libpurple/protocols/oscar/family_odir.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_odir.c Mon Jun 09 04:17:31 2008 +0000 @@ -45,7 +45,7 @@ aim_snacid_t snacid; GSList *tlvlist = NULL; - if (!od || !(conn = flap_connection_findbygroup(od, 0x000f)) || !region || !email) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ODIR)) || !region || !email) return -EINVAL; /* Create a TLV chain, write it to the outgoing frame, then free the chain */ @@ -58,8 +58,8 @@ aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - snacid = aim_cachesnac(od, 0x000f, 0x0002, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x000f, 0x0002, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_ODIR, 0x0002, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ODIR, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -94,7 +94,7 @@ aim_snacid_t snacid; GSList *tlvlist = NULL; - if (!od || !(conn = flap_connection_findbygroup(od, 0x000f)) || !region) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ODIR)) || !region) return -EINVAL; /* Create a TLV chain, write it to the outgoing frame, then free the chain */ @@ -126,8 +126,8 @@ aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - snacid = aim_cachesnac(od, 0x000f, 0x0002, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x000f, 0x0002, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_ODIR, 0x0002, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ODIR, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -149,7 +149,7 @@ aim_snacid_t snacid; GSList *tlvlist = NULL; - if (!od || !(conn = flap_connection_findbygroup(od, 0x000f)) || !region) + if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ODIR)) || !region) return -EINVAL; /* Create a TLV chain, write it to the outgoing frame, then free the chain */ @@ -163,8 +163,8 @@ aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - snacid = aim_cachesnac(od, 0x000f, 0x0002, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x000f, 0x0002, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_ODIR, 0x0002, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_ODIR, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -252,7 +252,7 @@ int odir_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x000f; + mod->family = SNAC_FAMILY_ODIR; mod->version = 0x0001; mod->toolid = 0x0010; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_oservice.c --- a/libpurple/protocols/oscar/family_oservice.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_oservice.c Mon Jun 09 04:17:31 2008 +0000 @@ -54,8 +54,8 @@ } } - snacid = aim_cachesnac(od, 0x0001, 0x0002, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0001, 0x0002, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_OSERVICE, 0x0002, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_OSERVICE, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -108,7 +108,7 @@ if(!conn) return; - aim_genericreq_s(od, conn, 0x0001, 0x0004, &serviceid); + aim_genericreq_s(od, conn, SNAC_FAMILY_OSERVICE, 0x0004, &serviceid); } /* @@ -146,8 +146,8 @@ aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - snacid = aim_cachesnac(od, 0x0001, 0x0004, 0x0000, &csi, sizeof(csi)); - flap_connection_send_snac(od, conn, 0x0001, 0x0004, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_OSERVICE, 0x0004, 0x0000, &csi, sizeof(csi)); + flap_connection_send_snac(od, conn, SNAC_FAMILY_OSERVICE, 0x0004, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -210,7 +210,7 @@ void aim_srv_reqrates(OscarData *od, FlapConnection *conn) { - aim_genericreq_n_snacid(od, conn, 0x0001, 0x0006); + aim_genericreq_n_snacid(od, conn, SNAC_FAMILY_OSERVICE, 0x0006); } /* @@ -389,8 +389,8 @@ byte_stream_put16(&bs, rateclass->classid); } - snacid = aim_cachesnac(od, 0x0001, 0x0008, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0001, 0x0008, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_OSERVICE, 0x0008, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_OSERVICE, 0x0008, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -412,8 +412,8 @@ byte_stream_put16(&bs, rateclass->classid); } - snacid = aim_cachesnac(od, 0x0001, 0x0009, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0001, 0x0009, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_OSERVICE, 0x0009, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_OSERVICE, 0x0009, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -503,8 +503,8 @@ for (cur = conn->groups; cur != NULL; cur = cur->next) byte_stream_put16(&bs, GPOINTER_TO_UINT(cur->data)); - snacid = aim_cachesnac(od, 0x0001, 0x000c, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0001, 0x000c, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_OSERVICE, 0x000c, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_OSERVICE, 0x000c, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -526,7 +526,7 @@ void aim_srv_reqpersonalinfo(OscarData *od, FlapConnection *conn) { - aim_genericreq_n_snacid(od, conn, 0x0001, 0x000e); + aim_genericreq_n_snacid(od, conn, SNAC_FAMILY_OSERVICE, 0x000e); } /* Subtype 0x000f - Self User Info */ @@ -589,7 +589,7 @@ if(!conn) return; - aim_genericreq_l(od, conn, 0x0001, 0x0011, &idletime); + aim_genericreq_l(od, conn, SNAC_FAMILY_OSERVICE, 0x0011, &idletime); } /* @@ -698,7 +698,7 @@ void aim_srv_setprivacyflags(OscarData *od, FlapConnection *conn, guint32 flags) { - aim_genericreq_l(od, conn, 0x0001, 0x0014, &flags); + aim_genericreq_l(od, conn, SNAC_FAMILY_OSERVICE, 0x0014, &flags); } /* @@ -713,7 +713,7 @@ void aim_srv_nop(OscarData *od, FlapConnection *conn) { - aim_genericreq_n(od, conn, 0x0001, 0x0016); + aim_genericreq_n(od, conn, SNAC_FAMILY_OSERVICE, 0x0016); } /* @@ -753,8 +753,8 @@ } } - snacid = aim_cachesnac(od, 0x0001, 0x0017, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0001, 0x0017, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_OSERVICE, 0x0017, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_OSERVICE, 0x0017, 0x0000, snacid, &bs); byte_stream_destroy(&bs); } @@ -861,8 +861,8 @@ aim_tlvlist_write(&bs, &tlvlist); aim_tlvlist_free(tlvlist); - snacid = aim_cachesnac(od, 0x0001, 0x001e, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0001, 0x001e, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_OSERVICE, 0x001e, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_OSERVICE, 0x001e, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -1012,8 +1012,8 @@ } - snacid = aim_cachesnac(od, 0x0001, 0x0020, 0x0000, NULL, 0); - flap_connection_send_snac(od, conn, 0x0001, 0x0020, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_OSERVICE, 0x0020, 0x0000, NULL, 0); + flap_connection_send_snac(od, conn, SNAC_FAMILY_OSERVICE, 0x0020, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -1100,7 +1100,7 @@ int service_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0001; + mod->family = SNAC_FAMILY_OSERVICE; mod->version = 0x0003; mod->toolid = 0x0110; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_popup.c --- a/libpurple/protocols/oscar/family_popup.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_popup.c Mon Jun 09 04:17:31 2008 +0000 @@ -72,7 +72,7 @@ int popups_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x0008; + mod->family = SNAC_FAMILY_POPUP; mod->version = 0x0001; mod->toolid = 0x0104; mod->toolversion = 0x0001; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_stats.c --- a/libpurple/protocols/oscar/family_stats.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_stats.c Mon Jun 09 04:17:31 2008 +0000 @@ -52,7 +52,7 @@ int stats_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x000b; + mod->family = SNAC_FAMILY_STATS; mod->version = 0x0001; mod->toolid = 0x0104; mod->toolversion = 0x0001; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_translate.c --- a/libpurple/protocols/oscar/family_translate.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_translate.c Mon Jun 09 04:17:31 2008 +0000 @@ -34,7 +34,7 @@ int translate_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x000c; + mod->family = SNAC_FAMILY_TRANSLATE; mod->version = 0x0001; mod->toolid = 0x0104; mod->toolversion = 0x0001; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/family_userlookup.c --- a/libpurple/protocols/oscar/family_userlookup.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/family_userlookup.c Mon Jun 09 04:17:31 2008 +0000 @@ -74,8 +74,8 @@ byte_stream_putstr(&bs, address); - snacid = aim_cachesnac(od, 0x000a, 0x0002, 0x0000, address, strlen(address)+1); - flap_connection_send_snac(od, conn, 0x000a, 0x0002, 0x0000, snacid, &bs); + snacid = aim_cachesnac(od, SNAC_FAMILY_USERLOOKUP, 0x0002, 0x0000, address, strlen(address)+1); + flap_connection_send_snac(od, conn, SNAC_FAMILY_USERLOOKUP, 0x0002, 0x0000, snacid, &bs); byte_stream_destroy(&bs); @@ -145,7 +145,7 @@ int search_modfirst(OscarData *od, aim_module_t *mod) { - mod->family = 0x000a; + mod->family = SNAC_FAMILY_USERLOOKUP; mod->version = 0x0001; mod->toolid = 0x0110; mod->toolversion = 0x0629; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/oscar.c Mon Jun 09 04:17:31 2008 +0000 @@ -735,6 +735,9 @@ case OSCAR_CAPABILITY_CAMERA: tmp = _("Camera"); break; + case OSCAR_CAPABILITY_ICHAT_SCREENSHARE: + tmp = _("Screen Sharing"); + break; default: tmp = NULL; break; @@ -896,8 +899,8 @@ if (b) { if (purple_presence_is_online(presence)) { - if (aim_snvalid_icq(b->name) || !message || !(*message)) { - /* Append the status name for online ICQ statuses and for all buddies with no message. + if (aim_snvalid_icq(b->name) || is_away || !message || !(*message)) { + /* Append the status name for online ICQ statuses, away AIM statuses, and for all buddies with no message. * If the status name and the message are the same, only show one. */ const char *status_name = purple_status_get_name(status); if (status_name && message && !strcmp(status_name, message)) @@ -1839,7 +1842,8 @@ aim_send_login(od, conn, purple_account_get_username(account), purple_connection_get_password(gc), truncate_pass, - od->icq ? &icqinfo : &aiminfo, key); + od->icq ? &icqinfo : &aiminfo, key, + /* allow multple logins? */ purple_account_get_bool(account, "allow_multiple_logins", OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS)); purple_connection_update_progress(gc, _("Password sent"), 2, OSCAR_CONNECT_STEPS); ck[2] = 0x6c; @@ -6796,6 +6800,10 @@ OSCAR_DEFAULT_ALWAYS_USE_RV_PROXY); prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); + option = purple_account_option_bool_new(_("Allow multiple simultaneous logins"), "allow_multiple_logins", + OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS); + prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); + if (init) return; init = TRUE; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/oscar.h --- a/libpurple/protocols/oscar/oscar.h Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/oscar.h Mon Jun 09 04:17:31 2008 +0000 @@ -353,7 +353,8 @@ OSCAR_CAPABILITY_ICHATAV = 0x02000000, OSCAR_CAPABILITY_LIVEVIDEO = 0x04000000, OSCAR_CAPABILITY_CAMERA = 0x08000000, - OSCAR_CAPABILITY_LAST = 0x10000000 + OSCAR_CAPABILITY_ICHAT_SCREENSHARE = 0x10000000, + OSCAR_CAPABILITY_LAST = 0x20000000 } OscarCapability; /* @@ -594,7 +595,7 @@ void aim_clientready(OscarData *od, FlapConnection *conn); int aim_request_login(OscarData *od, FlapConnection *conn, const char *sn); -int aim_send_login(OscarData *od, FlapConnection *conn, const char *sn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key); +int aim_send_login(OscarData *od, FlapConnection *conn, const char *sn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key, gboolean allow_multiple_logins); /* 0x000b */ int aim_auth_securid_send(OscarData *od, const char *securid); void aim_cleansnacs(OscarData *, int maxage); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/oscar/oscarcommon.h --- a/libpurple/protocols/oscar/oscarcommon.h Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/oscar/oscarcommon.h Mon Jun 09 04:17:31 2008 +0000 @@ -41,6 +41,7 @@ #define OSCAR_DEFAULT_HIDE_IP TRUE #define OSCAR_DEFAULT_WEB_AWARE FALSE #define OSCAR_DEFAULT_ALWAYS_USE_RV_PROXY FALSE +#define OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS TRUE #ifdef _WIN32 const char *oscar_get_locale_charset(void); diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/yahoo/yahoo_picture.c --- a/libpurple/protocols/yahoo/yahoo_picture.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo_picture.c Mon Jun 09 04:17:31 2008 +0000 @@ -137,6 +137,9 @@ if (url_data != NULL) { yd = gc->proto_data; yd->url_datas = g_slist_prepend(yd->url_datas, url_data); + } else { + g_free(data->who); + g_free(data); } } else if (who && send_icon_info) { yahoo_send_picture_info(gc, who); @@ -244,13 +247,12 @@ } if (url) { - if (yd->picture_url) - g_free(yd->picture_url); + g_free(yd->picture_url); yd->picture_url = g_strdup(url); purple_account_set_string(account, YAHOO_PICURL_SETTING, url); purple_account_set_int(account, YAHOO_PICCKSUM_SETTING, yd->picture_checksum); + yahoo_send_picture_checksum(gc); yahoo_send_picture_update(gc, 2); - yahoo_send_picture_checksum(gc); } } @@ -402,8 +404,15 @@ if (ret < 0 && errno == EAGAIN) return; - else if (ret <= 0) + else if (ret <= 0) { + purple_debug_info("yahoo", "Buddy icon upload response (%d) bytes (> ~400 indicates failure):\n%.*s\n", + d->str->len, d->str->len, d->str->str); + yahoo_buddy_icon_upload_data_free(d); + return; + } + + g_string_append_len(d->str, buf, ret); } static void yahoo_buddy_icon_upload_pending(gpointer data, gint source, PurpleInputCondition condition) @@ -421,6 +430,7 @@ if (wrote < 0 && errno == EAGAIN) return; if (wrote <= 0) { + purple_debug_info("yahoo", "Error uploading buddy icon.\n"); yahoo_buddy_icon_upload_data_free(d); return; } @@ -428,6 +438,9 @@ if (d->pos >= d->str->len) { purple_debug_misc("yahoo", "Finished uploading buddy icon.\n"); purple_input_remove(d->watcher); + /* Clean out the sent buffer and reuse it to read the result */ + g_string_free(d->str, TRUE); + d->str = g_string_new(""); d->watcher = purple_input_add(d->fd, PURPLE_INPUT_READ, yahoo_buddy_icon_upload_reading, d); } } @@ -436,16 +449,16 @@ { struct yahoo_buddy_icon_upload_data *d = data; struct yahoo_packet *pkt; - gchar *size, *header; + gchar *tmp, *header; guchar *pkt_buf; const char *host; int port; - size_t content_length, pkt_buf_len; - PurpleConnection *gc; + gsize pkt_buf_len; + PurpleConnection *gc = d->gc; PurpleAccount *account; struct yahoo_data *yd; + gboolean use_whole_url = FALSE; - gc = d->gc; account = purple_connection_get_account(gc); yd = gc->proto_data; @@ -457,44 +470,55 @@ yahoo_buddy_icon_upload_data_free(d); return; } + /* use whole URL if using HTTP Proxy */ + if ((gc->account->proxy_info) + && (gc->account->proxy_info->type == PURPLE_PROXY_HTTP)) + use_whole_url = TRUE; - pkt = yahoo_packet_new(0xc2, YAHOO_STATUS_AVAILABLE, yd->session_id); + pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE_UPLOAD, YAHOO_STATUS_AVAILABLE, yd->session_id); - size = g_strdup_printf("%" G_GSIZE_FORMAT, d->str->len); + tmp = g_strdup_printf("%" G_GSIZE_FORMAT, d->str->len); /* 1 = me, 38 = expire time(?), 0 = me, 28 = size, 27 = filename, 14 = NULL, 29 = data */ yahoo_packet_hash_str(pkt, 1, purple_connection_get_display_name(gc)); yahoo_packet_hash_str(pkt, 38, "604800"); /* time til expire */ purple_account_set_int(account, YAHOO_PICEXPIRE_SETTING, time(NULL) + 604800); yahoo_packet_hash_str(pkt, 0, purple_connection_get_display_name(gc)); - yahoo_packet_hash_str(pkt, 28, size); - g_free(size); + yahoo_packet_hash_str(pkt, 28, tmp); + g_free(tmp); yahoo_packet_hash_str(pkt, 27, d->filename); yahoo_packet_hash_str(pkt, 14, ""); + /* 4 padding for the 29 key name */ + pkt_buf_len = yahoo_packet_build(pkt, 4, FALSE, yd->jp, &pkt_buf); + yahoo_packet_free(pkt); - content_length = YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt); + /* header + packet + "29" + 0xc0 + 0x80) + pictureblob */ host = purple_account_get_string(account, "xfer_host", YAHOO_XFER_HOST); port = purple_account_get_int(account, "xfer_port", YAHOO_XFER_PORT); - header = g_strdup_printf( - "POST http://%s:%d/notifyft HTTP/1.0\r\n" - "Content-length: %" G_GSIZE_FORMAT "\r\n" - "Host: %s:%d\r\n" - "Cookie: Y=%s; T=%s\r\n" - "\r\n", - host, port, content_length + 4 + d->str->len, - host, port, yd->cookie_y, yd->cookie_t); + tmp = g_strdup_printf("%s:%d", host, port); + header = g_strdup_printf("POST %s%s/notifyft HTTP/1.1\r\n" + "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\n" + "Cookie: T=%s; Y=%s\r\n" + "Host: %s\r\n" + "Content-Length: %" G_GSIZE_FORMAT "\r\n" + "Cache-Control: no-cache\r\n\r\n", + use_whole_url ? "http://" : "", use_whole_url ? tmp : "", + yd->cookie_t, yd->cookie_y, + tmp, + pkt_buf_len + 4 + d->str->len); + g_free(tmp); /* There's no magic here, we just need to prepend in reverse order */ g_string_prepend(d->str, "29\xc0\x80"); - pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, yd->jp, &pkt_buf); - yahoo_packet_free(pkt); g_string_prepend_len(d->str, (char *)pkt_buf, pkt_buf_len); g_free(pkt_buf); g_string_prepend(d->str, header); g_free(header); + purple_debug_info("yahoo", "Buddy icon upload data:\n%.*s\n", d->str->len, d->str->str); + d->fd = source; d->watcher = purple_input_add(d->fd, PURPLE_INPUT_WRITE, yahoo_buddy_icon_upload_pending, d); @@ -525,6 +549,28 @@ } } +static int yahoo_buddy_icon_calculate_checksum(const guchar *data, gsize len) +{ + /* This code is borrowed from Kopete, which seems to be managing to calculate + checksums in such a manner that Yahoo!'s servers are happy */ + + const guchar *p = data; + int checksum = 0, g, i = len; + + while(i--) { + checksum = (checksum << 4) + *p++; + + if((g = (checksum & 0xf0000000)) != 0) + checksum ^= g >> 23; + + checksum &= ~g; + } + + purple_debug_misc("yahoo", "Calculated buddy icon checksum: %d", checksum); + + return checksum; +} + void yahoo_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img) { struct yahoo_data *yd = gc->proto_data; @@ -534,6 +580,8 @@ g_free(yd->picture_url); yd->picture_url = NULL; + /* TODO: don't we have to clear it on the server too?! */ + purple_account_set_string(account, YAHOO_PICURL_SETTING, NULL); purple_account_set_int(account, YAHOO_PICCKSUM_SETTING, 0); purple_account_set_int(account, YAHOO_PICEXPIRE_SETTING, 0); @@ -549,14 +597,8 @@ int oldcksum = purple_account_get_int(account, YAHOO_PICCKSUM_SETTING, 0); int expire = purple_account_get_int(account, YAHOO_PICEXPIRE_SETTING, 0); const char *oldurl = purple_account_get_string(account, YAHOO_PICURL_SETTING, NULL); - char *iconfile; - /* TODO: At some point, it'd be nice to fix this for real, or - * TODO: at least change it to be something like: - * TODO: purple_imgstore_get_filename(img); - * TODO: But it would be great if we knew how to calculate the - * TODO: Checksum correctly. */ - yd->picture_checksum = g_string_hash(s); + yd->picture_checksum = yahoo_buddy_icon_calculate_checksum(data, len); if ((yd->picture_checksum == oldcksum) && (expire > (time(NULL) + 60*60*24)) && oldurl) @@ -569,12 +611,11 @@ } /* We use this solely for sending a filename to the server */ - iconfile = g_strdup(purple_imgstore_get_filename(img)); d = g_new0(struct yahoo_buddy_icon_upload_data, 1); d->gc = gc; d->str = s; d->fd = -1; - d->filename = iconfile; + d->filename = g_strdup(purple_imgstore_get_filename(img)); if (!yd->logged_in) { yd->picture_upload_todo = d; diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/protocols/yahoo/yahoo_profile.c --- a/libpurple/protocols/yahoo/yahoo_profile.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo_profile.c Mon Jun 09 04:17:31 2008 +0000 @@ -748,6 +748,7 @@ p += 1; /* skip only the ' ' */ q = strchr(p, ' '); if (q) { + g_free(it); it = g_strndup(p, q - p); } } diff -r d201287d3a0e -r 81ebe4fac9ce libpurple/server.c --- a/libpurple/server.c Wed Jun 04 05:13:07 2008 +0000 +++ b/libpurple/server.c Mon Jun 09 04:17:31 2008 +0000 @@ -151,7 +151,6 @@ */ auto_reply_pref = purple_prefs_get_string("/purple/away/auto_reply"); if((gc->flags & PURPLE_CONNECTION_AUTO_RESP) && - flags & PURPLE_MESSAGE_AUTO_RESP && !purple_presence_is_available(presence) && strcmp(auto_reply_pref, "never")) { diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/gtkblist.c --- a/pidgin/gtkblist.c Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/gtkblist.c Mon Jun 09 04:17:31 2008 +0000 @@ -3264,7 +3264,7 @@ /* Accounts menu */ { N_("/_Accounts"), NULL, NULL, 0, "", NULL }, - { N_("/Accounts/Manage"), "A", pidgin_accounts_window_show, 0, "", NULL }, + { N_("/Accounts/Manage Accounts"), "A", pidgin_accounts_window_show, 0, "", NULL }, /* Tools */ { N_("/_Tools"), NULL, NULL, 0, "", NULL }, @@ -5314,7 +5314,7 @@ tmp = g_strdup_printf(_("Welcome to %s!\n\n" "You have no accounts enabled. Enable your IM accounts from the " - "Accounts window at Accounts->Manage. Once you " + "Accounts window at Accounts->Manage Accounts. Once you " "enable accounts, you'll be able to sign on, set your status, " "and talk to your friends."), PIDGIN_NAME); pretty = pidgin_make_pretty_arrows(tmp); @@ -6483,6 +6483,10 @@ purple_blist_add_buddy(b, NULL, g, NULL); purple_account_add_buddy(data->account, b); + /* Offer to merge people with the same alias. */ + if (whoalias != NULL) + gtk_blist_auto_personize(g, whoalias); + /* * XXX * It really seems like it would be better if the call to @@ -7618,7 +7622,7 @@ for (l = gtk_container_get_children(GTK_CONTAINER(accountmenu)); l; l = g_list_delete_link(l, l)) { menuitem = l->data; - if (menuitem != gtk_item_factory_get_widget(gtkblist->ift, N_("/Accounts/Manage"))) + if (menuitem != gtk_item_factory_get_widget(gtkblist->ift, N_("/Accounts/Manage Accounts"))) gtk_widget_destroy(menuitem); } diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/gtkft.c --- a/pidgin/gtkft.c Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/gtkft.c Mon Jun 09 04:17:31 2008 +0000 @@ -226,8 +226,10 @@ total_pct = 100 * total_bytes_xferred / total_file_size; } - title = g_strdup_printf(_("File Transfers - %d%% of %d files"), - total_pct, num_active_xfers); + title = g_strdup_printf(ngettext("File Transfers - %d%% of %d file", + "File Transfers - %d%% of %d files", + num_active_xfers), + total_pct, num_active_xfers); gtk_window_set_title(GTK_WINDOW(dialog->window), title); g_free(title); } else { diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/gtkimhtml.c Mon Jun 09 04:17:31 2008 +0000 @@ -5040,9 +5040,9 @@ str += g_snprintf(str, sizeof(buf) - (str - buf), "color: #%02x%02x%02x;", color->red >> 8, color->green >> 8, color->blue >> 8); - gdk_color_free(color); empty = FALSE; } + gdk_color_free(color); /* Background color */ g_object_get(obj, "background-set", &isset, "background-gdk", &color, NULL); @@ -5050,9 +5050,9 @@ str += g_snprintf(str, sizeof(buf) - (str - buf), "background: #%02x%02x%02x;", color->red >> 8, color->green >> 8, color->blue >> 8); - gdk_color_free(color); empty = FALSE; } + gdk_color_free(color); /* Underline */ g_object_get(obj, "underline-set", &isset, "underline", &ivalue, NULL); @@ -5260,8 +5260,10 @@ if (tmp == NULL) purple_debug_warning("gtkimhtml", "empty queue, more closing tags than open tags!\n"); - else + else { g_string_append(str, tmp->end); + text_tag_data_destroy(tmp); + } while ((tmp = g_queue_pop_head(r))) { g_string_append(str, tmp->start); diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/gtksavedstatuses.c --- a/pidgin/gtksavedstatuses.c Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/gtksavedstatuses.c Mon Jun 09 04:17:31 2008 +0000 @@ -59,6 +59,7 @@ STATUS_WINDOW_COLUMN_MESSAGE, /** A hidden column containing a pointer to the editor for this saved status. */ STATUS_WINDOW_COLUMN_WINDOW, + STATUS_WINDOW_COLUMN_ICON, STATUS_WINDOW_NUM_COLUMNS }; @@ -80,6 +81,7 @@ STATUS_EDITOR_COLUMN_STATUS_ID, STATUS_EDITOR_COLUMN_STATUS_NAME, STATUS_EDITOR_COLUMN_STATUS_MESSAGE, + STATUS_EDITOR_COLUMN_STATUS_ICON, STATUS_EDITOR_NUM_COLUMNS }; @@ -392,12 +394,35 @@ g_list_free(sel_paths); } +static const gchar * +get_stock_icon_from_primitive(PurpleStatusPrimitive type) +{ + switch (type) { + case PURPLE_STATUS_AVAILABLE: + return PIDGIN_STOCK_STATUS_AVAILABLE; + case PURPLE_STATUS_AWAY: + return PIDGIN_STOCK_STATUS_AWAY; + case PURPLE_STATUS_EXTENDED_AWAY: + return PIDGIN_STOCK_STATUS_XA; + case PURPLE_STATUS_INVISIBLE: + return PIDGIN_STOCK_STATUS_INVISIBLE; + case PURPLE_STATUS_OFFLINE: + return PIDGIN_STOCK_STATUS_OFFLINE; + case PURPLE_STATUS_UNAVAILABLE: + return PIDGIN_STOCK_STATUS_BUSY; + default: + /* this shouldn't happen */ + return NULL; + } +} + static void add_status_to_saved_status_list(GtkListStore *model, PurpleSavedStatus *saved_status) { GtkTreeIter iter; const char *title; const char *type; + const gchar *icon; char *message; if (purple_savedstatus_is_transient(saved_status)) @@ -406,14 +431,16 @@ title = purple_savedstatus_get_title(saved_status); type = purple_primitive_get_name_from_type(purple_savedstatus_get_type(saved_status)); message = purple_markup_strip_html(purple_savedstatus_get_message(saved_status)); + icon = get_stock_icon_from_primitive(purple_savedstatus_get_type(saved_status)); gtk_list_store_append(model, &iter); gtk_list_store_set(model, &iter, + STATUS_WINDOW_COLUMN_ICON, icon, STATUS_WINDOW_COLUMN_TITLE, title, STATUS_WINDOW_COLUMN_TYPE, type, STATUS_WINDOW_COLUMN_MESSAGE, message, -1); - free(message); + g_free(message); } static void @@ -479,7 +506,8 @@ G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_POINTER); + G_TYPE_POINTER, + G_TYPE_STRING); /* Create the treeview */ treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dialog->model)); @@ -517,6 +545,10 @@ gtk_tree_view_column_set_sort_column_id(column, STATUS_WINDOW_COLUMN_TYPE); gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); + renderer = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(column, renderer, TRUE); + gtk_tree_view_column_add_attribute(column, renderer, "stock-id", + STATUS_WINDOW_COLUMN_ICON); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_add_attribute(column, renderer, "text", @@ -717,8 +749,8 @@ } -static gboolean -status_editor_destroy_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data) +static void +status_editor_destroy_cb(GtkWidget *widget, gpointer user_data) { StatusEditor *dialog = user_data; @@ -726,19 +758,13 @@ g_free(dialog->original_title); g_object_unref(G_OBJECT(dialog->model)); g_free(dialog); - - return FALSE; } static void status_editor_cancel_cb(GtkButton *button, gpointer user_data) { StatusEditor *dialog = user_data; - - status_editor_remove_dialog(dialog); gtk_widget_destroy(dialog->window); - g_free(dialog->original_title); - g_free(dialog); } static void @@ -842,20 +868,11 @@ g_free(message); g_free(unformatted); - status_editor_remove_dialog(dialog); - gtk_widget_destroy(dialog->window); - g_free(dialog->original_title); - -/* - if (status_window != NULL) - add_status_to_saved_status_list(status_window->model, saved_status); -*/ - /* If they clicked on "Save & Use" or "Use," then activate the status */ if (button != dialog->save_button) purple_savedstatus_activate(saved_status); - g_free(dialog); + gtk_widget_destroy(dialog->window); } static void @@ -871,6 +888,26 @@ } static GtkWidget * +create_stock_item(const gchar *str, const gchar *icon) +{ + GtkWidget *menuitem = gtk_menu_item_new(); + GtkWidget *label = gtk_label_new_with_mnemonic(str); + GtkWidget *hbox = gtk_hbox_new(FALSE, 4); + GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); + GtkWidget *image = gtk_image_new_from_stock(icon, icon_size);; + + gtk_widget_show(label); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); + + gtk_container_add(GTK_CONTAINER(menuitem), hbox); + + return menuitem; +} + +static GtkWidget * create_status_type_menu(PurpleStatusPrimitive type) { int i; @@ -889,7 +926,9 @@ * status types, so don't show them in the list. */ continue; - item = gtk_menu_item_new_with_label(purple_primitive_get_name_from_type(i)); + + item = create_stock_item(purple_primitive_get_name_from_type(i), + get_stock_icon_from_primitive(i)); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); } @@ -945,6 +984,7 @@ STATUS_EDITOR_COLUMN_STATUS_ID, NULL, STATUS_EDITOR_COLUMN_STATUS_NAME, NULL, STATUS_EDITOR_COLUMN_STATUS_MESSAGE, NULL, + STATUS_EDITOR_COLUMN_STATUS_ICON, NULL, -1); } } @@ -990,6 +1030,10 @@ gtk_tree_view_column_set_title(column, _("Status")); gtk_tree_view_insert_column(GTK_TREE_VIEW(dialog->treeview), column, -1); gtk_tree_view_column_set_resizable(column, TRUE); + renderer = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(column, renderer, FALSE); + gtk_tree_view_column_add_attribute(column, renderer, "stock-id", + STATUS_EDITOR_COLUMN_STATUS_ICON); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_add_attribute(column, renderer, "text", @@ -1016,6 +1060,7 @@ { GdkPixbuf *pixbuf; const char *id = NULL, *name = NULL, *message = NULL; + PurpleStatusPrimitive prim = PURPLE_STATUS_UNSET; pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); if ((pixbuf != NULL) && !purple_account_is_connected(account)) @@ -1030,6 +1075,7 @@ type = purple_savedstatus_substatus_get_type(substatus); id = purple_status_type_get_id(type); name = purple_status_type_get_name(type); + prim = purple_status_type_get_primitive(type); if (purple_status_type_get_attr(type, "message")) message = purple_savedstatus_substatus_get_message(substatus); } @@ -1042,6 +1088,7 @@ STATUS_EDITOR_COLUMN_STATUS_ID, id, STATUS_EDITOR_COLUMN_STATUS_NAME, name, STATUS_EDITOR_COLUMN_STATUS_MESSAGE, message, + STATUS_EDITOR_COLUMN_STATUS_ICON, get_stock_icon_from_primitive(prim), -1); if (pixbuf != NULL) @@ -1133,7 +1180,7 @@ dialog->window = win = pidgin_create_dialog(_("Status"), PIDGIN_HIG_BORDER, "status", TRUE); - g_signal_connect(G_OBJECT(win), "delete_event", + g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(status_editor_destroy_cb), dialog); /* Setup the vbox */ @@ -1198,6 +1245,7 @@ G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING); /* Create the treeview */ @@ -1325,25 +1373,20 @@ } } -static gboolean -substatus_editor_destroy_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data) +static void +substatus_editor_destroy_cb(GtkWidget *widget, gpointer user_data) { SubStatusEditor *dialog = user_data; substatus_editor_remove_dialog(dialog); g_free(dialog); - - return FALSE; } static void substatus_editor_cancel_cb(GtkButton *button, gpointer user_data) { SubStatusEditor *dialog = user_data; - - substatus_editor_remove_dialog(dialog); gtk_widget_destroy(dialog->window); - g_free(dialog); } @@ -1356,12 +1399,11 @@ PurpleStatusType *type; char *id = NULL; char *message = NULL; - const char *name = NULL; + const char *name = NULL, *stock = NULL; if (!gtk_combo_box_get_active_iter(dialog->box, &iter)) { gtk_widget_destroy(dialog->window); - g_free(dialog); return; } @@ -1372,6 +1414,7 @@ if (purple_status_type_get_attr(type, "message") != NULL) message = gtk_imhtml_get_markup(GTK_IMHTML(dialog->message)); name = purple_status_type_get_name(type); + stock = get_stock_icon_from_primitive(purple_status_type_get_primitive(type)); status_editor = dialog->status_editor; @@ -1383,13 +1426,13 @@ STATUS_EDITOR_COLUMN_STATUS_NAME, name, STATUS_EDITOR_COLUMN_STATUS_MESSAGE, message, STATUS_EDITOR_COLUMN_WINDOW, NULL, + STATUS_EDITOR_COLUMN_STATUS_ICON, stock, -1); } gtk_widget_destroy(dialog->window); g_free(id); g_free(message); - g_free(dialog); } static void @@ -1438,7 +1481,7 @@ dialog->window = win = pidgin_create_dialog(tmp, PIDGIN_HIG_BORDER, "substatus", TRUE); g_free(tmp); - g_signal_connect(G_OBJECT(win), "delete_event", + g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(substatus_editor_destroy_cb), dialog); /* Setup the vbox */ diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/available.png Binary file pidgin/pixmaps/status/16/available.png has changed diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/away.png Binary file pidgin/pixmaps/status/16/away.png has changed diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/busy.png Binary file pidgin/pixmaps/status/16/busy.png has changed diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/chat.png Binary file pidgin/pixmaps/status/16/chat.png has changed diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/offline.png Binary file pidgin/pixmaps/status/16/offline.png has changed diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/person.png Binary file pidgin/pixmaps/status/16/person.png has changed diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/scalable/available.svg --- a/pidgin/pixmaps/status/16/scalable/available.svg Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/pixmaps/status/16/scalable/available.svg Mon Jun 09 04:17:31 2008 +0000 @@ -2,7 +2,7 @@ + + + + + + x1="11.127699" + y1="10.823074" + x2="30.341434" + y2="31.325201" /> + + + + + + + + inkscape:window-width="1440" + inkscape:window-height="847" + inkscape:window-x="0" + inkscape:window-y="22" + inkscape:snap-bbox="true" + inkscape:snap-nodes="false" + objecttolerance="13" + gridtolerance="10"> + + @@ -265,14 +328,24 @@ inkscape:groupmode="layer" id="layer1"> + id="path4331" + transform="matrix(0.538297,0,0,0.538297,-1.630177,-1.459246)" /> + + sodipodi:type="arc" + style="opacity:0.19499996000000000;fill:#ffffff;fill-opacity:1;stroke:none;filter:url(#filter3374)" + id="path3302" + sodipodi:cx="11.484269" + sodipodi:cy="4.7465701" + sodipodi:rx="1.8659533" + sodipodi:ry="1.9428998" + d="m 13.350222,4.7465701 a 1.8659533,1.9428998 0 1 1 -3.7319067,0 A 1.8659533,1.9428998 0 1 1 13.350222,4.7465701 z" + transform="matrix(2.2014717,-1.281888,0.9447394,1.6503281,-23.266565,12.888149)" /> diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/scalable/away.svg --- a/pidgin/pixmaps/status/16/scalable/away.svg Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/pixmaps/status/16/scalable/away.svg Mon Jun 09 04:17:31 2008 +0000 @@ -2,7 +2,7 @@ + + + + + + + + + + + + inkscape:grid-points="true" + objecttolerance="14" + gridtolerance="18" + inkscape:snap-bbox="true" + inkscape:snap-nodes="false"> + + @@ -148,7 +208,7 @@ id="layer1"> + + + + + + + + + - - - - - + gradientTransform="matrix(0.482882,0,0,0.482874,0.269812,0.2698205)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + inkscape:window-width="1440" + inkscape:window-height="847" + inkscape:window-x="0" + inkscape:window-y="22"> + + @@ -223,7 +470,7 @@ transform="matrix(0.468971,0,0,0.468971,0.730372,0.26987)" /> + + rx="1.0387781" + ry="1.0387781" /> diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/scalable/chat.svg --- a/pidgin/pixmaps/status/16/scalable/chat.svg Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/pixmaps/status/16/scalable/chat.svg Mon Jun 09 04:17:31 2008 +0000 @@ -2,92 +2,313 @@ + inkscape:output_extension="org.inkscape.output.svg.inkscape" + version="1.0"> + id="defs7382"> + + + + + id="linearGradient3483"> + + + + + id="stop3477" /> + id="stop3479" /> + + + + + id="linearGradient3335"> + + + + + id="stop3329" /> + + + + + + + + + + + id="stop7304" /> + id="linearGradient3816"> + id="stop3818" /> + id="stop3820" /> + + + + + + + + + + + + + + + inkscape:window-width="1440" + inkscape:window-height="847" + inkscape:window-x="0" + inkscape:window-y="22" + width="11px" + height="11px" + inkscape:snap-nodes="false" + inkscape:snap-bbox="true" + objecttolerance="7" + gridtolerance="7" + showguides="true" + inkscape:guide-bbox="true"> + + + id="metadata7385"> @@ -125,91 +360,80 @@ inkscape:label="Layer 1" inkscape:groupmode="layer"> - - - - + style="opacity:1;color:#000000;fill:#855b8c;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3307);stroke-width:0.99999987999999995px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible" + d="m 9.2852706,13.499999 3.6531493,0 c 1.0350584,0 2.059811,-0.3777864 2.4354322,-1.4545452 C 15.730548,11.022944 15.434737,9.0757587 13.121077,7.5000022 l -4.3228932,0 C 6.4845226,8.9545462 6.1953886,10.943768 6.7280666,12.106061 7.2707356,13.290156 8.1893256,13.5 9.2852706,13.5 z" + id="path3443" + sodipodi:nodetypes="cczcczc" /> + inkscape:radius="-1.1784238" + inkscape:original="M 24.5625 24.125 C 17.844986 28.367641 17.015916 34.172303 18.5625 37.5625 C 20.138096 41.016289 22.818019 41.625 26 41.625 L 36.59375 41.625 C 39.598953 41.624999 42.565667 40.546959 43.65625 37.40625 C 44.691891 34.423774 43.842514 28.721194 37.125 24.125 L 24.5625 24.125 z " + style="opacity:0.5;color:#000000;fill:url(#radialGradient3449);fill-opacity:1;fill-rule:evenodd;stroke:#eeeeec;stroke-width:3.58186674000000016px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible" + id="path3445" + d="m 24.96875,25.3125 c -6.080867,3.980556 -6.594767,9.007702 -5.34375,11.75 0.693936,1.521145 1.541625,2.278662 2.5625,2.75 1.020875,0.471338 2.296653,0.625 3.8125,0.625 l 10.59375,0 c 1.361692,0 2.658712,-0.23791 3.6875,-0.78125 1.028788,-0.54334 1.79962,-1.327976 2.25,-2.625 0.804003,-2.315397 0.274744,-7.39869 -5.8125,-11.71875 z" + transform="matrix(0.2947246,0,0,0.2644629,1.8788978,1.8057826)" /> + + + + - - - + inkscape:radius="-1.1784238" + inkscape:original="M 24.5625 24.125 C 17.844986 28.367641 17.015916 34.172303 18.5625 37.5625 C 20.138096 41.016289 22.818019 41.625 26 41.625 L 36.59375 41.625 C 39.598953 41.624999 42.565667 40.546959 43.65625 37.40625 C 44.691891 34.423774 43.842514 28.721194 37.125 24.125 L 24.5625 24.125 z " + style="opacity:0.5;color:#000000;fill:url(#radialGradient2631);fill-opacity:1;fill-rule:evenodd;stroke:#eeeeec;stroke-width:3.58186674000000016px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible" + id="path7281" + d="m 24.96875,25.3125 c -6.080867,3.980556 -6.594767,9.007702 -5.34375,11.75 0.693936,1.521145 1.541625,2.278662 2.5625,2.75 1.020875,0.471338 2.296653,0.625 3.8125,0.625 l 10.59375,0 c 1.361692,0 2.658712,-0.23791 3.6875,-0.78125 1.028788,-0.54334 1.79962,-1.327976 2.25,-2.625 0.804003,-2.315397 0.274744,-7.39869 -5.8125,-11.71875 z" + transform="matrix(0.2947246,0,0,0.2644629,-4.1211012,3.8057819)" /> + + + diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/scalable/offline.svg --- a/pidgin/pixmaps/status/16/scalable/offline.svg Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/pixmaps/status/16/scalable/offline.svg Mon Jun 09 04:17:31 2008 +0000 @@ -2,7 +2,7 @@ + id="linearGradient3303"> + id="stop3305" /> + id="stop3307" /> + id="linearGradient3295"> + + + + + + + + @@ -153,6 +175,33 @@ x2="12.233074" y2="27.77807" gradientUnits="userSpaceOnUse" /> + + + + inkscape:window-width="1440" + inkscape:window-height="847" + inkscape:window-x="0" + inkscape:window-y="22" + inkscape:snap-nodes="false" + inkscape:snap-bbox="true" + objecttolerance="11" + gridtolerance="10"> + + @@ -188,7 +248,7 @@ inkscape:groupmode="layer" id="layer1"> + d="M 8,1.5 C 6.3326173,1.5001739 4.674966,2.1375335 3.40625,3.40625 c -2.5414588,2.5414597 -2.5408663,6.646632 0,9.1875 2.5408654,2.540866 6.646043,2.541459 9.1875,0 2.541459,-2.541458 2.540866,-6.6466333 0,-9.1875 C 11.325315,2.1378146 9.6669929,1.4998261 8,1.5 z" + transform="matrix(-1.000056,0,0,-1.000028,16.000461,16.000041)" /> + diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/pixmaps/status/16/scalable/person.svg --- a/pidgin/pixmaps/status/16/scalable/person.svg Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/pixmaps/status/16/scalable/person.svg Mon Jun 09 04:17:31 2008 +0000 @@ -2,26 +2,107 @@ + inkscape:export-ydpi="90" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + version="1.0"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + inkscape:window-width="1440" + inkscape:window-height="847" + inkscape:window-x="0" + inkscape:window-y="22" + width="11px" + height="11px" + inkscape:snap-nodes="false" + inkscape:snap-bbox="true" + objecttolerance="7" + gridtolerance="7" + showguides="true" + inkscape:guide-bbox="true"> + + @@ -145,44 +395,42 @@ inkscape:label="Layer 1" inkscape:groupmode="layer"> + style="opacity:1;color:#000000;fill:#855b8c;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3307);stroke-width:0.99999963999999997px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible" + d="m 5.5947456,15.499992 4.0590553,0 c 1.1500651,0 2.2886792,-0.44075079 2.7060362,-1.6969693 C 12.756166,12.610095 12.427487,10.338379 9.856753,8.4999962 l -4.8032154,0 C 2.4828029,10.196964 2.1615429,12.517723 2.7534074,13.873731 c 0.6029656,1.381444 1.6236213,1.626262 2.8413382,1.626262 z" + id="path3443" + sodipodi:nodetypes="cczcczc" /> + style="opacity:0.5;color:#000000;fill:url(#linearGradient3300);fill-opacity:1;fill-rule:evenodd;stroke:#eeeeec;stroke-width:2.99680495px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible" + id="path3445" + d="m 24.96875,25.3125 c -6.080867,3.980556 -6.594767,9.007702 -5.34375,11.75 0.693936,1.521145 1.541625,2.278662 2.5625,2.75 1.020875,0.471338 2.296653,0.625 3.8125,0.625 l 10.59375,0 c 1.361692,0 2.658712,-0.23791 3.6875,-0.78125 1.028788,-0.54334 1.79962,-1.327976 2.25,-2.625 0.804003,-2.315397 0.274744,-7.39869 -5.8125,-11.71875 z" + transform="matrix(-0.3368281,0,0,0.3305786,17.924115,1.1322288)" /> + d="m 39.774755,19.008621 a 8.6620579,8.6620579 0 1 1 -17.324116,0 A 8.6620579,8.6620579 0 1 1 39.774755,19.008621 z" + transform="matrix(0.57723,0,0,0.5772299,-10.459182,-5.4723453)" /> + transform="matrix(0.461784,0,0,0.461784,-6.8673454,-3.2778773)" /> diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/plugins/Makefile.mingw --- a/pidgin/plugins/Makefile.mingw Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/plugins/Makefile.mingw Mon Jun 09 04:17:31 2008 +0000 @@ -84,6 +84,7 @@ notify.dll \ pidginrc.dll \ relnot.dll \ + sendbutton.dll \ spellchk.dll \ timestamp_format.dll \ timestamp.dll diff -r d201287d3a0e -r 81ebe4fac9ce pidgin/win32/nsis/pidgin-installer.nsi --- a/pidgin/win32/nsis/pidgin-installer.nsi Wed Jun 04 05:13:07 2008 +0000 +++ b/pidgin/win32/nsis/pidgin-installer.nsi Mon Jun 09 04:17:31 2008 +0000 @@ -748,6 +748,7 @@ Delete "$INSTDIR\plugins\pidginrc.dll" Delete "$INSTDIR\plugins\psychic.dll" Delete "$INSTDIR\plugins\relnot.dll" + Delete "$INSTDIR\plugins\sendbutton.dll" Delete "$INSTDIR\plugins\spellchk.dll" Delete "$INSTDIR\plugins\ssl-nss.dll" Delete "$INSTDIR\plugins\ssl.dll" diff -r d201287d3a0e -r 81ebe4fac9ce po/lt.po --- a/po/lt.po Wed Jun 04 05:13:07 2008 +0000 +++ b/po/lt.po Mon Jun 09 04:17:31 2008 +0000 @@ -721,8 +721,11 @@ msgstr "Pristabdyti" #, c-format -msgid "File Transfers - %d%% of %d files" -msgstr "Failų perdavimai – %d%% iš %d" +msgid "File Transfers - %d%% of %d file" +msgid_plural "File Transfers - %d%% of %d files" +msgstr[0] "Failų perdavimai – %d%% iš %d failo" +msgstr[1] "Failų perdavimai – %d%% iš %d failų" +msgstr[2] "Failų perdavimai – %d%% iš %d failų" #. Create the window. msgid "File Transfers" @@ -3258,8 +3261,11 @@ msgstr "Bloga būsena" #, c-format -msgid "Ban on %s by %s, set %ld seconds ago" -msgstr "Vartotojui %s uždraudė prisijungti %s prieš %ld sekundžių" +msgid "Ban on %s by %s, set %ld second ago" +msgid_plural "Ban on %s by %s, set %ld seconds ago" +msgstr[0] "Vartotojui %s uždraudė prisijungti %s prieš %ld sekundę" +msgstr[1] "Vartotojui %s uždraudė prisijungti %s prieš %ld sekundes" +msgstr[2] "Vartotojui %s uždraudė prisijungti %s prieš %ld sekundžių" #, c-format msgid "Ban on %s" @@ -5439,8 +5445,11 @@ msgstr "Prisijungiama" #, c-format -msgid "Connection to server lost (no data received within %d seconds)" -msgstr "Nutrūko ryšys su serveriu (negauta jokių duomenų per %d sekundžių)" +msgid "Connection to server lost (no data received within %d second)" +msgid_plural "Connection to server lost (no data received within %d seconds)" +msgstr[0] "Nutrūko ryšys su serveriu (negauta jokių duomenų per %d sekundę)" +msgstr[1] "Nutrūko ryšys su serveriu (negauta jokių duomenų per %d sekundes)" +msgstr[2] "Nutrūko ryšys su serveriu (negauta jokių duomenų per %d sekundžių)" #. Can't write _()'d strings in array initializers. Workaround. msgid "New mail messages" @@ -5538,9 +5547,18 @@ #, c-format msgid "" +"%d buddy was added or updated from the server (including buddies already on " +"the server-side list)" +msgid_plural "" "%d buddies were added or updated from the server (including buddies already " "on the server-side list)" -msgstr "" +msgstr[0] "" +"%d bičiulis buvo pridėtas ar atnaujintas iš serverio (įskaitant ir " +"bičiulius, jau esančius serverio sąraše)" +msgstr[1] "" +"%d bičiuliai buvo pridėti ar atnaujinti iš serverio (įskaitant ir bičiulius, " +"jau esančius serverio sąraše)" +msgstr[2] "" "%d bičiulių buvo pridėta ar atnaujinta iš serverio (įskaitant ir bičiulius, " "jau esančius serverio sąraše)" diff -r d201287d3a0e -r 81ebe4fac9ce share/ca-certs/Makefile.am --- a/share/ca-certs/Makefile.am Wed Jun 04 05:13:07 2008 +0000 +++ b/share/ca-certs/Makefile.am Mon Jun 09 04:17:31 2008 +0000 @@ -1,5 +1,4 @@ -cacertsdir = $(datadir)/purple/ca-certs -cacerts_DATA = \ +CERTIFICATES = \ Equifax_Secure_CA.pem \ GTE_CyberTrust_Global_Root.pem \ Microsoft_Secure_Server_Authority.pem \ @@ -7,7 +6,12 @@ Verisign_RSA_Secure_Server_CA.pem \ Verisign_Class3_Primary_CA.pem +if INSTALL_SSL_CERTIFICATES +cacertsdir = $(datadir)/purple/ca-certs +cacerts_DATA = $(CERTIFICATES) +endif + EXTRA_DIST = \ Makefile.mingw \ - $(cacerts_DATA) + $(CERTIFICATES)