[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sylpheed
Subject:    [sylpheed:21965] NEW PATCH: X-Face from file
From:       Sylpheed Patches <sylpheed () thewildbeast ! co ! uk>
Date:       2003-11-19 18:09:46
[Download RAW message or body]

ANNOUNCING THE RELEASE OF A NEW PATCH

Patch Author: Ricardo Mones Lastra <mones@trasgu.aic.uniovi.es>
Title:        X-Face from file
Filename:     xface_from_file.patch (1.3 kb)
Works with:   0.9.7

Description:
Sets the X-Face header from ~/.sylpheed/xface contents at composing.

Notes:
Name of your personal Sylpheed resources configuration directory 
may not be ~/.sylpheed - put the "xface" file here appropiated 
to your system or setup. 
Apply patch with -p0 in sylpheed 
directory.

--------------------------
This is an automated message from the Sylpheed Patch homepage.
<http://www.thewildbeast.co.uk/sylpheed>

If you have made a patch that you want included at the
Sylpheed Patch homepage, request details from
<sylpheed@thewildbeast.co.uk>.

["xface_from_file.patch" (text/plain)]

Index: src/compose.c
===================================================================
RCS file: /cvsroot/sylpheed/sylpheed/src/compose.c,v
retrieving revision 1.251
diff -u -r1.251 compose.c
--- src/compose.c	10 Nov 2003 04:49:34 -0000	1.251
+++ src/compose.c	19 Nov 2003 18:03:15 -0000
@@ -226,6 +226,7 @@
 						 const gchar	*charset,
 						 EncodingType	 encoding,
 						 gboolean	 is_draft);
+static void compose_write_xface                 (FILE           *fp);
 static gint compose_redirect_write_headers	(Compose	*compose,
 						 FILE		*fp);
 
@@ -3411,6 +3412,8 @@
 			}
 		}
 	}
+	/* X-Face */
+	compose_write_xface(fp);
 
 	/* MIME */
 	fprintf(fp, "Mime-Version: 1.0\n");
@@ -3439,6 +3442,31 @@
 	fputs("\n", fp);
 
 	return 0;
+}
+
+static void compose_write_xface(FILE *fp)
+{
+	FILE  *xfp;
+	gchar *xfile;
+	gchar buf[MAX_REFERENCES_LEN - 9];
+	gint  lastc;
+
+	xfile = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, RC_DIR,
+ 			    G_DIR_SEPARATOR_S, "xface", NULL);
+	
+	if ((xfp = fopen(xfile, "rb")) == NULL) {
+		goto no_xface;
+	}
+	
+	if (fgets(buf, sizeof(buf), xfp) != NULL) {
+		lastc = strlen(buf) - 1;
+		buf[lastc] = (buf[lastc] == '\n')? '\0': buf[lastc];
+		fprintf(fp, "X-Face: %s\n", buf);
+	}
+	
+	fclose(xfp);
+no_xface:
+	g_free(xfile);
 }
 
 static gint compose_redirect_write_headers(Compose *compose, FILE *fp)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic