From 4cbb31a07bff1b73977c15b9e13f7d2566f52ca7 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 2 Mar 2003 13:29:33 +0000 Subject: [PATCH] Updated Offline Reader --- ChangeLog | 26 +- TODO | 18 +- examples/menus-en.tar | Bin 61440 -> 61440 bytes examples/menus-es.tar | Bin 61440 -> 61440 bytes examples/txtfiles-en.tar | Bin 92160 -> 81920 bytes examples/txtfiles-es.tar | Bin 61440 -> 51200 bytes html/Makefile | 4 +- html/index.htm | 4 +- html/menus/control.html | 10 +- html/menus/menu300.html | 7 +- html/setup/bbs.html | 8 +- html/setup/index.htm | 8 +- html/setup/safe.html | 30 - html/setup/timebank.html | 30 - lang/Language.xref | 4 +- lang/dutch.txt | 4 +- lang/english.txt | 4 +- lang/galego.txt | 4 +- lang/german.txt | 4 +- lang/italian.txt | 4 +- lang/spanish.txt | 4 +- lib/bluewave.h | 19 - mbsebbs/change.c | 19 + mbsebbs/change.h | 2 +- mbsebbs/dispfile.c | 4 + mbsebbs/menu.c | 4 + mbsebbs/offline.c | 1343 +++++++++++++++++--------------------- mbsetup/ledit.c | 1 + mbsetup/m_menu.c | 2 +- 29 files changed, 689 insertions(+), 878 deletions(-) delete mode 100755 html/setup/safe.html delete mode 100755 html/setup/timebank.html diff --git a/ChangeLog b/ChangeLog index 5d38fd33..c8529872 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ $Id$ WARNING, users of Sparc and HP-PA systems should be carefull, some - menus might not work. + menus do not work. All other users on Intel machines (99,9% I think) can use this version. @@ -17,6 +17,30 @@ v0.37.2 23-Feb-2003. mbfido: Finding the inbound tic file now uses the new function. + examples: + Removed the last menu item from the offline menu, added new + Extended Info toggle (English only). + Updated offline textfiles to remove point download and add + new Extended Info toggle (English only). + + mbsebbs: + Offline reader, the reply packets are now handled complete + case insensitive. + Dropped BlueWave v2 format completly, obsolete format. + The BlueWave and QWK download packets can have kludges, this + depends on a setting in the userbase. + In downloaded netmail, if message comes from a point, the FMPT + kludge is allways included in the message. + Added some forgotten checks for a valid QWK board name. + Lots of code cleanups in the offline code. + Added menu 320, toggle Offline Reader Extended Info. + Added new control code: control-U + 8, this displays YES or NO + for the new Extended Info setting. + The display file functio now displays the ^U8 code. + + lang: + Changed language prompts 15 and 16. + v0.37.1 14-Jan-2003 - 23-Feb-2003 diff --git a/TODO b/TODO index 28cab0c2..9925174d 100644 --- a/TODO +++ b/TODO @@ -18,10 +18,6 @@ libdiesel.a: processed, instead the previous macro value will be returned. mbsebbs: - L: Must include SEEN-BY and other hidden lines into BlueWave and QWK - mail, must be user selectable. see remarks of William McBrine. - The default is oke now. - N: Rewrite chat to use "mbtask". Write chat functions into "mbmon" N: Implement session and time/day limits. @@ -41,6 +37,20 @@ mbsebbs: L: ChangeHandle, allow own unix name as handle. + L: OLR: tagged areas must have 3 states, off, on or personal only. + + L: OLR: implement limit date function. + + L: OLR: include private email area in download packets. + + L: OLR: implement some global settings from the offline configuration. + + L: OLR: implement keywords and filters. + + L: OLR: check qwke extensions. + + N: OLR: qwk, check netmail entered from reader, fido address missing? + newuser: L: Allow handles to be the same as the unixname. diff --git a/examples/menus-en.tar b/examples/menus-en.tar index a23b7e151458c8177e895cf1bfff10e853a4e325..209e890596f8b0caab2a320a9876d2bd25cd55c0 100644 GIT binary patch delta 86 zcmV-c0IC0g-~)i*1F&kGlWGnb8aFpIFaR(&HZw3ZFfcJNHUKa&F*PtS03a}v5eH7~AVqj|Wo~3;WFSdyW^a?xksFiRnjoUCLUBAC)&Kwi delta 72 zcmV-O0Jr~u-~)i*1F&kGlWHa!88!f47505m_Bg8%>k delta 2683 zcmbtW&1)M+6!+LpXk`l@LSm66>A3l@Tx@6dQ;D5RaVYM=RD>RqZUYsO3IH$HP19gP8@L(}!C#FUiybusTFsXCF?0Msva0T*qw#Avj5< zelW@wezN2JfuDFkQ!s%N&LdeJH@q#$G&*1;vqJZOnft=}jV+E7`9||d#v+8W1$Yez zfQ3tS8hPJPk$B~zxs)oQ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9!SS(l6ur5m_XPh>Q8Cq4~9R z;=+rBPLNGmqAw^A{V9JoJw!K_L#xCmSUw

MBSE BBS System Guide v0.37.01


-
Last update 14-Jan-2003
+
Last update 02-Mar-2003

@@ -61,8 +61,6 @@

  • Edit Transfer protocols
  • Edit BBS List data
  • Edit Oneliners -
  • Edit TimeBank data -
  • Edit Safe Cracker data
  • Edit Mail setup
      diff --git a/html/menus/control.html b/html/menus/control.html index 06f37633..3cb1882d 100644 --- a/html/menus/control.html +++ b/html/menus/control.html @@ -12,10 +12,8 @@
      -
      Last update 11-Nov-2001
      -

       

      - -

      MBSE BBS Control Codes in ANSI and ASCII files

      +
      Last update 02-Mar-2003
      +

      MBSE BBS Control Codes in ANSI and ASCII files


      @@ -115,6 +113,10 @@ For example: ^B32000^BThis is the text^B
      2 User's check for new files (On/Off) 3 User's fullscreen editor (On/Off) 4 User's FS editor Emacs shortcuts (On/Off) + 5 User's first address line. + 6 User's Second address line. + 7 User's Third address line. + 8 User's OLR Extended Onfo (On/Off). diff --git a/html/menus/menu300.html b/html/menus/menu300.html index 7cd0475d..35844862 100644 --- a/html/menus/menu300.html +++ b/html/menus/menu300.html @@ -12,7 +12,7 @@
      -
      Last update 02-Feb-2003
      +
      Last update 02-Mar-2003

      MBSE BBS User Settings Menus


      @@ -112,6 +112,11 @@ Optional data: None.

      +

    1. Change OLR Extended Info: Let the user toggle + the setting of the Offline Reader download of extended info (kludges).
      + Optional data: None.
      +

      +


    diff --git a/html/setup/bbs.html b/html/setup/bbs.html index a338e977..12e9151d 100644 --- a/html/setup/bbs.html +++ b/html/setup/bbs.html @@ -12,10 +12,8 @@
    -
    Last update 29-Jan-2001
    -

     

    - -

    MBSE BBS Setup - Edit BBS Setup.

    +
    Last update 02-Mar-2003
    +

    MBSE BBS Setup - Edit BBS Setup.

    Edit BBS Setup.

    @@ -31,8 +29,6 @@ The BBS setup is split in the following sections:
  • Transfer protocols
  • BBS List data
  • Oneliners -
  • TimeBank data -
  • Safe Cracker data BackBack to index  diff --git a/html/setup/index.htm b/html/setup/index.htm index fd7aa668..0fac5a10 100644 --- a/html/setup/index.htm +++ b/html/setup/index.htm @@ -12,10 +12,8 @@
    -
    Last update 25-Jul-2001
    -

     

    - -

    MBSE BBS Setup Guide

    +
    Last update 02-Mar-2003
    +

    MBSE BBS Setup Guide

    Invoking mbsetup

    @@ -47,8 +45,6 @@ When you start mbsetup you will see the following screen:
  • Edit Transfer protocols
  • Edit BBS List data
  • Edit Oneliners -
  • Edit TimeBank data -
  • Edit Safe Cracker data
  • Edit Mail setup
      diff --git a/html/setup/safe.html b/html/setup/safe.html deleted file mode 100755 index 66656ef3..00000000 --- a/html/setup/safe.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - -MBSE BBS Setup - BBS Setup - Safe Cracker Data. - - - -
      -
      Last update 29-Jan-2001
      -

       

      - -

      MBSE BBS Setup - BBS Setup - Safe Cracker Data

      -

      -This is meant to edit users personal safe cracker records and to reset -the winner. This is not available yet. -

      - -BackBack to BBS index  -BackBack to index  -HomeBack to main index -

      - - - diff --git a/html/setup/timebank.html b/html/setup/timebank.html deleted file mode 100755 index 00f8bf79..00000000 --- a/html/setup/timebank.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - -MBSE BBS Setup - BBS Setup - TimeBank. - - - -
      -
      Last update 29-Jan-2001
      -

       

      - -

      MBSE BBS Setup - BBS Setup - TimeBank.

      -

      -This is meant to edit the users personal timebank records. This is not -available yet. -

      - -BackBack to BBS index  -BackBack to index  -HomeBack to main index -

      - - - diff --git a/lang/Language.xref b/lang/Language.xref index 5d9ae1ff..d7fcc740 100644 --- a/lang/Language.xref +++ b/lang/Language.xref @@ -13,8 +13,8 @@ 12 mail.c email.c |Message exported to rules directory as 13 dispfile.c |No rules found for this area 14 mail.c |You are not allowed to delete that message -15 .c | -16 .c | +15 change.c |Offline Reader: Extended Info turned ON +16 change.c |Offline Reader: Extended Info turned OFF 17 .c | 18 .c | 19 .c | diff --git a/lang/dutch.txt b/lang/dutch.txt index 10764e01..e39d5d3c 100644 --- a/lang/dutch.txt +++ b/lang/dutch.txt @@ -13,8 +13,8 @@ HR|Exporteer naar (H)ome of (R)egels directory: |Bericht geexporteerd naar rules directory als |Geen regels gevonden voor dit gebied |Je mag dit bericht niet verwijderen -|Tijd gestort vandaag -|Bytes gestort vandaag +|Offline Reader: Uitgebreide Informatie is nu AAN +|Offline Reader: Uitgebreide Informatie is nu UIT |Tijd opgenomen vandaag |Bytes opgenomen vandaag SOE|(S)torten, (O)pnemen, (E)inde: diff --git a/lang/english.txt b/lang/english.txt index 53f14779..eaa23a58 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -13,8 +13,8 @@ HR|Export to (H)ome or (R)ules directory: |Message exported to rules directory as |No rules found for this area |You are not allowed to delete that message -|Time deposited today -|Bytes deposited today +|Offline Reader: Extended Info turned ON +|Offline Reader: Extended Info turned OFF |Time withdrawn today |Bytes withdrawn today DWQ|(D)eposit, (W)ithdraw, (Q)uit: diff --git a/lang/galego.txt b/lang/galego.txt index cb4d7899..fee88dd2 100644 --- a/lang/galego.txt +++ b/lang/galego.txt @@ -13,8 +13,8 @@ HR|Export to (H)ome or (R)ules directory: |Message exported to rules directory as |No rules found for this area |You are not allowed to delete that message -|Tempo depositado hoxe : -|Bytes depositados hoxe : +|Offline Reader: Extended Info turned ON +|Offline Reader: Extended Info turned OFF |Tempo retirado hoxe : |Bytes retirados hoxe : DRS|(D)epositar, (R)etirar, (S)air : diff --git a/lang/german.txt b/lang/german.txt index 70c17617..0c178d34 100644 --- a/lang/german.txt +++ b/lang/german.txt @@ -13,8 +13,8 @@ HR|Export in (H)ome oder (R)ules Direktorie: |Message exportiert in das Rules Direktorie als |Keine Rules gefunden fuer diese Area |Keine Berechtigung zum loeschen der Message -|Heute gesparte Zeit . . . . . . . : -|Heute gesparte KBytes . . . . . . : +|Offline Reader: Extended Info turned ON +|Offline Reader: Extended Info turned OFF |Heute abgehobene Zeit . . . . . . : |Heute abgehobene KBytes . . . . . : SAE|(S)paren, (A)bheben, (E)nde: diff --git a/lang/italian.txt b/lang/italian.txt index afeb0d27..01c584da 100644 --- a/lang/italian.txt +++ b/lang/italian.txt @@ -13,8 +13,8 @@ HR|Export to (H)ome or (R)ules directory: |Message exported to rules directory as |No rules found for this area |You are not allowed to delete that message -|Tempo depositato oggi: -|Byte depositati oggi : +|Offline Reader: Extended Info turned ON +|Offline Reader: Extended Info turned OFF |Tempo prelevato oggi : |Byte prelevati oggi : DPE|(D)eposita, (P)releva, (E)sci: diff --git a/lang/spanish.txt b/lang/spanish.txt index 00c26f4c..115d8dff 100644 --- a/lang/spanish.txt +++ b/lang/spanish.txt @@ -13,8 +13,8 @@ HR|Export to (H)ome or (R)ules directory: |Message exported to rules directory as |No rules found for this area |You are not allowed to delete that message -|Tiempo depositado hoy : -|Bytes depositados hoy : +|Offline Reader: Extended Info turned ON +|Offline Reader: Extended Info turned OFF |Tiempo retirado hoy : |Bytes retirados hoy : DRS|(D)epositar, (R)etirar, (S)alir : diff --git a/lib/bluewave.h b/lib/bluewave.h index dc3d2027..d868d95f 100644 --- a/lib/bluewave.h +++ b/lib/bluewave.h @@ -81,14 +81,6 @@ ** data types in a different fashion. (Note that the tCHAR and tINT types ** are currently not used; they are included simply for completeness.) ** -** If you are programming for a system that employs a CPU which stores multi- -** byte integers in a manner other than in Intel format (LSB-MSB, or "little -** endian"), simply #define BIG_ENDIAN before #including this header. As -** shown below, this will define the data types as arrays of bytes; the -** drawback is that *YOU* will have to write functions to convert the data, -** since the Blue Wave packet specification requires the data to be in Intel- -** style little-endian format. -** ** IMPORTANT NOTE ABOUT COMPILERS AND STRUCTURES: ** All structures *must* be "packed" (i.e., the compiler MUST NOT insert ** padding bytes between structure elements in order to force elements onto @@ -96,16 +88,6 @@ ** they aren't, you're bound to get some *very* interesting results. */ -//#ifdef BIG_ENDIAN - -//typedef signed char tCHAR; /* 8 bit signed values */ -//typedef unsigned char tBYTE; /* 8 bit unsigned values */ -//typedef unsigned char tINT[2]; /* little-endian 16 bit signed */ -//typedef unsigned char tWORD[2]; /* little-endian 16 bit unsigned */ -//typedef unsigned char tLONG[4]; /* little-endian 32 bit signed */ -//typedef unsigned char tDWORD[4]; /* little-endian 32 bit unsigned */ - -//#else typedef signed char tCHAR; /* 8 bit signed values */ typedef unsigned char tBYTE; /* 8 bit unsigned values */ @@ -114,7 +96,6 @@ typedef unsigned short tWORD; /* 16 bit unsigned values */ typedef signed long tLONG; /* 32 bit signed values */ typedef unsigned long tDWORD; /* 32 bit unsigned values */ -//#endif /*****************************************************************************/ diff --git a/mbsebbs/change.c b/mbsebbs/change.c index e8a91299..c1a56b13 100644 --- a/mbsebbs/change.c +++ b/mbsebbs/change.c @@ -961,3 +961,22 @@ void Set_Protocol(char *Protocol) +void Chg_OLR_ExtInfo() +{ + ReadExitinfo(); + + if (exitinfo.OL_ExtInfo) { + exitinfo.OL_ExtInfo = FALSE; + /* Offline Reader: Extended Info turned OFF */ + printf("\n\n%s\n\n", (char *) Language(16)); + } else { + exitinfo.OL_ExtInfo = TRUE; + /* Offline Reader: Extended Info turned ON */ + printf("\n\n%s\n\n", (char *) Language(15)); + } + Syslog('+', "OLR Extended Info now %s", exitinfo.OL_ExtInfo?"True":"False"); + sleep(2); + WriteExitinfo(); +} + + diff --git a/mbsebbs/change.h b/mbsebbs/change.h index f76f038f..89349860 100644 --- a/mbsebbs/change.h +++ b/mbsebbs/change.h @@ -22,7 +22,7 @@ int Test_DOB(char *); /* Test of Date of Birth is valid */ void Chg_DOB(void); /* Change Date of Birth */ void Chg_Protocol(void); /* Change default transfer protocol. */ void Set_Protocol(char *); /* Set default protocol */ - +void Chg_OLR_ExtInfo(void); /* Set OLR Extended Info */ #endif diff --git a/mbsebbs/dispfile.c b/mbsebbs/dispfile.c index 54ef80b1..7adb55d8 100644 --- a/mbsebbs/dispfile.c +++ b/mbsebbs/dispfile.c @@ -544,6 +544,10 @@ void ControlCodeU(int ch) printf(exitinfo.address[2]); break; + case '8': + printf("%s", exitinfo.OL_ExtInfo ? (char *) Language(147) : (char *) Language(148)); + break; + default: printf(" "); } diff --git a/mbsebbs/menu.c b/mbsebbs/menu.c index 22ac3586..75b619b3 100644 --- a/mbsebbs/menu.c +++ b/mbsebbs/menu.c @@ -640,6 +640,10 @@ void DoMenu(int Type) signature(); break; + case 320: + Chg_OLR_ExtInfo(); + break; + case 401: Oneliner_Add(); break; diff --git a/mbsebbs/offline.c b/mbsebbs/offline.c index 459fd453..9151fe5b 100644 --- a/mbsebbs/offline.c +++ b/mbsebbs/offline.c @@ -35,9 +35,6 @@ #include "../lib/mbse.h" #include "../lib/users.h" #include "../lib/records.h" -#ifndef BIG_ENDIAN -#define BIG_ENDIAN -#endif #include "../lib/bluewave.h" #include "../lib/common.h" #include "../lib/clcomm.h" @@ -148,10 +145,10 @@ void UpdateLR(msg_high *mhl, FILE *mf) char *p; msg_high *tmp; - colour(14, 0); + colour(YELLOW, BLACK); /* Updating lastread pointer */ printf("%s\n", (char *)Language(449)); - colour(13, 0); + colour(LIGHTMAGENTA, BLACK); for (tmp = mhl; tmp; tmp = tmp->next) { printf("."); @@ -246,12 +243,12 @@ void OLR_TagArea() sprintf(Tagname, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); clear(); - colour(14, 0); + colour(YELLOW, BLACK); /* Tag Offline Reader message areas */ printf("%s\n", (char *)Language(66)); do { - colour(15, 0); + colour(WHITE, BLACK); /* Enter the name of the conference, or ? for a list: */ printf("\n%s", (char *)Language(228)); colour(CFG.InputColourF, CFG.InputColourB); @@ -259,7 +256,7 @@ void OLR_TagArea() if (buf[0] == '?') { maxlines = lines = exitinfo.iScreenLen - 1; - colour(11, 0); + colour(LIGHTCYAN, BLACK); /* Conference Area Msgs Description */ printf("%s\n", (char *)Language(229)); if ((ma = fopen(Msgname, "r")) != NULL) { @@ -275,7 +272,7 @@ void OLR_TagArea() Msg_Close(); } else total = 0; - colour(3, 0); + colour(CYAN, BLACK); if (msgs.Active && Access(exitinfo.Security, msgs.RDSec) && (!olrtagrec.Tagged) && strlen(msgs.QWKname)) { if ( (lines != 0) || (ignore) ) { lines--; @@ -283,7 +280,7 @@ void OLR_TagArea() } if (lines == 0) { fflush(stdin); - colour(15, 0); + colour(WHITE, BLACK); /* More (Y/n/=) */ printf("%s%c\x08", (char *) Language(61),Keystroke(61,0)); fflush(stdout); @@ -301,7 +298,7 @@ void OLR_TagArea() ignore = TRUE; else lines = maxlines; - colour(3, 0); + colour(CYAN, BLACK); } } } @@ -389,12 +386,12 @@ void OLR_UntagArea() sprintf(Tagname, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); clear(); - colour(14, 0); + colour(YELLOW, BLACK); /* Untag Offline Reader message areas */ printf("%s\n", (char *)Language(256)); do { - colour(15, 0); + colour(WHITE, BLACK); /* Enter the name of the conference, or ? for a list: */ printf("\n%s", (char *)Language(228)); colour(CFG.InputColourF, CFG.InputColourB); @@ -402,7 +399,7 @@ void OLR_UntagArea() if (buf[0] == '?') { maxlines = lines = exitinfo.iScreenLen - 1; - colour(11, 0); + colour(LIGHTCYAN, BLACK); /* Conference Area Msgs Description */ printf("%s\n", (char *)Language(229)); if ((ma = fopen(Msgname, "r")) != NULL) { @@ -418,7 +415,7 @@ void OLR_UntagArea() Msg_Close(); } else total = 0; - colour(3, 0); + colour(CYAN, BLACK); if (msgs.Active && Access(exitinfo.Security, msgs.RDSec) && olrtagrec.Tagged && strlen(msgs.QWKname)) { if ( (lines != 0) || (ignore) ) { lines--; @@ -426,7 +423,7 @@ void OLR_UntagArea() } if (lines == 0) { fflush(stdin); - colour(15, 0); + colour(WHITE, BLACK); /* More (Y/n/=) */ printf("%s%c\x08", (char *) Language(61),Keystroke(61,0)); fflush(stdout); @@ -444,7 +441,7 @@ void OLR_UntagArea() ignore = TRUE; else lines = maxlines; - colour(3, 0); + colour(CYAN, BLACK); } } } @@ -525,15 +522,15 @@ void New_Hdr() { char *temp; - temp = calloc(81, sizeof(char)); + temp = calloc(128, sizeof(char)); clear(); - colour(14, 0); + colour(YELLOW, BLACK); /* New or deleted mail areas at */ sprintf(temp, "%s%s", (char *) Language(364), CFG.bbs_name); Center(temp); free(temp); printf("\n"); - colour(15, 1); + colour(WHITE, BLUE); /* Area State Type Description */ printf("%-79s\n", (char *) Language(365)); } @@ -543,7 +540,7 @@ void New_Hdr() void New_Area(long); void New_Area(long Area) { - colour(11, 0); + colour(LIGHTCYAN, BLACK); /* New */ printf("%4ld %s", Area, (char *)Language(391)); switch (msgs.Type) { @@ -565,7 +562,7 @@ void New_Area(long Area) void Old_Area(long); void Old_Area(long Area) { - colour(12, 0); + colour(LIGHTRED, BLACK); /* Del */ printf("%4ld %s\n", Area, (char *)Language(397)); } @@ -578,138 +575,137 @@ void Old_Area(long Area) */ void OLR_SyncTags() { - char *Tagname, *Msgname; - FILE *fp, *ma; - long Area; - int Changed = FALSE; + char *Tagname, *Msgname; + FILE *fp, *ma; + long Area; + int Changed = FALSE; - Tagname = calloc(PATH_MAX, sizeof(char)); - Msgname = calloc(PATH_MAX, sizeof(char)); - sprintf(Tagname, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); - sprintf(Msgname, "%s/etc/mareas.data", getenv("MBSE_ROOT")); + Tagname = calloc(PATH_MAX, sizeof(char)); + Msgname = calloc(PATH_MAX, sizeof(char)); + sprintf(Tagname, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); + sprintf(Msgname, "%s/etc/mareas.data", getenv("MBSE_ROOT")); - if ((fp = fopen(Tagname, "r+")) == NULL) { + if ((fp = fopen(Tagname, "r+")) == NULL) { - /* - * If the user has no .olrtagsfile yet, we silently create - * a new one. The user will not be notified of new areas - * of coarse. - */ - Syslog('m', "Creating %s", Tagname); - if ((fp = fopen(Tagname, "w")) != NULL) { + /* + * If the user has no .olrtagsfile yet, we silently create + * a new one. The user will not be notified of new areas + * of coarse. + */ + Syslog('m', "Creating %s", Tagname); + if ((fp = fopen(Tagname, "w")) != NULL) { - if ((ma = fopen(Msgname, "r")) != NULL) { - fread(&msgshdr, sizeof(msgshdr), 1, ma); + if ((ma = fopen(Msgname, "r")) != NULL) { + fread(&msgshdr, sizeof(msgshdr), 1, ma); - while (fread(&msgs, msgshdr.recsize, 1, ma) == 1) { - memset(&olrtagrec, 0, sizeof(olrtagrec)); - if ((msgs.Active) && Access(exitinfo.Security, msgs.RDSec)) { - olrtagrec.Available = TRUE; - olrtagrec.ScanNew = TRUE; - if (msgs.OLR_Forced || msgs.OLR_Default) - olrtagrec.Tagged = TRUE; - } - fwrite(&olrtagrec, sizeof(olrtagrec), 1, fp); - fseek(ma, msgshdr.syssize, SEEK_CUR); - } - - fclose(ma); - } + while (fread(&msgs, msgshdr.recsize, 1, ma) == 1) { + memset(&olrtagrec, 0, sizeof(olrtagrec)); + if ((msgs.Active) && Access(exitinfo.Security, msgs.RDSec) && strlen(msgs.QWKname)) { + olrtagrec.Available = TRUE; + olrtagrec.ScanNew = TRUE; + if (msgs.OLR_Forced || msgs.OLR_Default) + olrtagrec.Tagged = TRUE; + } + fwrite(&olrtagrec, sizeof(olrtagrec), 1, fp); + fseek(ma, msgshdr.syssize, SEEK_CUR); } - } else { - /* - * The user has been here before... - */ - if ((ma = fopen(Msgname, "r")) != NULL) { - fread(&msgshdr, sizeof(msgshdr), 1, ma); - Area = 0; - while (fread(&msgs, msgshdr.recsize, 1, ma) == 1) { - Area++; + fclose(ma); + } + } + } else { + /* + * The user has been here before... + */ + if ((ma = fopen(Msgname, "r")) != NULL) { + fread(&msgshdr, sizeof(msgshdr), 1, ma); + Area = 0; - if (fread(&olrtagrec, sizeof(olrtagrec), 1, fp) == 1) { + while (fread(&msgs, msgshdr.recsize, 1, ma) == 1) { + Area++; - /* - * Check if this is a new area for the user. - */ - if ((msgs.Active) && Access(exitinfo.Security, msgs.RDSec) && (!olrtagrec.Available)) { - Syslog('m', "New msg area %ld %s", Area, msgs.Name); - fseek(fp, - sizeof(olrtagrec), SEEK_CUR); - olrtagrec.Available = TRUE; - olrtagrec.ScanNew = TRUE; - if (msgs.OLR_Forced || msgs.OLR_Default) - olrtagrec.Tagged = TRUE; - fwrite(&olrtagrec, sizeof(olrtagrec), 1, fp); - if (CFG.NewAreas) { - if (!Changed) { - New_Hdr(); - Changed = TRUE; - } - New_Area(Area); - } - } else { - /* - * Check if this area is no longer - * available for the user. - */ - if (((!msgs.Active) || (!Access(exitinfo.Security, msgs.RDSec))) && - olrtagrec.Available) { - Syslog('m', "Deleted msg area %ld", Area); - fseek(fp, - sizeof(olrtagrec), SEEK_CUR); - olrtagrec.Available = FALSE; - olrtagrec.ScanNew = FALSE; - olrtagrec.Tagged = FALSE; - fwrite(&olrtagrec, sizeof(olrtagrec), 1, fp); - if (CFG.NewAreas) { - if (!Changed) { - New_Hdr(); - Changed = TRUE; - } - Old_Area(Area); - } - } - } + if (fread(&olrtagrec, sizeof(olrtagrec), 1, fp) == 1) { - } else { - /* - * If the number if msg areas was increased, - * append a new tagrecord. - */ - memset(&olrtagrec, 0, sizeof(olrtagrec)); - if ((msgs.Active) && Access(exitinfo.Security, msgs.RDSec)) { - Syslog('m', "Append new area %ld %s", Area, msgs.Name); - olrtagrec.Available = TRUE; - olrtagrec.ScanNew = TRUE; - if (msgs.OLR_Forced || msgs.OLR_Default) - olrtagrec.Tagged = TRUE; - if (CFG.NewAreas) { - if (!Changed) { - New_Hdr(); - Changed = TRUE; - } - New_Area(Area); - } - } - fwrite(&olrtagrec, sizeof(olrtagrec), 1, fp); - } - fseek(ma, msgshdr.syssize, SEEK_CUR); + /* + * Check if this is a new area for the user. + */ + if ((msgs.Active) && Access(exitinfo.Security, msgs.RDSec) && strlen(msgs.QWKname) && (!olrtagrec.Available)) { + Syslog('m', "New msg area %ld %s", Area, msgs.Name); + fseek(fp, - sizeof(olrtagrec), SEEK_CUR); + olrtagrec.Available = TRUE; + olrtagrec.ScanNew = TRUE; + if (msgs.OLR_Forced || msgs.OLR_Default) + olrtagrec.Tagged = TRUE; + fwrite(&olrtagrec, sizeof(olrtagrec), 1, fp); + if (CFG.NewAreas) { + if (!Changed) { + New_Hdr(); + Changed = TRUE; + } + New_Area(Area); } + } else { + /* + * Check if this area is no longer + * available for the user. + */ + if (((!msgs.Active) || (!Access(exitinfo.Security, msgs.RDSec))) && olrtagrec.Available) { + Syslog('m', "Deleted msg area %ld", Area); + fseek(fp, - sizeof(olrtagrec), SEEK_CUR); + olrtagrec.Available = FALSE; + olrtagrec.ScanNew = FALSE; + olrtagrec.Tagged = FALSE; + fwrite(&olrtagrec, sizeof(olrtagrec), 1, fp); + if (CFG.NewAreas) { + if (!Changed) { + New_Hdr(); + Changed = TRUE; + } + Old_Area(Area); + } + } + } - fclose(ma); + } else { + /* + * If the number if msg areas was increased, + * append a new tagrecord. + */ + memset(&olrtagrec, 0, sizeof(olrtagrec)); + if ((msgs.Active) && Access(exitinfo.Security, msgs.RDSec) && strlen(msgs.QWKname)) { + Syslog('m', "Append new area %ld %s", Area, msgs.Name); + olrtagrec.Available = TRUE; + olrtagrec.ScanNew = TRUE; + if (msgs.OLR_Forced || msgs.OLR_Default) + olrtagrec.Tagged = TRUE; + if (CFG.NewAreas) { + if (!Changed) { + New_Hdr(); + Changed = TRUE; + } + New_Area(Area); + } + } + fwrite(&olrtagrec, sizeof(olrtagrec), 1, fp); } + fseek(ma, msgshdr.syssize, SEEK_CUR); + } + + fclose(ma); } + } - fclose(fp); + fclose(fp); - if (Changed) { - colour(10, 0); - fLine(79); - Pause(); - } + if (Changed) { + colour(LIGHTGREEN, BLACK); + fLine(79); + Pause(); + } - SetMsgArea(exitinfo.iLastMsgArea); - free(Tagname); - free(Msgname); + SetMsgArea(exitinfo.iLastMsgArea); + free(Tagname); + free(Msgname); } @@ -719,86 +715,90 @@ void OLR_SyncTags() */ void OLR_ViewTags() { - char *Tagname, *Msgname; - FILE *tf, *ma; - long total, Area = 0; - int lines, input, ignore = FALSE, maxlines; + char *Tagname, *Msgname; + FILE *tf, *ma; + long total, Area = 0; + int lines, input, ignore = FALSE, maxlines; - WhosDoingWhat(OLR); + WhosDoingWhat(OLR); - Tagname = calloc(PATH_MAX, sizeof(char)); - Msgname = calloc(PATH_MAX, sizeof(char)); - sprintf(Tagname, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); - sprintf(Msgname, "%s/etc/mareas.data", getenv("MBSE_ROOT")); + Tagname = calloc(PATH_MAX, sizeof(char)); + Msgname = calloc(PATH_MAX, sizeof(char)); + sprintf(Tagname, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); + sprintf(Msgname, "%s/etc/mareas.data", getenv("MBSE_ROOT")); - if ((tf = fopen(Tagname, "r")) == NULL) { - WriteError("$Can't open %s", Tagname); - return; - } - - if ((ma = fopen(Msgname, "r")) == NULL) { - WriteError("$Can't open %s", Msgname); - fclose(tf); - return; - } - fread(&msgshdr, sizeof(msgshdr), 1, ma); - - clear(); - colour(14, 0); - /* You have selected the following Conference(s): */ - printf ("%s\n", (char *)Language(260)); - colour(11, 0); - /* Conference Area Msgs Description */ - printf ("\n%s\n", (char *)Language(229)); - colour(3, 0); - fflush(stdout); - maxlines = lines = exitinfo.iScreenLen - 1; - - while (fread(&msgs, msgshdr.recsize, 1, ma) == 1) { - fseek(ma, msgshdr.syssize, SEEK_CUR); - fread(&olrtagrec, sizeof(olrtagrec), 1, tf); - Area++; - - if (olrtagrec.Tagged) { - if (Msg_Open(msgs.Base)) { - total = Msg_Number(); - Msg_Close(); - } else - total = 0; - if ( (lines != 0) || (ignore) ) { - lines--; - printf("%-20.20s %-5ld %-5ld %s\n", msgs.QWKname, Area, total, msgs.Name); - } - if (lines == 0) { - fflush(stdin); - colour(15, 0); - /* More (Y/n/=) */ - printf("%s%c\x08", (char *) Language(61),Keystroke(61,0)); - fflush(stdout); - alarm_on(); - input = toupper(Getone()); - printf("%c\r",input); - if ((input == Keystroke(61, 0)) || (input == '\r')) - lines = maxlines; - - if (input == Keystroke(61, 1)) { - break; - } - if (input == Keystroke(61, 2)) - ignore = TRUE; - else - lines = maxlines; - colour(3, 0); - } - fflush(stdout); - } - } - - fclose(tf); - fclose(ma); - Pause(); + if ((tf = fopen(Tagname, "r")) == NULL) { + WriteError("$Can't open %s", Tagname); free(Tagname); free(Msgname); + return; + } + + if ((ma = fopen(Msgname, "r")) == NULL) { + WriteError("$Can't open %s", Msgname); + fclose(tf); + free(Tagname); + free(Msgname); + return; + } + fread(&msgshdr, sizeof(msgshdr), 1, ma); + + clear(); + colour(YELLOW, BLACK); + /* You have selected the following Conference(s): */ + printf ("%s\n", (char *)Language(260)); + colour(LIGHTCYAN, BLACK); + /* Conference Area Msgs Description */ + printf ("\n%s\n", (char *)Language(229)); + colour(CYAN, BLACK); + fflush(stdout); + maxlines = lines = exitinfo.iScreenLen - 1; + + while (fread(&msgs, msgshdr.recsize, 1, ma) == 1) { + fseek(ma, msgshdr.syssize, SEEK_CUR); + fread(&olrtagrec, sizeof(olrtagrec), 1, tf); + Area++; + + if (olrtagrec.Tagged) { + if (Msg_Open(msgs.Base)) { + total = Msg_Number(); + Msg_Close(); + } else + total = 0; + if ( (lines != 0) || (ignore) ) { + lines--; + printf("%-20.20s %-5ld %-5ld %s\n", msgs.QWKname, Area, total, msgs.Name); + } + if (lines == 0) { + fflush(stdin); + colour(WHITE, BLACK); + /* More (Y/n/=) */ + printf("%s%c\x08", (char *) Language(61),Keystroke(61,0)); + fflush(stdout); + alarm_on(); + input = toupper(Getone()); + printf("%c\r",input); + if ((input == Keystroke(61, 0)) || (input == '\r')) + lines = maxlines; + + if (input == Keystroke(61, 1)) { + break; + } + if (input == Keystroke(61, 2)) + ignore = TRUE; + else + lines = maxlines; + colour(CYAN, BLACK); + } + fflush(stdout); + } + } + + fclose(tf); + fclose(ma); + Pause(); + free(Tagname); + free(Msgname); } @@ -808,117 +808,116 @@ void OLR_ViewTags() */ int OLR_Prescan() { - unsigned short RetVal = FALSE, Areas; - unsigned long Number; - char *Temp; - FILE *mf, *tf; - int x; + unsigned short RetVal = FALSE, Areas; + unsigned long Number; + char *Temp; + FILE *mf, *tf; + int x; - WhosDoingWhat(OLR); - clear(); - colour(13, 0); - /* Offline Reader Download */ - printf("%s\n\n", (char *)Language(277)); - fflush(stdout); + WhosDoingWhat(OLR); + clear(); + colour(LIGHTMAGENTA, BLACK); + /* Offline Reader Download */ + printf("%s\n\n", (char *)Language(277)); + fflush(stdout); - if (exitinfo.Email) - check_popmail(exitinfo.Name, exitinfo.Password); + if (exitinfo.Email) + check_popmail(exitinfo.Name, exitinfo.Password); - Temp = calloc(PATH_MAX, sizeof(char)); - sprintf(Temp, "%s/etc/mareas.data", getenv("MBSE_ROOT")); - mf = fopen(Temp, "r"); - fread(&msgshdr, sizeof(msgshdr), 1, mf); + Temp = calloc(PATH_MAX, sizeof(char)); + sprintf(Temp, "%s/etc/mareas.data", getenv("MBSE_ROOT")); + mf = fopen(Temp, "r"); + fread(&msgshdr, sizeof(msgshdr), 1, mf); - sprintf(Temp, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); - tf = fopen(Temp, "r"); - Total = TotalPersonal = Areas = 0; + sprintf(Temp, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); + tf = fopen(Temp, "r"); + Total = TotalPersonal = Areas = 0; - colour(15, 1); - /* Forum Description Msgs. Pers. */ - printf("\n%s\n", (char *)Language(297)); + colour(WHITE, BLUE); + /* Forum Description Msgs. Pers. */ + printf("\n%s\n", (char *)Language(297)); - while (fread(&msgs, msgshdr.recsize, 1, mf) == 1) { - fseek(mf, msgshdr.syssize, SEEK_CUR); - fread(&olrtagrec, sizeof(olrtagrec), 1, tf); + while (fread(&msgs, msgshdr.recsize, 1, mf) == 1) { + fseek(mf, msgshdr.syssize, SEEK_CUR); + fread(&olrtagrec, sizeof(olrtagrec), 1, tf); - if (msgs.Active && Access(exitinfo.Security, msgs.RDSec) && strlen(msgs.QWKname) && olrtagrec.Tagged) { - if (Msg_Open(msgs.Base)) { - Areas++; - Current = Personal = 0; - colour(11, 0); - printf("%-20.20s %-41.41s ", msgs.QWKname, msgs.Name); - fflush(stdout); - - memset(&LR, 0, sizeof(LR)); - LR.UserID = grecno; - if (Msg_GetLastRead(&LR)) - Number = LR.HighReadMsg; - else - Number = Msg_Lowest() -1; - if (Number > Msg_Highest()) - Number = Msg_Highest(); - if (Msg_Next(&Number)) { - do { - Msg_ReadHeader(Number); - Current++; - Total++; - if ((strcasecmp(Msg.To, exitinfo.sUserName) == 0) || - (strcasecmp(Msg.To, exitinfo.sHandle) == 0)) { - Personal++; - TotalPersonal++; - } else if (msgs.Type == NETMAIL) { - Current--; - Total--; - } - } while (Msg_Next(&Number)); - } - - colour(10, 0); - printf("%5lu %5lu\n", Current, Personal); - fflush(stdout); - Msg_Close(); - } - } - } - - Syslog('+', "OLR Prescan: %u Areas, %lu Messages", Areas, Total); - - colour(9, 0); - /* Total messages found: */ - printf("\n%s %lu\n\n", (char *)Language(338), Total); - if (Total == 0L) { - colour(14, 0); - /* No messages found to download! */ - printf("%s\n\007", (char *)Language(374)); - Pause(); - } else { - if (CFG.OLR_MaxMsgs != 0 && Total > CFG.OLR_MaxMsgs) { - /* Too much messages. Only the first will be packed! */ - printf("%s %d %s\n\n\007", (char *)Language(377), CFG.OLR_MaxMsgs, (char *)Language(411)); - Total = CFG.OLR_MaxMsgs; - } - - colour(CFG.HiliteF, CFG.HiliteB); - /* Do you want to download these messages [Y/n]? */ - printf("%s", (char *)Language(425)); + if (msgs.Active && Access(exitinfo.Security, msgs.RDSec) && strlen(msgs.QWKname) && olrtagrec.Tagged) { + if (Msg_Open(msgs.Base)) { + Areas++; + Current = Personal = 0; + colour(LIGHTCYAN, BLACK); + printf("%-20.20s %-41.41s ", msgs.QWKname, msgs.Name); fflush(stdout); - alarm_on(); - x = toupper(Getone()); - if (x != Keystroke(425, 1)) { - RetVal = TRUE; - TotalPack = Total; - BarWidth = 0; + memset(&LR, 0, sizeof(LR)); + LR.UserID = grecno; + if (Msg_GetLastRead(&LR)) + Number = LR.HighReadMsg; + else + Number = Msg_Lowest() -1; + if (Number > Msg_Highest()) + Number = Msg_Highest(); + if (Msg_Next(&Number)) { + do { + Msg_ReadHeader(Number); + Current++; + Total++; + if ((strcasecmp(Msg.To, exitinfo.sUserName) == 0) || (strcasecmp(Msg.To, exitinfo.sHandle) == 0)) { + Personal++; + TotalPersonal++; + } else if (msgs.Type == NETMAIL) { + Current--; + Total--; + } + } while (Msg_Next(&Number)); } + + colour(LIGHTGREEN, BLACK); + printf("%5lu %5lu\n", Current, Personal); + fflush(stdout); + Msg_Close(); + } + } + } + + Syslog('+', "OLR Prescan: %u Areas, %lu Messages", Areas, Total); + + colour(LIGHTBLUE, BLACK); + /* Total messages found: */ + printf("\n%s %lu\n\n", (char *)Language(338), Total); + if (Total == 0L) { + colour(YELLOW, BLACK); + /* No messages found to download! */ + printf("%s\n\007", (char *)Language(374)); + Pause(); + } else { + if (CFG.OLR_MaxMsgs != 0 && Total > CFG.OLR_MaxMsgs) { + /* Too much messages. Only the first will be packed! */ + printf("%s %d %s\n\n\007", (char *)Language(377), CFG.OLR_MaxMsgs, (char *)Language(411)); + Total = CFG.OLR_MaxMsgs; } - if (mf != NULL) - fclose(mf); - if (tf != NULL) - fclose(tf); + colour(CFG.HiliteF, CFG.HiliteB); + /* Do you want to download these messages [Y/n]? */ + printf("%s", (char *)Language(425)); + fflush(stdout); + alarm_on(); + x = toupper(Getone()); - free(Temp); - return(RetVal); + if (x != Keystroke(425, 1)) { + RetVal = TRUE; + TotalPack = Total; + BarWidth = 0; + } + } + + if (mf != NULL) + fclose(mf); + if (tf != NULL) + fclose(tf); + + free(Temp); + return(RetVal); } @@ -928,23 +927,23 @@ int OLR_Prescan() */ void DrawBar(char *Pktname) { - colour(14, 0); - /* Preparing packet */ - printf("\n%s %s...\n\n", (char *)Language(445), Pktname); - colour(10, 0); - printf("0%% 10%% 20%% 30%% 40%% 50%% 60%% 70%% 80%% 90%% 100%%\n"); - printf("|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|\r"); - fflush(stdout); + colour(YELLOW, BLACK); + /* Preparing packet */ + printf("\n%s %s...\n\n", (char *)Language(445), Pktname); + colour(LIGHTGREEN, BLACK); + printf("0%% 10%% 20%% 30%% 40%% 50%% 60%% 70%% 80%% 90%% 100%%\n"); + printf("|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|\r"); + fflush(stdout); } void OLR_RestrictDate() { - WhosDoingWhat(OLR); + WhosDoingWhat(OLR); - printf("Not Yet Implemented\n"); - Pause(); + printf("Not Yet Implemented\n"); + Pause(); } @@ -1012,10 +1011,9 @@ USHORT TOffline::TooOld (ULONG Restrict, class TMsgBase *Msg) */ void OLR_Upload(void) { - char *File, *temp, *Arc; + char *File, *temp, *Arc, Dirpath[PATH_MAX], Filename[81]; time_t ElapstimeStart, ElapstimeFin, iTime; int err, Strlen, RetVal = FALSE; - struct stat statbuf; FILE *fp; if (strlen(CFG.bbsid) == 0) { @@ -1027,7 +1025,7 @@ void OLR_Upload(void) WhosDoingWhat(OLR); clear(); - colour(13, 0); + colour(LIGHTMAGENTA, BLACK); /* Offline Reader Upload */ printf("%s\n", (char *)Language(439)); @@ -1040,7 +1038,7 @@ void OLR_Upload(void) if (!uProtBatch) { Enter(1); /* Please enter file to upload: */ - pout(14, 0, (char *) Language(276)); + pout(YELLOW, BLACK, (char *) Language(276)); colour(CFG.InputColourF, CFG.InputColourB); GetstrC(File, 80); @@ -1126,32 +1124,18 @@ void OLR_Upload(void) Syslog('m', "Transfer time %ld", iTime); Home(); + sprintf(Dirpath, "%s/%s/upl", CFG.bbs_usersdir, exitinfo.Name); + sprintf(Filename, "%s.NEW", CFG.bbsid); + if (!RetVal) { - sprintf(File, "%s/%s/upl/%s.NEW", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - Syslog('m', "Check %s", File); - if (stat(File, &statbuf) == 0) - RetVal = TRUE; + RetVal = getfilecase(Dirpath, Filename); + Syslog('m', "%s RetVal=%s", Filename, RetVal?"True":"False"); } if (!RetVal) { - File = tl(File); - Syslog('m', "Check %s", File); - if (stat(File, &statbuf) == 0) - RetVal = TRUE; - } - - if (!RetVal) { - sprintf(File, "%s/%s/upl/%s.REP", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - Syslog('m', "Check %s", File); - if (stat(File, &statbuf) == 0) - RetVal = TRUE; - } - - if (!RetVal) { - File = tl(File); - Syslog('m', "Check %s", File); - if (stat(File, &statbuf) == 0) - RetVal = TRUE; + sprintf(Filename, "%s.REP", CFG.bbsid); + RetVal = getfilecase(Dirpath, Filename); + Syslog('m', "%s RetVal=%s", Filename, RetVal?"True":"False"); } if (RetVal == FALSE) { @@ -1161,6 +1145,8 @@ void OLR_Upload(void) sleep(2); return; } + + sprintf(File, "%s/%s", Dirpath, Filename); Syslog('+', "Received OLR packet %s", File); if ((Arc = GetFileType(File)) == NULL) { @@ -1218,72 +1204,40 @@ void OLR_Upload(void) unlink(File); /* - * Check for BlueWave files, upper and lowercase. + * Check for BlueWave files, case insensitive. */ RetVal = FALSE; - sprintf(temp, "%s/%s/%s.UPL", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; + sprintf(Dirpath, "%s/%s", CFG.bbs_usersdir, exitinfo.Name); + sprintf(Filename, "%s.UPL", CFG.bbsid); + RetVal = getfilecase(Dirpath, Filename); + Syslog('m', "%s RetVal=%s", Filename, RetVal?"True":"False"); - temp = tl(temp); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; + if (!RetVal) { + sprintf(Filename, "%s.REQ", CFG.bbsid); + RetVal = getfilecase(Dirpath, Filename); + Syslog('m', "%s RetVal=%s", Filename, RetVal?"True":"False"); + } - sprintf(temp, "%s/%s/%s.UPI", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; - - temp = tl(temp); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; - - sprintf(temp, "%s/%s/%s.NET", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; - - temp = tl(temp); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; - - sprintf(temp, "%s/%s/%s.REQ", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; - - temp = tl(temp); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; - - sprintf(temp, "%s/%s/%s.PDQ", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; - - temp = tl(temp); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; - - sprintf(temp, "%s/%s/%s.OLC", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; - - temp = tl(temp); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; + if (!RetVal) { + sprintf(Filename, "%s.OLC", CFG.bbsid); + RetVal = getfilecase(Dirpath, Filename); + Syslog('m', "%s RetVal=%s", Filename, RetVal?"True":"False"); + } if (RetVal) { - Syslog('+', "OLR packet is BlueWave"); + Syslog('+', "OLR packet is BlueWave v3"); free(File); free(temp); BlueWave_Fetch(); return; } - sprintf(temp, "%s/%s/%s.MSG", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; - - temp = tl(temp); - if (!file_exist(temp, R_OK)) - RetVal = TRUE; + /* + * Check for QWK packet + */ + sprintf(Filename, "%s.MSG", CFG.bbsid); + RetVal = getfilecase(Dirpath, Filename); + Syslog('m', "%s RetVal=%s", Filename, RetVal?"True":"False"); if (RetVal) { Syslog('+', "OLR packet is QWK"); @@ -1343,7 +1297,7 @@ void OLR_DownBW() Total = TotalPersonal = 0; clear(); - colour(9, 0); + colour(LIGHTBLUE, BLACK); /* BlueWave Offline download */ printf("%s\n", (char *)Language(444)); @@ -1429,7 +1383,7 @@ void OLR_DownBW() fread(&olrtagrec, sizeof(olrtagrec), 1, tf); Area++; - if (msgs.Active && Access(exitinfo.Security, msgs.RDSec)) { + if (msgs.Active && Access(exitinfo.Security, msgs.RDSec) && strlen(msgs.QWKname)) { memset(&AreaInf, 0, sizeof(AreaInf)); sprintf((char *)AreaInf.areanum, "%lu", Area); strcpy((char *)AreaInf.echotag, msgs.QWKname); @@ -1584,40 +1538,40 @@ void OLR_DownBW() */ void BlueWave_Fetch() { - char *temp; - char *buffer,*b; - FILE *fp, *up, *mf, *tp, *iol; + char *temp, *buffer, *b, Dirpath[PATH_MAX], Filename[81], Echotag[20]; + FILE *fp, *up = NULL, *mf, *tp = NULL, *iol = NULL; UPL_HEADER Uph; UPL_REC Upr; - PDQ_HEADER Pdh; - PDQ_REC Pdr; REQ_REC Req; - int i, Found, OLC_head, OLC_filter, OLC_macro, OLC_keyword, HEAD_written; + int i = 0, j, Found, OLC_head, AreaChanges = FALSE; fidoaddr dest; time_t now; struct tm *tm; - colour(9, 0); + colour(LIGHTBLUE, BLACK); /* Processing BlueWave reply packet */ printf("%s\n", (char *)Language(450)); temp = calloc(PATH_MAX, sizeof(char)); - b = calloc(255, sizeof(char)); + b = calloc(256, sizeof(char)); buffer = b; + /* * Process uploaded mail */ - sprintf(temp, "%s/%s/%s.UPL", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if ((up = fopen(temp, "r")) == NULL) { - temp = tl(temp); + sprintf(Dirpath, "%s/%s", CFG.bbs_usersdir, exitinfo.Name); + sprintf(Filename, "%s.UPL", CFG.bbsid); + if (getfilecase(Dirpath, Filename)) { + sprintf(temp, "%s/%s", Dirpath, Filename); up = fopen(temp, "r"); } if (up != NULL) { fread(&Uph, sizeof(UPL_HEADER), 1, up); - Syslog('+', "Processing BlueWave .UPL file"); + Syslog('+', "Processing BlueWave v3 \"%s\" file", Filename); Syslog('+', "Client: %s %d.%d", Uph.reader_name, Uph.reader_major, Uph.reader_minor); if (Uph.upl_header_len != sizeof(UPL_HEADER)) { WriteError("Recordsize mismatch"); fclose(up); + free(temp); /* ERROR in packet */ printf("%s\n", (char *)Language(451)); Pause(); @@ -1763,21 +1717,7 @@ void BlueWave_Fetch() } fflush(stdout); fclose(up); - - /* - * Remove processed files. - */ - sprintf(temp, "%s/%s/%s.UPL", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - unlink(temp); - temp = tl(temp); - unlink(temp); - sprintf(temp, "%s/%s/%s.UPI", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - unlink(temp); - temp = tl(temp); - unlink(temp); - sprintf(temp, "%s/%s/%s.NET", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - unlink(temp); - temp = tl(temp); + sprintf(temp, "%s/%s", Dirpath, Filename); unlink(temp); } @@ -1786,283 +1726,172 @@ void BlueWave_Fetch() newtear = NULL; } - - /* - * If a .UPL file was not found it is possible we received an version 2 - * reply packet. - */ - sprintf(temp, "%s/%s/%s.UPI", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if ((up = fopen(temp, "r")) == NULL) { - temp = tl(temp); - up = fopen(temp, "r"); - } - if (up != NULL) { - Syslog('+', "Received Version 2 .UPI packet, not supported"); - fclose(up); - } - sprintf(temp, "%s/%s/%s.NET", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if ((up = fopen(temp, "r")) == NULL) { - temp = tl(temp); - up = fopen(temp, "r"); - } - if (up != NULL) { - Syslog('+', "Received Version 2 .NET packet, not supported"); - fclose(up); - } - /* * Process offline configuration */ - sprintf(temp, "%s/%s/%s.OLC", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if ((iol = fopen(temp, "r")) == NULL) { - temp = tl(temp); + sprintf(Filename, "%s.OLC", CFG.bbsid); + if (getfilecase(Dirpath, Filename)) { + sprintf(temp, "%s/%s", Dirpath, Filename); iol = fopen(temp, "r"); } if (iol != NULL) { - /* - * If .OLC file found convert it in .PDQ - */ - sprintf(temp, "%s/%s/%s.PDQ", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - Syslog('+', "Converting BW/v3 .OLC file to %s",temp); - if (( tp = fopen(temp, "w")) != NULL) { - HEAD_written=FALSE; - OLC_head=FALSE; - OLC_filter=OLC_macro=OLC_keyword=0; - memset(&Pdh,0,sizeof(PDQ_HEADER)); - Syslog('f', "%s Opened for writing", temp); - while (fgets(b,255,iol) != NULL ){ - buffer=b; - while (isspace(buffer[0])) - buffer++; - Syslog('m', "Reading: %s ", buffer); - if (( strncasecmp(buffer,"[Global",7) == 0) && (strlen(buffer) > 22) ){ - OLC_head=TRUE; - continue; - }else{ - if (buffer[0]=='['){ - strtok(buffer,"]"); - buffer++; - OLC_head=FALSE; - strncpy(Pdr.echotag,buffer,20); - continue; - } - } - if (OLC_head == TRUE){ - if (strncasecmp(buffer,"AreaChanges",11)==0){ - buffer+=11; - while (isspace(buffer[0]) || buffer[0]=='=') - buffer++; - if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0)) - Pdh.flags |= PDQ_AREA_CHANGES; - continue; - } - if (strncasecmp(buffer,"MenuHotKeys",11)==0){ - buffer+=11; - while (isspace(buffer[0]) || buffer[0]=='=') - buffer++; - if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0)) - Pdh.flags |= PDQ_HOTKEYS; - continue; - } - if ( (strncasecmp(buffer,"ExpertMenus",11)==0)){ - buffer+=11; - while (isspace(buffer[0]) || buffer[0]=='=') - buffer++; - if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0)) - Pdh.flags |= PDQ_XPERT; - continue; - } - if (strncasecmp(buffer,"SkipUserMsgs",12)==0){ - buffer+=12; - while (isspace(buffer[0]) || buffer[0]=='=') - buffer++; - if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0)) - Pdh.flags |= PDQ_NOT_MY_MAIL; - continue; - } - if (strncasecmp(buffer,"DoorGraphics",12)==0){ - buffer+=12; - while (isspace(buffer[0]) || buffer[0]=='=') - buffer++; - if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0)) - Pdh.flags |= PDQ_GRAPHICS; - continue; - } - if (strncasecmp(buffer,"Password",8)==0){ - buffer+=8; - while (isspace(buffer[0]) || buffer[0]=='=') - buffer++; - Pdh.passtype=0; - if(strncasecmp(buffer,"Door",4)==0) - Pdh.passtype=1; - if(strncasecmp(buffer,"Reader",6)==0) - Pdh.passtype=2; - if(strncasecmp(buffer,"Both",4)==0) - Pdh.passtype=3; - while(buffer[0] != ',' && buffer[0] !='\0') - buffer++; - if ( Pdh.passtype != 0 ){ - while (isspace(buffer[0])); - buffer++; - strncpy(Pdh.password,buffer,20); + colour(LIGHTBLUE, BLACK); + /* Processing Offline Configuration */ + printf("%s\n", (char *)Language(455)); + Syslog('+', "Processing BlueWave v3 configuration file \"%s\"", Filename); + OLC_head = FALSE; + + while (fgets(b, 255, iol) != NULL ) { + buffer = b; + for (j = 0; j < strlen(b); j++) { + if (*(b + j) == '\0') + break; + if (*(b + j) == '\r') + *(b + j) = '\0'; + if (*(b + j) == '\n') + *(b + j) = '\0'; + } + while (isspace(buffer[0])) + buffer++; + Syslog('m', "Reading: \"%s\"", printable(buffer, 0)); + + /* + * The .OLC file starts with [Global Mail Host Configuration] + * Then some global options. + * Then each mail area like [AREA_TAG] + * Then the area options. + */ + if ((strncasecmp(buffer,"[Global",7) == 0) && (strlen(buffer) > 22) ) { + OLC_head = TRUE; + continue; + } else { + if (buffer[0]=='[') { + strtok(buffer,"]"); + buffer++; + strncpy(Echotag, buffer, 20); + if (OLC_head) { + OLC_head = FALSE; + if (AreaChanges) { + /* + * There are areachanges, first reset all areas. + */ + Syslog('m', "Resetting all areas"); + sprintf(temp, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); + if ((up = fopen(temp, "r+")) != NULL) { + sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT")); + if ((mf = fopen(temp, "r")) != NULL) { + fread(&msgshdr, sizeof(msgshdr), 1, mf); + while (fread(&olrtagrec, sizeof(olrtagrec), 1, up) == 0) { + fread(&msgs, msgshdr.recsize, 1, mf); + fseek(mf, msgshdr.syssize, SEEK_CUR); + if (!msgs.OLR_Forced) + olrtagrec.Tagged = FALSE; + fseek(up, - sizeof(olrtagrec), SEEK_CUR); + fwrite(&olrtagrec, sizeof(olrtagrec), 1, up); + } + fclose(mf); + } + fclose(up); + } + i = 0; } - continue; - } - if (strncasecmp(buffer,"Filter",6)==0){ - buffer+=6; - while (isspace(buffer[0]) || buffer[0]=='=') - buffer++; - strncpy(Pdh.filters[OLC_filter],buffer,20); - OLC_filter++; - continue; - } - if (strncasecmp(buffer,"Keyword",7)==0){ - buffer+=7; - while (isspace(buffer[0]) || buffer[0]=='=') - buffer++; - strncpy(Pdh.keywords[OLC_keyword],buffer,20); - OLC_keyword++; - continue; - } - if (strncasecmp(buffer,"Macro=",5)==0){ - buffer+=5; - while (isspace(buffer[0]) || buffer[0]=='=') - buffer++; - strncpy(Pdh.macros[OLC_macro],buffer,20); - OLC_macro++; - continue; - } continue; - } - if (strncasecmp(buffer,"Scan",4) == 0){ - buffer+=4; - while (isspace(buffer[0]) || buffer[0]=='=') - buffer++; - if ((strncasecmp(buffer,"All",3)==0) || (strncasecmp(buffer,"Pers",4)==0)){ - if ( HEAD_written == FALSE ){ - fwrite(&Pdh,sizeof(PDQ_HEADER),1,tp); - Syslog('m', "Writting PDQ header..."); - HEAD_written = TRUE; - } - if (strlen(Pdr.echotag) > 0){ - fwrite(&Pdr,sizeof(PDQ_REC),1,tp); - Syslog('m', "Writting PDQ record: %s", Pdr.echotag); - memset(&Pdr,0,sizeof(PDQ_REC)); - } } } } - fclose(tp); - } else { - WriteError("Unable to convert .OLC file to %s/%s/%s.PDQ", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - Syslog('?', "Unable to convert .OLC file to %s/%s/%s.PDQ",CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - } - fclose(iol); - sprintf(temp, "%s/%s/%s.OLC", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - unlink(temp); - temp = tl(temp); - unlink(temp); - } - sprintf(temp, "%s/%s/%s.PDQ", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if ((tp = fopen(temp, "r")) == NULL) { - temp = tl(temp); - tp = fopen(temp, "r"); - } - if (tp != NULL) { - colour(9, 0); - /* Processing Offline Configuration */ - printf("%s\n", (char *)Language(455)); - Syslog('+', "Processing offline configuration"); - - fread(&Pdh, sizeof(PDQ_HEADER), 1, tp); - for (i = 0; i < 10; i++) - if (strlen(Pdh.keywords[i])) - Syslog('m', " Kwrd %2d : %s", i+1, Pdh.keywords[i]); - for (i = 0; i < 10; i++) - if (strlen(Pdh.filters[i])) - Syslog('m', " Filt %2d : %s", i+1, Pdh.filters[i]); - for (i = 0; i < 3; i++) - if (strlen(Pdh.macros[i])) - Syslog('m', " Macro %d : %s", i+1, Pdh.macros[i]); - Syslog('m', " Pwtype : %d", Pdh.passtype); - Syslog('m', " Flags : %08x", Pdh.flags); - - /* - * If the changes flag is set there are records with - * active areas. Reset all areas first and then set - * the active areas back on. - */ - if (Pdh.flags & PDQ_AREA_CHANGES) { - Syslog('+', " New Area Configuration present"); - i = 0; - - sprintf(temp, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); - if ((up = fopen(temp, "r+")) != NULL) { - - sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT")); - if ((mf = fopen(temp, "r")) != NULL) { - - fread(&msgshdr, sizeof(msgshdr), 1, mf); - - while (fread(&olrtagrec, sizeof(olrtagrec), 1, up) == 0) { - fread(&msgs, msgshdr.recsize, 1, mf); - fseek(mf, msgshdr.syssize, SEEK_CUR); - if (!msgs.OLR_Forced) - olrtagrec.Tagged = FALSE; - fseek(up, - sizeof(olrtagrec), SEEK_CUR); - fwrite(&olrtagrec, sizeof(olrtagrec), 1, up); - } - - while (fread(&Pdr, sizeof(PDQ_REC), 1, tp) == 1) { - if (strlen(Pdr.echotag)) { - fseek(mf, msgshdr.hdrsize, SEEK_SET); - fseek(up, 0, SEEK_SET); - while (fread(&msgs, msgshdr.recsize, 1, mf) == 1) { - fseek(mf, msgshdr.syssize, SEEK_CUR); - fread(&olrtagrec, sizeof(olrtagrec), 1, up); - if ((strcmp(msgs.QWKname, Pdr.echotag) == 0) && (msgs.Active) && - (Access(exitinfo.Security, msgs.RDSec))) { - Syslog('m', " Area %s", Pdr.echotag); - olrtagrec.Tagged = TRUE; - fseek(up, - sizeof(olrtagrec), SEEK_CUR); - fwrite(&olrtagrec, sizeof(olrtagrec), 1, up); - i++; - break; + /* + * Process header commands + */ + if (OLC_head == TRUE){ + if (strncasecmp(buffer,"AreaChanges", 11) == 0) { + buffer += 11; + while (isspace(buffer[0]) || buffer[0] == '=') + buffer++; + if ((strncasecmp(buffer,"TRUE",4)==0) || (strncasecmp(buffer,"YES",3)==0) || (strncasecmp(buffer,"ON",2)==0)) + AreaChanges = TRUE; + } + if (strncasecmp(buffer,"MenuHotKeys", 11) == 0) { + Syslog('m', "%s - ignored", printable(buffer, 0)); + } + if (strncasecmp(buffer,"ExpertMenus", 11 ) == 0) { + Syslog('m', "%s - ignored", printable(buffer, 0)); + } + if (strncasecmp(buffer,"SkipUserMsgs", 12) == 0) { + Syslog('m', "%s - ignored", printable(buffer, 0)); + } + if (strncasecmp(buffer,"DoorGraphics", 12) == 0) { + Syslog('m', "%s - ignored", printable(buffer, 0)); + } + if (strncasecmp(buffer,"Password", 8) == 0) { + Syslog('m', "%s - ignored", printable(buffer, 0)); + } + if (strncasecmp(buffer,"Filter", 6) == 0) { + Syslog('m', "%s - ignored", printable(buffer, 0)); + } + if (strncasecmp(buffer,"Keyword", 7) == 0) { + Syslog('m', "%s - ignored", printable(buffer, 0)); + } + if (strncasecmp(buffer,"Macro",5) == 0) { + Syslog('m', "%s - ignored", printable(buffer, 0)); + } + continue; + } else { + if (strncasecmp(buffer,"Scan", 4) == 0) { + buffer+=4; + while (isspace(buffer[0]) || buffer[0] == '=') + buffer++; + if ((strncasecmp(buffer,"All",3)==0) || (strncasecmp(buffer,"Pers",4)==0)) { + if (strlen(Echotag) > 0) { + sprintf(temp, "%s/%s/.olrtags", CFG.bbs_usersdir, exitinfo.Name); + if ((up = fopen(temp, "r+")) != NULL) { + sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT")); + if ((mf = fopen(temp, "r")) != NULL) { + fread(&msgshdr, sizeof(msgshdr), 1, mf); + while (fread(&msgs, msgshdr.recsize, 1, mf) == 1) { + fseek(mf, msgshdr.syssize, SEEK_CUR); + fread(&olrtagrec, sizeof(olrtagrec), 1, up); + if ((strcmp(msgs.QWKname, Echotag) == 0) && (msgs.Active) && + (Access(exitinfo.Security, msgs.RDSec)) && strlen(msgs.QWKname)) { + Syslog('m', " Area %s", Echotag); + olrtagrec.Tagged = TRUE; + fseek(up, - sizeof(olrtagrec), SEEK_CUR); + fwrite(&olrtagrec, sizeof(olrtagrec), 1, up); + i++; + break; + } + } + fclose(mf); } + fclose(up); } } } - fclose(mf); - colour(3, 0); - /* Message areas selected */ - printf("%d %s\n", i, (char *)Language(456)); - Syslog('+', " %d active message areas.", i); } - fclose(up); } } - fclose(tp); - sprintf(temp, "%s/%s/%s.PDQ", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - unlink(temp); - temp = tl(temp); + fclose(iol); + sprintf(temp, "%s/%s", Dirpath, Filename); unlink(temp); + colour(CYAN, BLACK); + /* Message areas selected */ + printf("%d %s\n", i, (char *)Language(456)); + Syslog('+', " %d active message areas.", i); } /* * Check for .REQ file. */ - sprintf(temp, "%s/%s/%s.REQ", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if ((tp = fopen(temp, "r")) == NULL) { - temp = tl(temp); + sprintf(Filename, "%s.REQ", CFG.bbsid); + if (getfilecase(Dirpath, Filename)) { tp = fopen(temp, "r"); } if (tp != NULL) { i = 0; - colour(9, 0); +// colour(LIGHTBLUE, BLACK); /* Processing file requests */ - printf("%s\n", (char *)Language(457)); - Syslog('+', "Processing file requests"); +// printf("%s\n", (char *)Language(457)); + Syslog('+', "Processing file requests %s (not supported)", Filename); while (fread(&Req, sizeof(REQ_REC), 1, tp) == 1) { Syslog('m', " File %s", Req.filename); @@ -2160,8 +1989,8 @@ unsigned long BlueWave_PackArea(unsigned long ulLast, long Area) if ((Text = (char *)MsgText_First()) != NULL) { do { - if ((Text[0] != 0x01 && strncmp(Text, "SEEN-BY: ", 9))|| - (strncmp(Text, "\001MSGID", 6) == 0) /* || (exitinfo.OL_ExtInfo) */ ) { + if ((Text[0] != 0x01) || (strncmp(Text, "\001MSGID", 6) == 0) || + ((strncmp(Text, "\001FMPT ", 6) == 0) && (msgs.Type == NETMAIL)) || (exitinfo.OL_ExtInfo)) { Fti.msglength += fwrite(Text, 1, strlen(Text), fdm); Fti.msglength += fwrite("\r\n", 1, 2, fdm); } @@ -2173,7 +2002,7 @@ unsigned long BlueWave_PackArea(unsigned long ulLast, long Area) if (BarWidth != (unsigned short)((Total * 61L) / TotalPack)) { BarWidth = (unsigned short)((Total * 61L) / TotalPack); - colour(3, 0); + colour(CYAN, BLACK); printf("\r%.*s", BarWidth, "ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл"); fflush(stdout); } @@ -2230,7 +2059,7 @@ void OLR_DownQWK(void) Total = TotalPersonal = 0L; clear(); - colour(9, 0); + colour(LIGHTBLUE, BLACK); /* QWK Offline Download */ printf("%s\n", (char *)Language(458)); @@ -2441,29 +2270,29 @@ void OLR_DownQWK(void) */ void QWK_Fetch() { - char *temp, *otemp, Temp[128], szLine[132], *pLine = NULL, *pBuff; - FILE *fp, *up, *op, *mf; + char *temp, *otemp, Temp[128], szLine[132], *pLine = NULL, *pBuff, Dirpath[PATH_MAX], Filename[81]; + FILE *fp, *up = NULL, *op, *mf; unsigned short nRec, i, r, x, nCol = 0, nWidth, nReaded, nPosted = 0; unsigned long Area; struct tm *ltm = NULL; fidoaddr dest; int HasTear; - colour(9, 0); + colour(LIGHTBLUE, BLACK); /* Processing BlueWave reply packet */ printf("%s\n", (char *)Language(459)); temp = calloc(2048, sizeof(char)); otemp = calloc(PATH_MAX, sizeof(char)); nWidth = 78; - sprintf(temp, "%s/%s/%s.MSG", CFG.bbs_usersdir, exitinfo.Name, CFG.bbsid); - if ((up = fopen(temp, "r")) == NULL) { - temp = tl(temp); + sprintf(Dirpath, "%s/%s", CFG.bbs_usersdir, exitinfo.Name); + sprintf(Filename, "%s.MSG", CFG.bbsid); + if (getfilecase(Dirpath, Filename)) { up = fopen(temp, "r"); } if (up != NULL) { - Syslog('+', "Processing QWK file %s", temp); + Syslog('+', "Processing QWK file %s", Filename); fread(&Temp, 128, 1, up); Temp[8] = '\0'; @@ -2841,7 +2670,8 @@ unsigned long QWK_PackArea(unsigned long ulLast, long Area) Size = 128L; if ((Text = (char *)MsgText_First()) != NULL) { do { - if (Text[0] != 0x01 && strncmp(Text, "SEEN-BY: ", 9)) { + if ((Text[0] != 0x01) || (strncmp(Text, "\001MSGID", 6) == 0) || + ((strncmp(Text, "\001FMPT ", 6) == 0) && (msgs.Type == NETMAIL)) || (exitinfo.OL_ExtInfo)) { Size += fwrite(Text, 1, strlen(Text), fdm); Size += fwrite("\xE3", 1, 1, fdm); } @@ -2862,7 +2692,7 @@ unsigned long QWK_PackArea(unsigned long ulLast, long Area) if (BarWidth != (unsigned short)((Total * 61L) / TotalPack)) { BarWidth = (unsigned short)((Total * 61L) / TotalPack); - colour(3, 0); + colour(CYAN, BLACK); printf("\r%.*s", BarWidth, "ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл"); fflush(stdout); } @@ -2932,7 +2762,7 @@ void OLR_DownASCII(void) Total = TotalPersonal = 0L; clear(); - colour(9, 0); + colour(LIGHTBLUE, BLACK); /* ASCII Offline Download */ printf("%s\n", (char *)Language(460)); @@ -3048,77 +2878,78 @@ void OLR_DownASCII(void) */ unsigned long ASCII_PackArea(unsigned long ulLast, long Area) { - FILE *fp; - char *Work, *Temp, *Text; - unsigned long Number; - int Pack = FALSE; - struct tm *tp; + FILE *fp; + char *Work, *Temp, *Text; + unsigned long Number; + int Pack = FALSE; + struct tm *tp; - Number = ulLast; - Current = Personal = 0L; + Number = ulLast; + Current = Personal = 0L; - Temp = calloc(128, sizeof(char)); - Work = calloc(128, sizeof(char)); - sprintf(Work, "%s/%s/tmp", CFG.bbs_usersdir, exitinfo.Name); + Temp = calloc(PATH_MAX, sizeof(char)); + Work = calloc(PATH_MAX, sizeof(char)); + sprintf(Work, "%s/%s/tmp", CFG.bbs_usersdir, exitinfo.Name); - sprintf(Temp, "%s/%03ld.TXT", Work, Area); - if ((fp = fopen(Temp, "a+")) != NULL) { - if (Msg_Next(&Number)) { - do { - Msg_ReadHeader(Number); - Msg_Read(Number, 78); - Pack = TRUE; - if ((strcasecmp(Msg.To, exitinfo.sUserName) == 0) || - (strcasecmp(Msg.To, exitinfo.sHandle) == 0)) { - Personal++; - TotalPersonal++; - } else if (msgs.Type == NETMAIL) { - Pack = FALSE; - } else if ( msgs.MsgKinds == PRIVATE ) { - Pack = FALSE; - } else if (msgs.MsgKinds == BOTH ) { - if ( Msg.Private == TRUE ) Pack = FALSE; - } - - if (Pack) { - fprintf (fp, "\n==============================================\n Msg. #%ld of %ld (%s)\n", Number, Msg_Number(), msgs.Name); - tp = localtime(&Msg.Written); - fprintf (fp, " Date: %d %s %d %2d:%02d\n", tp->tm_mday, - GetMonth(tp->tm_mon + 1), tp->tm_year, tp->tm_hour, tp->tm_min); - fprintf (fp, " From: %s\n", Msg.From); - if (Msg.To[0]) - fprintf (fp, " To: %s\n", Msg.To); - fprintf (fp, "Subject: %s\n----------------------------------------------\n", Msg.Subject); - Current++; - Total++; - - if ((Text = (char *)MsgText_First()) != NULL) { - do { - if (Text[0] != 0x01 && strncmp(Text, "SEEN-BY: ", 9)) - fprintf(fp, "%s\n", Text); - } while ((Text = (char *)MsgText_Next()) != NULL); - } - - if ((Total % 16L) == 0L) - usleep(1); - - if (BarWidth != (unsigned short)((Total * 61L) / TotalPack)) { - BarWidth = (unsigned short)((Total * 61L) / TotalPack); - colour(3, 0); - printf("\r%.*s", BarWidth, "ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл"); - fflush(stdout); - } - } - } while (Msg_Next(&Number)); + sprintf(Temp, "%s/%03ld.TXT", Work, Area); + if ((fp = fopen(Temp, "a+")) != NULL) { + if (Msg_Next(&Number)) { + do { + Msg_ReadHeader(Number); + Msg_Read(Number, 78); + Pack = TRUE; + if ((strcasecmp(Msg.To, exitinfo.sUserName) == 0) || (strcasecmp(Msg.To, exitinfo.sHandle) == 0)) { + Personal++; + TotalPersonal++; + } else if (msgs.Type == NETMAIL) { + Pack = FALSE; + } else if ( msgs.MsgKinds == PRIVATE ) { + Pack = FALSE; + } else if (msgs.MsgKinds == BOTH ) { + if ( Msg.Private == TRUE ) + Pack = FALSE; } - fclose(fp); - } else { - WriteError("Not all files open"); - } - free(Work); - free(Temp); - return Number; + if (Pack) { + fprintf (fp, "\n==============================================\n Msg. #%ld of %ld (%s)\n", + Number, Msg_Number(), msgs.Name); + tp = localtime(&Msg.Written); + fprintf (fp, " Date: %d %s %d %2d:%02d\n", tp->tm_mday, + GetMonth(tp->tm_mon + 1), tp->tm_year, tp->tm_hour, tp->tm_min); + fprintf (fp, " From: %s\n", Msg.From); + if (Msg.To[0]) + fprintf (fp, " To: %s\n", Msg.To); + fprintf (fp, "Subject: %s\n----------------------------------------------\n", Msg.Subject); + Current++; + Total++; + + if ((Text = (char *)MsgText_First()) != NULL) { + do { + if (Text[0] != 0x01 && strncmp(Text, "SEEN-BY: ", 9)) + fprintf(fp, "%s\n", Text); + } while ((Text = (char *)MsgText_Next()) != NULL); + } + + if ((Total % 16L) == 0L) + usleep(1); + + if (BarWidth != (unsigned short)((Total * 61L) / TotalPack)) { + BarWidth = (unsigned short)((Total * 61L) / TotalPack); + colour(CYAN, BLACK); + printf("\r%.*s", BarWidth, "ллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл"); + fflush(stdout); + } + } + } while (Msg_Next(&Number)); + } + fclose(fp); + } else { + WriteError("Not all files open"); + } + + free(Work); + free(Temp); + return Number; } diff --git a/mbsetup/ledit.c b/mbsetup/ledit.c index ec421000..98df08a9 100644 --- a/mbsetup/ledit.c +++ b/mbsetup/ledit.c @@ -2148,6 +2148,7 @@ char *getmenutype(int val) case 317: return (char *)"Change FS edit shortcut keys"; case 318: return (char *)"Change address"; case 319: return (char *)"Change .signature file"; + case 320: return (char *)"Change OLR Extended Info"; case 401: return (char *)"Add oneliner"; case 402: return (char *)"List oneliners"; diff --git a/mbsetup/m_menu.c b/mbsetup/m_menu.c index b5ff5c43..c69a766c 100644 --- a/mbsetup/m_menu.c +++ b/mbsetup/m_menu.c @@ -198,7 +198,7 @@ int GetMenuType(void) case 1: return GetSubmenu(1, 21); case 2: return GetSubmenu(101, 19); case 3: return GetSubmenu(201, 21); - case 4: return GetSubmenu(301, 19); + case 4: return GetSubmenu(301, 20); case 5: return GetSubmenu(401, 5); case 6: return GetSubmenu(501, 6); default: return 0;