changeset 17056:9af44da5a6b8

merge of '3906a45b801345d9fe5dde15ca9853fa78ee6839' and '67cdec8942297c0d814a437496e7dcc6189127a7'
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 12 May 2007 13:22:15 +0000
parents 8ee93c68ced0 (diff) 541c5ed54e90 (current diff)
children 34f698ffe88b
files
diffstat 5 files changed, 29 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/ft.c	Sat May 12 09:24:10 2007 +0000
+++ b/libpurple/ft.c	Sat May 12 13:22:15 2007 +0000
@@ -972,7 +972,8 @@
 
 	fseek(xfer->dest_fp, xfer->bytes_sent, SEEK_SET);
 
-	xfer->watcher = purple_input_add(xfer->fd, cond, transfer_cb, xfer);
+	if (xfer->fd)
+		xfer->watcher = purple_input_add(xfer->fd, cond, transfer_cb, xfer);
 
 	xfer->start_time = time(NULL);
 
--- a/libpurple/protocols/msn/msn.c	Sat May 12 09:24:10 2007 +0000
+++ b/libpurple/protocols/msn/msn.c	Sat May 12 13:22:15 2007 +0000
@@ -409,33 +409,7 @@
 static void
 t_msn_xfer_init(PurpleXfer *xfer)
 {
-	MsnSlpLink *slplink;
-	const char *filename;
-	FILE *fp;
-
-	filename = purple_xfer_get_local_filename(xfer);
-
-	slplink = xfer->data;
-
-	if ((fp = g_fopen(filename, "rb")) == NULL)
-	{
-		PurpleAccount *account;
-		const char *who;
-		char *msg;
-
-		account = slplink->session->account;
-		who = slplink->remote_user;
-
-		msg = g_strdup_printf(_("Error reading %s: \n%s.\n"),
-							  filename, strerror(errno));
-		purple_xfer_error(purple_xfer_get_type(xfer), account, xfer->who, msg);
-		purple_xfer_cancel_local(xfer);
-		g_free(msg);
-
-		return;
-	}
-	fclose(fp);
-
+	MsnSlpLink *slplink = xfer->data;
 	msn_slplink_request_ft(slplink, xfer);
 }
 
--- a/libpurple/protocols/msn/slp.c	Sat May 12 09:24:10 2007 +0000
+++ b/libpurple/protocols/msn/slp.c	Sat May 12 13:22:15 2007 +0000
@@ -158,7 +158,9 @@
 msn_xfer_completed_cb(MsnSlpCall *slpcall, const guchar *body,
 					  gsize size)
 {
-	purple_xfer_set_completed(slpcall->xfer, TRUE);
+	PurpleXfer *xfer = slpcall->xfer;
+	purple_xfer_set_completed(xfer, TRUE);
+	purple_xfer_end(xfer);
 }
 
 /**************************************************************************
--- a/libpurple/protocols/msn/slplink.c	Sat May 12 09:24:10 2007 +0000
+++ b/libpurple/protocols/msn/slplink.c	Sat May 12 13:22:15 2007 +0000
@@ -482,6 +482,8 @@
 {
 	MsnSlpCall *slpcall;
 	MsnSlpMessage *slpmsg;
+	struct stat st;
+	PurpleXfer *xfer;
 
 	slpcall = slpsession->slpcall;
 	slpmsg = msn_slpmsg_new(slpcall->slplink);
@@ -491,7 +493,12 @@
 #ifdef MSN_DEBUG_SLP
 	slpmsg->info = "SLP FILE";
 #endif
-	msn_slpmsg_open_file(slpmsg, purple_xfer_get_local_filename(slpcall->xfer));
+	xfer = (PurpleXfer *)slpcall->xfer;
+	purple_xfer_start(slpcall->xfer, 0, NULL, 0);
+	slpmsg->fp = xfer->dest_fp;
+	if (g_stat(purple_xfer_get_local_filename(xfer), &st) == 0)
+		slpmsg->size = st.st_size;
+	xfer->dest_fp = NULL; /* Disable double fclose() */
 
 	msn_slplink_send_slpmsg(slpcall->slplink, slpmsg);
 }
@@ -551,9 +558,10 @@
 
 					if (xfer != NULL)
 					{
-						slpmsg->fp =
-							g_fopen(purple_xfer_get_local_filename(slpmsg->slpcall->xfer),
-								  "wb");
+						purple_xfer_start(slpmsg->slpcall->xfer,
+							0, NULL, 0);
+						slpmsg->fp = ((PurpleXfer *)slpmsg->slpcall->xfer)->dest_fp;
+						xfer->dest_fp = NULL; /* Disable double fclose() */
 					}
 				}
 			}
--- a/pidgin.spec.in	Sat May 12 09:24:10 2007 +0000
+++ b/pidgin.spec.in	Sat May 12 13:22:15 2007 +0000
@@ -70,6 +70,10 @@
 # For some reason perl isn't always automatically detected as a requirement :(
 Requires: perl
 
+Requires(pre): GConf2
+Requires(post): GConf2
+Requires(preun): GConf2
+
 Obsoletes: gaim
 Provides: gaim
 
@@ -296,7 +300,7 @@
     if [ -f %{_sysconfdir}/gconf/schemas/purple.schemas ]; then
         gconftool-2 --makefile-uninstall-rule \
             %{_sysconfdir}/gconf/schemas/purple.schemas >/dev/null || :
-        killall -HUP gconfd-2 || :
+        killall -HUP gconfd-2 &> /dev/null || :
     fi
 fi
 
@@ -305,7 +309,7 @@
     export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
     gconftool-2 --makefile-install-rule \
         %{_sysconfdir}/gconf/schemas/purple.schemas > /dev/null || :
-    killall -HUP gconfd-2 || :
+    killall -HUP gconfd-2 &> /dev/null || :
 fi
 touch --no-create %{_datadir}/icons/hicolor || :
 %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
@@ -319,7 +323,7 @@
     export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
     gconftool-2 --makefile-uninstall-rule \
       %{_sysconfdir}/gconf/schemas/purple.schemas > /dev/null || :
-    killall -HUP gconfd-2 || :
+    killall -HUP gconfd-2 &> /dev/null || :
 fi
 
 %postun
@@ -443,6 +447,10 @@
 %endif
 
 %changelog
+* Thu May 10 2007 Stu Tomlinson <stu@nosnilmot.com>
+- Add scriptlet Requires for GConf2 to fix schema installation
+- Silence harmless errors when gconfd-2 is not running at install time
+
 * Thu May 3 2007 Stu Tomlinson <stu@nosnilmot.com>
 - Add missing BuildRequires: startup-notification-devel, if you really
   need to build on a distro without it use --without startupnotification