* 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:41:35 +0000 (00:41 +0200)
citadel/msgbase.c

index a2224a8b5edcdf552afc328b344ea5629173ac0e..da60f313293babfe2531118ab407ccfd2b5ff95c 100644 (file)
@@ -3489,6 +3489,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));
@@ -3518,11 +3520,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]);