pidgin: d54c6031: Autoaccept: Use file-transfer accessor f...

andrew.victor at mxit.com andrew.victor at mxit.com
Sun Oct 30 12:20:57 EDT 2011


----------------------------------------------------------------------
Revision: d54c60311859c3c3bb4153bc206e65f5fd650ae7
Parent:   2f52df3dff988ee35b40b877dd495bd2bc43ef7f
Author:   andrew.victor at mxit.com
Date:     10/30/11 11:42:24
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d54c60311859c3c3bb4153bc206e65f5fd650ae7

Changelog: 

Autoaccept: Use file-transfer accessor functions.


Changes against parent 2f52df3dff988ee35b40b877dd495bd2bc43ef7f

  patched  libpurple/plugins/autoaccept.c

-------------- next part --------------
============================================================
--- libpurple/plugins/autoaccept.c	a6540b7a7d2f48c141737052911b01b5e275b303
+++ libpurple/plugins/autoaccept.c	e334ca7184fb6a9d14510a1639456cb53272d369
@@ -73,10 +73,10 @@ auto_accept_complete_cb(PurpleXfer *xfer
 auto_accept_complete_cb(PurpleXfer *xfer, PurpleXfer *my)
 {
 	if (xfer == my && purple_prefs_get_bool(PREF_NOTIFY) &&
-			!purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, xfer->who, xfer->account))
+			!purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, purple_xfer_get_remote_user(xfer), purple_xfer_get_account(xfer)))
 	{
 		char *message = g_strdup_printf(_("Autoaccepted file transfer of \"%s\" from \"%s\" completed."),
-					xfer->filename, xfer->who);
+					purple_xfer_get_filename(xfer), purple_xfer_get_remote_user(xfer));
 		purple_notify_info(NULL, _("Autoaccept complete"), message, NULL);
 		g_free(message);
 	}
@@ -93,8 +93,8 @@ file_recv_request_cb(PurpleXfer *xfer, g
 
     int accept_setting;
 
-	account = xfer->account;
-	node = PURPLE_BLIST_NODE(purple_find_buddy(account, xfer->who));
+	account = purple_xfer_get_account(xfer);
+	node = PURPLE_BLIST_NODE(purple_find_buddy(account, purple_xfer_get_remote_user(xfer)));
 
 	/* If person is on buddy list, use the buddy setting; otherwise, use the
 	   stranger setting. */
@@ -121,7 +121,7 @@ file_recv_request_cb(PurpleXfer *xfer, g
 				gchar *ext;
 
 				if (purple_prefs_get_bool(PREF_NEWDIR))
-					dirname = g_build_filename(pref, purple_normalize(account, xfer->who), NULL);
+					dirname = g_build_filename(pref, purple_normalize(account, purple_xfer_get_remote_user(xfer)), NULL);
 				else
 					dirname = g_build_filename(pref, NULL);
 
@@ -133,9 +133,9 @@ file_recv_request_cb(PurpleXfer *xfer, g
 
 				/* Escape filename (if escaping is turned on) */
 				if (purple_prefs_get_bool(PREF_ESCAPE)) {
-					escape = purple_escape_filename(xfer->filename);
+					escape = purple_escape_filename(purple_xfer_get_filename(xfer));
 				} else {
-					escape = xfer->filename;
+					escape = purple_xfer_get_filename(xfer);
 				}
 				filename = g_build_filename(dirname, escape, NULL);
 
@@ -174,7 +174,7 @@ file_recv_request_cb(PurpleXfer *xfer, g
 								PURPLE_CALLBACK(auto_accept_complete_cb), xfer);
 			break;
 		case FT_REJECT:
-			xfer->status = PURPLE_XFER_STATUS_CANCEL_LOCAL;
+			purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_CANCEL_LOCAL);
 			break;
 	}
 }


More information about the Commits mailing list