pidgin: 947fd3aa: Allow not creating a different directory...

sadrul at pidgin.im sadrul at pidgin.im
Sun Jul 13 13:21:19 EDT 2008


-----------------------------------------------------------------
Revision: 947fd3aa904cf2b1909e0b2d9f06352455573d21
Ancestor: 4c99155361db627c6ba1e256cf398156f9cd6d19
Author: Luke Bratch <l_bratch at yahoo.co.uk>
Date: 2008-07-13T17:20:41
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/947fd3aa904cf2b1909e0b2d9f06352455573d21

Modified files:
        libpurple/plugins/autoaccept.c

ChangeLog: 

Allow not creating a different directory for each user. Closes #5997.

-------------- next part --------------
============================================================
--- libpurple/plugins/autoaccept.c	486791f12dfd236428c003df1625e54450573619
+++ libpurple/plugins/autoaccept.c	935f4ead922da9429038f3bfcdd74add2f5c648e
@@ -51,6 +51,7 @@
 #define PREF_PATH		PREF_PREFIX "/path"
 #define PREF_STRANGER	PREF_PREFIX "/reject_stranger"
 #define PREF_NOTIFY		PREF_PREFIX "/notify"
+#define PREF_NEWDIR     PREF_PREFIX "/newdir"
 
 typedef enum
 {
@@ -116,8 +117,12 @@ file_recv_request_cb(PurpleXfer *xfer, g
 			{
 				int count = 1;
 				const char *escape;
-				dirname = g_build_filename(pref, purple_normalize(account, xfer->who), NULL);
 
+				if (purple_prefs_get_bool(PREF_NEWDIR))
+					dirname = g_build_filename(pref, purple_normalize(account, xfer->who), NULL);
+				else
+					dirname = g_build_filename(pref, NULL);
+
 				if (!ensure_path_exists(dirname))
 				{
 					g_free(dirname);
@@ -236,6 +241,10 @@ get_plugin_pref_frame(PurplePlugin *plug
 					  "(only when there's no conversation with the sender)"));
 	purple_plugin_pref_frame_add(frame, pref);
 
+	pref = purple_plugin_pref_new_with_name_and_label(PREF_NEWDIR,
+			_("Create a new directory for each user"));
+	purple_plugin_pref_frame_add(frame, pref);
+
 	return frame;
 }
 
@@ -294,6 +303,7 @@ init_plugin(PurplePlugin *plugin) {
 	purple_prefs_add_string(PREF_PATH, dirname);
 	purple_prefs_add_bool(PREF_STRANGER, TRUE);
 	purple_prefs_add_bool(PREF_NOTIFY, TRUE);
+	purple_prefs_add_bool(PREF_NEWDIR, TRUE);
 	g_free(dirname);
 }
 


More information about the Commits mailing list