diff --git a/mbsebbs/mail.c b/mbsebbs/mail.c index d4a2d62f..e1396b21 100644 --- a/mbsebbs/mail.c +++ b/mbsebbs/mail.c @@ -637,7 +637,7 @@ int Save_Msg(int IsReply, faddr *Dest) MsgText_Add2(Message[i]); } - Add_Footkludges(TRUE, NULL); + Add_Footkludges(TRUE, NULL, FALSE); /* * Save if to disk diff --git a/mbsebbs/msgutil.c b/mbsebbs/msgutil.c index 99e2883e..3e57c61c 100644 --- a/mbsebbs/msgutil.c +++ b/mbsebbs/msgutil.c @@ -243,8 +243,9 @@ void Add_Headkludges(faddr *dest, int IsReply) /* * Add bottom message kludges. The flag Quote is false if this is called * from Offline Reader, the user then may or may have not added a quote. + * The QWK upload may set HasTear if the client already uploaded a tearline. */ -void Add_Footkludges(int Quote, char *tear) +void Add_Footkludges(int Quote, char *tear, int HasTear) { char *temp; char *aka; @@ -280,11 +281,13 @@ void Add_Footkludges(int Quote, char *tear) /* * The offline reader may override the tearline */ - if (tear == NULL) { - MsgText_Add2(TearLine()); - } else { - sprintf(temp, "--- %s", tear); - MsgText_Add2(temp); + if (!HasTear) { + if (tear == NULL) { + MsgText_Add2(TearLine()); + } else { + sprintf(temp, "--- %s", tear); + MsgText_Add2(temp); + } } if ((msgs.Type == ECHOMAIL) || (msgs.Type == LIST)) { diff --git a/mbsebbs/msgutil.h b/mbsebbs/msgutil.h index 39455239..85d8a407 100644 --- a/mbsebbs/msgutil.h +++ b/mbsebbs/msgutil.h @@ -1,12 +1,13 @@ #ifndef _MSGUTIL_H #define _MSGUTIL_H +/* $Id$ */ char *rfcdate(time_t); /* Create RFC style date */ int Open_Msgbase(char *, int); /* Open msgbase for read/write */ void Close_Msgbase(void); /* Close msgbase */ void Add_Headkludges(faddr *, int); /* Header part of kludges */ -void Add_Footkludges(int, char *); /* Footer part of kludges */ +void Add_Footkludges(int, char *, int); /* Footer part of kludges */ void Sema_Mailout(void); /* Set mailout semafore */ diff --git a/mbsebbs/offline.c b/mbsebbs/offline.c index de12664d..c79ffd13 100644 --- a/mbsebbs/offline.c +++ b/mbsebbs/offline.c @@ -212,7 +212,7 @@ void Add_Kludges(fidoaddr dest, int IsReply, char *fn) fclose(tp); } - Add_Footkludges(FALSE, newtear); + Add_Footkludges(FALSE, newtear, FALSE); Msg_AddMsg(); Msg_UnLock(); } @@ -2412,6 +2412,7 @@ void QWK_Fetch() unsigned long Area; struct tm *ltm = NULL; fidoaddr dest; + int HasTear; colour(9, 0); /* Processing BlueWave reply packet */ @@ -2500,6 +2501,7 @@ void QWK_Fetch() * Normal message */ Syslog('m', "Message"); + HasTear = FALSE; sprintf(otemp, "%s/etc/mareas.data", getenv("MBSE_ROOT")); if ((mf = fopen(otemp, "r+")) != NULL) { fread(&msgshdr, sizeof(msgshdr), 1, mf); @@ -2561,6 +2563,8 @@ void QWK_Fetch() *pLine = '\0'; Syslog('m', "1 Len=%d \"%s\"", strlen(szLine), printable(szLine, 0)); MsgText_Add2(szLine); + if (strncmp(szLine, (char *)"--- ", 4) == 0) + HasTear = TRUE; pLine = szLine; nCol = 0; } else if (*pBuff != '\n') { @@ -2580,6 +2584,8 @@ void QWK_Fetch() *pLine = '\0'; Syslog('m', "2 Len=%d \"%s\"", strlen(szLine), printable(szLine, 0)); MsgText_Add2(szLine); + if (strncmp(szLine, (char *)"--- ", 4) == 0) + HasTear = TRUE; strcpy(szLine, szWrp); pLine = strchr(szLine, '\0'); nCol = (short)strlen (szLine); @@ -2591,9 +2597,11 @@ void QWK_Fetch() *pLine = '\0'; Syslog('m', "3 Len=%d \"%s\"", strlen(szLine), printable(szLine, 0)); MsgText_Add2(szLine); + if (strncmp(szLine, (char *)"--- ", 4) == 0) + HasTear = TRUE; } - Add_Footkludges(FALSE, NULL); + Add_Footkludges(FALSE, NULL, HasTear); Msg_AddMsg(); Msg_UnLock();