* check whether we need to QP-Encode our from in case of umlauts or so in the users...
authorWilfried Goesgens <dothebart@citadel.org>
Mon, 4 Oct 2010 22:41:35 +0000 (00:41 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Mon, 4 Oct 2010 22:43:53 +0000 (00:43 +0200)
citadel/msgbase.c

index 6efe6543e2294e879acfbef8e98ba56a9f9ca8ce..be2096d1d6b319f089d78b8fe5f536f1b6db8528 100644 (file)
@@ -3436,6 +3436,8 @@ struct CtdlMessage *CtdlMakeMessage(
        char dest_node[256];
        char buf[1024];
        struct CtdlMessage *msg;
+       StrBuf *FakeAuthor;
+       StrBuf *FakeEncAuthor = NULL;
 
        msg = malloc(sizeof(struct CtdlMessage));
        memset(msg, 0, sizeof(struct CtdlMessage));
@@ -3465,11 +3467,13 @@ struct CtdlMessage *CtdlMakeMessage(
        msg->cm_fields['T'] = strdup(buf);
 
        if ((fake_name != NULL) && (fake_name[0])) {            /* author */
-               msg->cm_fields['A'] = strdup(fake_name);
+               FakeAuthor = NewStrBufPlain (fake_name, -1);
        }
        else {
-               msg->cm_fields['A'] = strdup(author->fullname);
+               FakeAuthor = NewStrBufPlain (author->fullname, -1);
        }
+       StrBufRFC2047encode(&FakeEncAuthor, FakeAuthor);
+       msg->cm_fields['A'] = SmashStrBuf(&FakeEncAuthor);
 
        if (CC->room.QRflags & QR_MAILBOX) {            /* room */
                msg->cm_fields['O'] = strdup(&CC->room.QRname[11]);