X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=0447013393225ae078ac147cc035b5748ad2278e;hb=d8569b016fa45a29156c30171237ad93558cc472;hp=7e6d0650e473f0664d2f1d33d6feb30f789f90af;hpb=c841c74f186ffa12e99b0d4febe46b019cce5413;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 7e6d0650e..044701339 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -61,7 +61,7 @@ char *msgkeys[] = { "rep2", // K -> eReplyTo "list", // L -> eListID "text", // M -> eMesageText - NULL, // N (formerly used as eNodeName) + NULL, // N (formerly used as eNodename) "room", // O -> eOriginalRoom "path", // P -> eMessagePath NULL, // Q @@ -1689,10 +1689,7 @@ int CtdlOutputMsg(long msg_num, /* message number (local) to fetch */ } -void OutputCtdlMsgHeaders( - struct CtdlMessage *TheMessage, - int do_proto) /* do Citadel protocol responses? */ -{ +void OutputCtdlMsgHeaders(struct CtdlMessage *TheMessage, int do_proto) { int i; char buf[SIZ]; char display_name[256]; @@ -1725,23 +1722,29 @@ void OutputCtdlMsgHeaders( eMsgField Field; Field = FieldOrder[i]; if (Field != eMesageText) { - if ( (!CM_IsEmpty(TheMessage, Field)) - && (msgkeys[Field] != NULL) ) { - if ((Field == eenVelopeTo) || - (Field == eRecipient) || - (Field == eCarbonCopY)) { + if ( (!CM_IsEmpty(TheMessage, Field)) && (msgkeys[Field] != NULL) ) { + if ((Field == eenVelopeTo) || (Field == eRecipient) || (Field == eCarbonCopY)) { sanitize_truncated_recipient(TheMessage->cm_fields[Field]); } if (Field == eAuthor) { - if (do_proto) cprintf("%s=%s\n", - msgkeys[Field], - display_name); + if (do_proto) { + cprintf("%s=%s\n", msgkeys[Field], display_name); + } } /* Masquerade display name if needed */ else { if (do_proto) { cprintf("%s=%s\n", msgkeys[Field], TheMessage->cm_fields[Field]); } + } + /* Give the client a hint about whether the message originated locally */ + if (Field == erFc822Addr) { + if (IsDirectory(TheMessage->cm_fields[Field] ,0)) { + cprintf("locl=yes\n"); // message originated locally. + } + + + } } } @@ -2126,7 +2129,7 @@ int CtdlOutputPreLoadedMsg( /* Tell the client which format type we're using. */ if ( (mode == MT_CITADEL) && (do_proto) ) { - cprintf("type=%d\n", TheMessage->cm_format_type); + cprintf("type=%d\n", TheMessage->cm_format_type); // Tell the client which format type we're using. } /* nhdr=yes means that we're only displaying headers, no body */ @@ -2137,9 +2140,9 @@ int CtdlOutputPreLoadedMsg( cprintf("nhdr=yes\n"); } - if ((mode == MT_CITADEL) || (mode == MT_MIME)) + if ((mode == MT_CITADEL) || (mode == MT_MIME)) { OutputCtdlMsgHeaders(TheMessage, do_proto); - + } /* begin header processing loop for RFC822 transfer format */ strcpy(suser, ""); @@ -2657,8 +2660,7 @@ void ReplicationChecks(struct CtdlMessage *msg) { */ long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */ recptypes *recps, /* recipients (if mail) */ - const char *force, /* force a particular room? */ - int flags /* should the message be exported clean? */ + const char *force /* force a particular room? */ ) { char hold_rm[ROOMNAMELEN]; char actual_rm[ROOMNAMELEN]; @@ -3020,7 +3022,7 @@ long quickie_message(const char *from, CM_SetField(msg, eMesageText, text, -1); } - long msgnum = CtdlSubmitMsg(msg, recp, room, 0); + long msgnum = CtdlSubmitMsg(msg, recp, room); CM_Free(msg); if (recp != NULL) free_recipients(recp); return msgnum; @@ -3610,7 +3612,7 @@ void CtdlWriteObject(char *req_room, /* Room to stuff it in */ ); } /* Now write the data */ - CtdlSubmitMsg(msg, NULL, roomname, 0); + CtdlSubmitMsg(msg, NULL, roomname); CM_Free(msg); }