diff src/protocols/oscar/oscar.c @ 12143:cbebda5f019c

[gaim-migrate @ 14444] SF Patch #1360399 from Evan Schoenberg (evands) "I discussed this previously with Mark and he said it'd be fine. This factors out the part of the send_file function which creates a new GaimXfer into a separate prpl function, new_xfer. It's called in each of the existing send_file functions. This is needed so that another client (okay, Adium) can get a new outgoing GaimXfer from a prpl without depending upon the specific ft.c logic of send_file; previously I was adding a duplicate method to each prpl and then calling it directly." I fixed a couple small bugs in this. Otherwise, it looks good, and seems like a reasonable libgaim request. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sat, 19 Nov 2005 00:26:12 +0000
parents 980c877bd238
children 2de8b6772d00
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Sat Nov 19 00:16:45 2005 +0000
+++ b/src/protocols/oscar/oscar.c	Sat Nov 19 00:26:12 2005 +0000
@@ -2646,11 +2646,8 @@
 	return can_receive;
 }
 
-/*
- * Called by the Gaim core when the user indicates that a file is to be sent to
- * a special someone.
- */
-static void oscar_send_file(GaimConnection *gc, const char *who, const char *file) {
+static GaimXfer*
+oscar_new_xfer(GaimConnection *gc, const char *who) {
 	OscarData *od;
 	GaimXfer *xfer;
 	struct aim_oft_info *oft_info;
@@ -2677,7 +2674,7 @@
 			AIM_XFER_SEND, AIM_XFER_PROXY, AIM_XFER_PROXY_STG1);
 		oft_info->proxy_info = aim_rv_proxy_createinfo(oft_info->sess, NULL, 0);
 		/* We must create a cookie before the request is sent
-		* so that it can be sent to the proxy */
+		 * so that it can be sent to the proxy */
 		aim_icbm_makecookie(oft_info->cookie);
 	} else {
 		ip = gaim_network_get_my_ip(od->conn ? od->conn->fd : -1);
@@ -2699,6 +2696,16 @@
 	/* Keep track of this transfer for later */
 	od->file_transfers = g_slist_append(od->file_transfers, xfer);
 
+	return xfer;
+}
+
+/*
+ * Called by the Gaim core when the user indicates that a file is to be sent to
+ * a special someone.
+ */
+static void oscar_send_file(GaimConnection *gc, const char *who, const char *file) {
+	GaimXfer *xfer = oscar_new_xfer(gc, who);
+
 	/* Now perform the request */
 	if (file)
 		gaim_xfer_request_accepted(xfer, file);
@@ -8422,7 +8429,10 @@
 	NULL,					/* roomlist_cancel */
 	NULL,					/* roomlist_expand_category */
 	oscar_can_receive_file,	/* can_receive_file */
-	oscar_send_file			/* send_file */
+	oscar_send_file,		/* send_file */
+	oscar_new_xfer,			/* new_xfer */
+	NULL,					/* whiteboard ops */
+ 	NULL					/* media ops */
 };
 
 static GaimPluginUiInfo prefs_info = {