Added Russion support

This commit is contained in:
Michiel Broek 2005-01-14 19:52:12 +00:00
parent 7a3b700eac
commit bb9fd9dcb8
8 changed files with 68 additions and 19 deletions

View File

@ -51,4 +51,4 @@ Przemyslaw Kwiatkowski 2:480/127@fidonet
Phil Kimble kimerud@users.sourceforge.net 1:14/200@fidonet Phil Kimble kimerud@users.sourceforge.net 1:14/200@fidonet
David Gonzalez skynetbbs@007mundo.com 4:930/1@fidonet David Gonzalez skynetbbs@007mundo.com 4:930/1@fidonet
Malte Tychsen 2:240/9350@fidonet Malte Tychsen 2:240/9350@fidonet
Dmitry Komissaroff rsprog@mail.ru

View File

@ -18,6 +18,8 @@ v0.71.1 28-Nov-2004
Added port to OpenBSD, is under test (and doesn't work). Added port to OpenBSD, is under test (and doesn't work).
Code cleanup so that compile stops on unknown OSes and CPUs Code cleanup so that compile stops on unknown OSes and CPUs
instead of missing code parts. instead of missing code parts.
Added Unix codepage KOI8-R (Russian) and patches from Dmitry
Komissaroff.
mbsebbs: mbsebbs:
The creation of the mailout semafore is now after the hangup The creation of the mailout semafore is now after the hangup
@ -28,6 +30,8 @@ v0.71.1 28-Nov-2004
Made zmodem-8k downloads work again. Made zmodem-8k downloads work again.
Some small buffer protections added in addfile. Some small buffer protections added in addfile.
Fixed keyboad input for all bigendian machines. Fixed keyboad input for all bigendian machines.
Patches from Dmitry Komissaroff to make charset translation
work on message subject lines.
mbnewuser: mbnewuser:
During hangup we set sighup to ignore. During hangup we set sighup to ignore.
@ -66,6 +70,10 @@ v0.71.1 28-Nov-2004
is fresh created. is fresh created.
Changed X-JAM kludges to X-FTN kludges to make it compatible Changed X-JAM kludges to X-FTN kludges to make it compatible
with the rest of the gates. with the rest of the gates.
Patches from Dmitry Komissaroff to make charset translation
work on message subject lines. It will now also send the right
charset of the user in the charset header line so that the
client will show the message in the users charset.
mbsetup: mbsetup:
Added support for XxxxBSD console port. Added support for XxxxBSD console port.

View File

@ -113,6 +113,7 @@ void auth_pass(char *cmd)
while (fread(&usrconfig, usrconfighdr.recsize, 1, fp) == 1) { while (fread(&usrconfig, usrconfighdr.recsize, 1, fp) == 1) {
if (strcmp(usrconfig.Name, username) == 0) { if (strcmp(usrconfig.Name, username) == 0) {
FoundName = TRUE; FoundName = TRUE;
usercharset=usrconfig.Charset;
break; break;
} }
grecno++; grecno++;

View File

@ -105,6 +105,27 @@ char *make_msgid(char *msgid)
char *getrfcchrs(int val)
{
switch (val) {
case FTNC_NONE: return (char *)"iso-8859-1";
case FTNC_CP437: return (char *)"cp437";
case FTNC_CP850: return (char *)"cp850";
case FTNC_CP865: return (char *)"cp865";
case FTNC_CP866: return (char *)"cp866";
case FTNC_CP852: return (char *)"cp852";
case FTNC_CP895: return (char *)"cp895";
case FTNC_LATIN_1: return (char *)"iso-8859-1";
case FTNC_LATIN_2: return (char *)"iso-8859-2";
case FTNC_LATIN_5: return (char *)"iso-8859-5";
case FTNC_MAC: return (char *)"MAC 2";
case FTNC_KOI8_R: return (char *)"koi8-r";
default: return (char *)"iso-8859-1";
}
}
/* /*
* ARTICLE * ARTICLE
* BODY * BODY
@ -173,10 +194,12 @@ void command_abhs(char *buf)
return; return;
} }
/* /*
* Setup a default translation * Setup a charset translation
*/ */
charset_set_in_out((char *)"x-ibmpc", (char *)"iso-8859-1"); charset_set_in_out(getrfcchrs(msgs.Charset),getrfcchrs(usercharset));
if (Msg_Read(art, 75)) { if (Msg_Read(art, 75)) {
@ -192,7 +215,9 @@ void command_abhs(char *buf)
send_nntp("Path: MBNNTP!not-for-mail"); send_nntp("Path: MBNNTP!not-for-mail");
send_nntp("From: %s <%s>", Msg.From, Msg.FromAddress); send_nntp("From: %s <%s>", Msg.From, Msg.FromAddress);
send_nntp("Newsgroups: %s", currentgroup); send_nntp("Newsgroups: %s", currentgroup);
send_nntp("Subject: %s", Msg.Subject); char *subj;
asprintf(&subj,"Subject: %s", Msg.Subject);
send_xlat(subj);
send_nntp("Date: %s", rfcdate(Msg.Written + (gmt_offset((time_t)0) * 60))); send_nntp("Date: %s", rfcdate(Msg.Written + (gmt_offset((time_t)0) * 60)));
send_nntp("Message-ID: %s", make_msgid(Msg.Msgid)); send_nntp("Message-ID: %s", make_msgid(Msg.Msgid));
if (strlen(Msg.Replyid)) if (strlen(Msg.Replyid))
@ -213,7 +238,7 @@ void command_abhs(char *buf)
} }
send_nntp("MIME-Version: 1.0"); send_nntp("MIME-Version: 1.0");
send_nntp("Content-Type: text/plain; charset=iso-8859-1; format=fixed"); send_nntp("Content-Type: text/plain; charset=%s; format=fixed", getrfcchrs(usercharset));
send_nntp("Content-Transfer-Encoding: 8bit"); send_nntp("Content-Transfer-Encoding: 8bit");
} }

View File

@ -3,6 +3,8 @@
/* $Id$ */ /* $Id$ */
int usercharset;
void send_nntp(const char *, ...); void send_nntp(const char *, ...);
#ifndef USE_NEWSGATE #ifndef USE_NEWSGATE

View File

@ -450,7 +450,7 @@ int Read_a_Email(unsigned long Num)
if (Kludges) { if (Kludges) {
pout(LIGHTGRAY, BLACK, p); pout(LIGHTGRAY, BLACK, p);
Enter(1); Enter(1);
if (CheckLine(CFG.TextColourF, CFG.TextColourB, TRUE)) if (CheckLine(CFG.TextColourF, CFG.TextColourB, TRUE, FALSE))
break; break;
} }
} else { } else {
@ -460,7 +460,7 @@ int Read_a_Email(unsigned long Num)
colour(CFG.HiliteF, CFG.HiliteB); colour(CFG.HiliteF, CFG.HiliteB);
PUTSTR(p); PUTSTR(p);
Enter(1); Enter(1);
if (CheckLine(CFG.TextColourF, CFG.TextColourB, TRUE)) if (CheckLine(CFG.TextColourF, CFG.TextColourB, TRUE, FALSE))
break; break;
} }
} while ((p = (char *)MsgText_Next()) != NULL); } while ((p = (char *)MsgText_Next()) != NULL);

View File

@ -79,8 +79,7 @@ extern int LC_Wrote; /* Lastcaller info write message */
/* /*
* Internal prototypes * Internal prototypes
*/ */
void ShowMsgHdr(int Conv); /* Show message header */
void ShowMsgHdr(void); /* Show message header */
int Read_a_Msg(unsigned long Num, int);/* Read a message */ int Read_a_Msg(unsigned long Num, int);/* Read a message */
int Export_a_Msg(unsigned long Num);/* Export message to homedir */ int Export_a_Msg(unsigned long Num);/* Export message to homedir */
int ReadPanel(void); /* Read panel bar */ int ReadPanel(void); /* Read panel bar */
@ -892,13 +891,13 @@ int Save_Msg(int IsReply, faddr *Dest)
/* /*
* Show message header screen top for reading messages. * Show message header screen top for reading messages.
*/ */
void ShowMsgHdr() void ShowMsgHdr(int Conv)
{ {
static char Buf1[35], Buf2[35], Buf3[81]; static char Buf1[35], Buf2[35], Buf3[81];
char msg[81]; char msg[81];
struct tm *tm; struct tm *tm;
time_t now; time_t now;
int color; int color, i;
Buf1[0] = '\0'; Buf1[0] = '\0';
Buf2[0] = '\0'; Buf2[0] = '\0';
@ -986,7 +985,18 @@ void ShowMsgHdr()
/* Subject : */ /* Subject : */
pout(YELLOW, BLACK, (char *) Language(210)); pout(YELLOW, BLACK, (char *) Language(210));
pout(GREEN, BLACK, Msg.Subject); colour(GREEN, BLACK);
if (Conv) {
/*
* Try to translate character sets
*/
for (i = 0; i < strlen(Msg.Subject); i++) {
PUTSTR(charset_map_c(Msg.Subject[i], FALSE));
}
} else {
PUTSTR(Msg.Subject);
}
Enter(1); Enter(1);
colour(CFG.HiliteF, CFG.HiliteB); colour(CFG.HiliteF, CFG.HiliteB);
@ -1207,7 +1217,6 @@ int Read_a_Msg(unsigned long Num, int UpdateLR)
sleep(3); sleep(3);
return FALSE; return FALSE;
} }
ShowMsgHdr();
/* /*
* Fill Quote file in case the user wants to reply. Note that line * Fill Quote file in case the user wants to reply. Note that line
@ -1263,6 +1272,10 @@ int Read_a_Msg(unsigned long Num, int UpdateLR)
if (charsin && charsout && strcmp(charsout, charsin)) { if (charsin && charsout && strcmp(charsout, charsin)) {
UseIconv = charset_set_in_out(charsin, charsout); UseIconv = charset_set_in_out(charsin, charsout);
} }
/*
* Show message header with charset mapping if needed.
*/
ShowMsgHdr(UseIconv);
/* /*
* Show message text * Show message text
@ -1275,7 +1288,7 @@ int Read_a_Msg(unsigned long Num, int UpdateLR)
if (Kludges) { if (Kludges) {
pout(LIGHTGRAY, BLACK, p); pout(LIGHTGRAY, BLACK, p);
Enter(1); Enter(1);
if (CheckLine(CFG.TextColourF, CFG.TextColourB, FALSE)) if (CheckLine(CFG.TextColourF, CFG.TextColourB, FALSE, UseIconv))
break; break;
} }
} else { } else {
@ -1296,7 +1309,7 @@ int Read_a_Msg(unsigned long Num, int UpdateLR)
Enter(1); Enter(1);
} }
if (CheckLine(CFG.TextColourF, CFG.TextColourB, FALSE)) if (CheckLine(CFG.TextColourF, CFG.TextColourB, FALSE, UseIconv))
break; break;
} }
} while ((p = (char *)MsgText_Next()) != NULL); } while ((p = (char *)MsgText_Next()) != NULL);
@ -1933,7 +1946,7 @@ void Delete_Msg()
/* /*
* Check linecounter for reading messages. * Check linecounter for reading messages.
*/ */
int CheckLine(int FG, int BG, int Email) int CheckLine(int FG, int BG, int Email, int Conv)
{ {
int x, z; int x, z;
@ -1960,7 +1973,7 @@ int CheckLine(int FG, int BG, int Email)
if (Email) if (Email)
ShowEmailHdr(); ShowEmailHdr();
else else
ShowMsgHdr(); ShowMsgHdr(Conv);
colour(FG, BG); colour(FG, BG);
} }
return FALSE; return FALSE;

View File

@ -9,7 +9,7 @@
int LC(int); /* More prompt for reading messages */ int LC(int); /* More prompt for reading messages */
int Edit_Msg(void); /* Edit a message */ int Edit_Msg(void); /* Edit a message */
int Ext_Edit(void); /* External Message editor */ int Ext_Edit(void); /* External Message editor */
int CheckLine(int, int, int); /* Check linecounter for read */ int CheckLine(int, int, int, int); /* Check linecounter for read */
void SysopComment(char *); /* Comment to Sysop */ void SysopComment(char *); /* Comment to Sysop */
void Post_Msg(void); /* Post a message */ void Post_Msg(void); /* Post a message */
void Read_Msgs(void); /* Read Messages */ void Read_Msgs(void); /* Read Messages */