# HG changeset patch # User Paul Aurich # Date 1247901964 0 # Node ID 1f329bdc91abfb4f4038bc83642c1612c4bba0e1 # Parent f95bcb5eb047bfb92d9c8a02dbe677fb66421f53# Parent a7eac81575e72a25cc1f1286c7b45474af3d0b2b propagate from branch 'im.pidgin.pidgin' (head 566ce451dc4c5c20f90b1d1f53b83a85aae04c34) to branch 'im.pidgin.cpw.darkrain42.2.6.1' (head beade7ac68d86ade412871d5d4aeb805b3952afb) diff -r f95bcb5eb047 -r 1f329bdc91ab libpurple/ft.c --- a/libpurple/ft.c Sat Jul 18 07:23:09 2009 +0000 +++ b/libpurple/ft.c Sat Jul 18 07:26:04 2009 +0000 @@ -1161,7 +1161,7 @@ if (purple_xfer_get_filename(xfer) != NULL) { - msg = g_strdup_printf(_("You canceled the transfer of %s"), + msg = g_strdup_printf(_("You cancelled the transfer of %s"), purple_xfer_get_filename(xfer)); } else @@ -1224,12 +1224,12 @@ if (purple_xfer_get_filename(xfer) != NULL) { - msg = g_strdup_printf(_("%s canceled the transfer of %s"), + msg = g_strdup_printf(_("%s cancelled the transfer of %s"), buddy ? purple_buddy_get_alias(buddy) : xfer->who, purple_xfer_get_filename(xfer)); } else { - msg = g_strdup_printf(_("%s canceled the file transfer"), + msg = g_strdup_printf(_("%s cancelled the file transfer"), buddy ? purple_buddy_get_alias(buddy) : xfer->who); } purple_xfer_conversation_write(xfer, msg, TRUE); diff -r f95bcb5eb047 -r 1f329bdc91ab libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Sat Jul 18 07:23:09 2009 +0000 +++ b/libpurple/protocols/oscar/oscar.c Sat Jul 18 07:26:04 2009 +0000 @@ -6335,6 +6335,44 @@ } static void +oscar_close_directim(gpointer object, gpointer ignored) +{ + PurpleBlistNode *node; + PurpleBuddy *buddy; + PurpleAccount *account; + PurpleConnection *gc; + PurpleConversation *conv; + OscarData *od; + PeerConnection *conn; + const char *name; + + node = object; + + g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); + + buddy = (PurpleBuddy*)node; + name = purple_buddy_get_name(buddy); + account = purple_buddy_get_account(buddy); + gc = purple_account_get_connection(account); + od = gc->proto_data; + conn = peer_connection_find_by_type(od, name, OSCAR_CAPABILITY_DIRECTIM); + + if (conn != NULL) + { + if (!conn->ready) + aim_im_sendch2_cancel(conn); + + peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); + + /* OSCAR_DISCONNECT_LOCAL_CLOSED doesn't write anything to the convo + * window. Let the user know that we canceled the Direct IM. */ + conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); + purple_conversation_write(conv, NULL, _("You closed the connection."), + PURPLE_MESSAGE_SYSTEM, time(NULL)); + } +} + +static void oscar_get_aim_info_cb(PurpleBlistNode *node, gpointer ignore) { PurpleBuddy *buddy; @@ -6397,11 +6435,23 @@ oscar_util_name_compare(purple_account_get_username(account), bname) && PURPLE_BUDDY_IS_ONLINE(buddy)) { + PeerConnection *conn; + conn = peer_connection_find_by_type(od, bname, OSCAR_CAPABILITY_DIRECTIM); + if (userinfo->capabilities & OSCAR_CAPABILITY_DIRECTIM) { - act = purple_menu_action_new(_("Direct IM"), - PURPLE_CALLBACK(oscar_ask_directim), - NULL, NULL); + if (conn) + { + act = purple_menu_action_new(_("Cancel Direct IM"), + PURPLE_CALLBACK(oscar_close_directim), + NULL, NULL); + } + else + { + act = purple_menu_action_new(_("Direct IM"), + PURPLE_CALLBACK(oscar_ask_directim), + NULL, NULL); + } menu = g_list_prepend(menu, act); } #if 0 diff -r f95bcb5eb047 -r 1f329bdc91ab libpurple/protocols/qq/send_file.c --- a/libpurple/protocols/qq/send_file.c Sat Jul 18 07:23:09 2009 +0000 +++ b/libpurple/protocols/qq/send_file.c Sat Jul 18 07:26:04 2009 +0000 @@ -730,7 +730,7 @@ */ filename = g_path_get_basename(purple_xfer_get_local_filename(qd->xfer)); msg = g_strdup_printf - (_("%d canceled the transfer of %s"), + (_("%d cancelled the transfer of %s"), sender_uid, filename); purple_notify_warning (gc, _("File Send"), msg, NULL);