Skip to contentSkip to conversation

default listtext dir

PATCH Henne Vogelsang 1 participant 1 message Sep 8, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

i frequently run into the problem that i update mlmmj and have to wade trough all my lists and update the listtexts because some new one got added (e.g. submod-moderator) or something is modified.

I would like to propose a default listtext directory (like there already is in datadir/mlmmj/text.skel). So listtexts would be searched

1. in spool/list/text/file and if not there
2. in default/file

This would mean that spool/list/text/file is just an overwrite and you can operate lists just with default texts (no text/ dir at all). Also comes in handy if the translations are behind etc.

The following patch implements this in prestdreply.c. The only part that is missing is making configure setting the dir in config.h instead of hardcoding it. What do you think?

Henne

Signature · 3 lines
Henne Vogelsang, Core Services
"Rules change. The Game remains the same."
			 - Omar (The Wire)
config.h.in +3 -0
@@ -129,3 +129,6 @@
 
 /* Define to `unsigned' if <sys/types.h> does not define. */
 #undef size_t
+
+/* Define to the location of the default listext directory */
+#define DEFAULTTEXTDIR  "/usr/share/mlmmj/text.skel/"
prepstdreply.c +7 -2
@@ -166,8 +166,13 @@
 	infd = open(tmp, O_RDONLY);
 	myfree(tmp);
 	if(infd < 0) {
-		log_error(LOG_ARGS, "Could not open std mail %s", filename);
-		return NULL;
+		tmp = concatstr(2, DEFAULTTEXTDIR, filename);
+		infd = open(tmp, O_RDONLY);
+		myfree(tmp);
+		if(infd < 0) {
+			log_error(LOG_ARGS, "Could not open std mail %s", filename);
+			return NULL;
+		}	
 	}
 
 	listaddr = getlistaddr(listdir);