Skip to content
Snippets Groups Projects
Commit f257f2ff authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add/use new FTN "BBSID" control paragraph (kludge line)

Advertise the system's QWK-ID (a.k.a. BBS ID) in exported echomail messages. This will allow correlation of avatars that were imported via SYNCDATA carried via QWKnet (e.g. DOVE-Net) with messages imported from those same BBSes via FTN.

The alternative was to have SYNCDATA Avatar messages include all the AKAs of each BBS (in the body text), but that was looking like a rather complicated solution. This approach (the BBSID kludge) seems a much simpler solution.

I still need to implement the JS side of this solution however (for avatar lookups using the FTN BBSID), but this was the first important step.
parent 562cb81a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1066 passed
/* Synchronet JavaScript "MsgBase" Object */ /* Synchronet JavaScript "MsgBase" Object */
/* $Id: js_msgbase.c,v 1.262 2020/05/07 21:58:37 rswindell Exp $ */
// vi: tabstop=4
/**************************************************************************** /****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
...@@ -16,21 +13,9 @@ ...@@ -16,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or * * See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html * * http://www.fsf.org/copyleft/gpl.html *
* * * *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see * * For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html * * http://www.synchro.net/source.html *
* * * *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. * * Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/ ****************************************************************************/
...@@ -795,6 +780,19 @@ static BOOL parse_header_object(JSContext* cx, private_t* p, JSObject* hdr, smbm ...@@ -795,6 +780,19 @@ static BOOL parse_header_object(JSContext* cx, private_t* p, JSObject* hdr, smbm
} }
} }
if(JS_GetProperty(cx, hdr, "ftn_bbsid", &val) && !JSVAL_NULL_OR_VOID(val)) {
JSVALUE_TO_RASTRING(cx, val, cp, &cp_sz, NULL);
HANDLE_PENDING(cx, cp);
if(cp==NULL) {
JS_ReportError(cx, "Invalid \"ftn_bbsid\" string in header object");
goto err;
}
if((smb_result = smb_hfield_str(msg, FIDOBBSID, cp))!=SMB_SUCCESS) {
JS_ReportError(cx, "Error %d adding FIDOBBSID field to message header", smb_result);
goto err;
}
}
if(JS_GetProperty(cx, hdr, "date", &val) && !JSVAL_NULL_OR_VOID(val)) { if(JS_GetProperty(cx, hdr, "date", &val) && !JSVAL_NULL_OR_VOID(val)) {
JSVALUE_TO_RASTRING(cx, val, cp, &cp_sz, NULL); JSVALUE_TO_RASTRING(cx, val, cp, &cp_sz, NULL);
HANDLE_PENDING(cx, cp); HANDLE_PENDING(cx, cp);
...@@ -1522,6 +1520,7 @@ static JSBool js_get_msg_header_resolve(JSContext *cx, JSObject *obj, jsid id) ...@@ -1522,6 +1520,7 @@ static JSBool js_get_msg_header_resolve(JSContext *cx, JSObject *obj, jsid id)
LAZY_STRING_TRUNCSP_NULL("ftn_area", p->msg.ftn_area, JSPROP_ENUMERATE); LAZY_STRING_TRUNCSP_NULL("ftn_area", p->msg.ftn_area, JSPROP_ENUMERATE);
LAZY_STRING_TRUNCSP_NULL("ftn_flags", p->msg.ftn_flags, JSPROP_ENUMERATE); LAZY_STRING_TRUNCSP_NULL("ftn_flags", p->msg.ftn_flags, JSPROP_ENUMERATE);
LAZY_STRING_TRUNCSP_NULL("ftn_charset", p->msg.ftn_charset, JSPROP_ENUMERATE); LAZY_STRING_TRUNCSP_NULL("ftn_charset", p->msg.ftn_charset, JSPROP_ENUMERATE);
LAZY_STRING_TRUNCSP_NULL("ftn_bbsid", p->msg.ftn_bbsid, JSPROP_ENUMERATE);
if(name==NULL || strcmp(name,"field_list")==0) { if(name==NULL || strcmp(name,"field_list")==0) {
if(name) free(name); if(name) free(name);
......
...@@ -1232,6 +1232,8 @@ int create_netmail(const char *to, const smbmsg_t* msg, const char *subject, con ...@@ -1232,6 +1232,8 @@ int create_netmail(const char *to, const smbmsg_t* msg, const char *subject, con
fprintf(fp, "\1MSGID: %.256s\r", msg->ftn_msgid); fprintf(fp, "\1MSGID: %.256s\r", msg->ftn_msgid);
if(msg->ftn_reply != NULL) if(msg->ftn_reply != NULL)
fprintf(fp, "\1REPLY: %.256s\r", msg->ftn_reply); fprintf(fp, "\1REPLY: %.256s\r", msg->ftn_reply);
if(msg->ftn_bbsid != NULL)
fprintf(fp, "\1BBSID: %.256s\r", msg->ftn_bbsid);
if(msg->ftn_flags != NULL) if(msg->ftn_flags != NULL)
fprintf(fp, "\1FLAGS %s\r", msg->ftn_flags); fprintf(fp, "\1FLAGS %s\r", msg->ftn_flags);
else if(msg->hdr.auxattr&MSG_KILLFILE) else if(msg->hdr.auxattr&MSG_KILLFILE)
...@@ -3493,6 +3495,15 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint usernumber, uint subnum) ...@@ -3493,6 +3495,15 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint usernumber, uint subnum)
smb_hfield_bin(&msg, SMB_COLUMNS, columns); smb_hfield_bin(&msg, SMB_COLUMNS, columns);
} }
else if(!strncmp(fbuf+l+1,"BBSID:",6)) {
l+=7;
while(l<length && fbuf[l]<=' ' && fbuf[l]>=0) l++;
m=l;
while(m<length && fbuf[m]!='\r') m++;
if(m>l)
smb_hfield(&msg,FIDOBBSID,(ushort)(m-l),fbuf+l);
}
else { /* Unknown kludge line */ else { /* Unknown kludge line */
while(l<length && fbuf[l]<=' ' && fbuf[l]>=0) l++; while(l<length && fbuf[l]<=' ' && fbuf[l]>=0) l++;
m=l; m=l;
...@@ -4912,6 +4923,11 @@ void export_echomail(const char* sub_code, const nodecfg_t* nodecfg, bool rescan ...@@ -4912,6 +4923,11 @@ void export_echomail(const char* sub_code, const nodecfg_t* nodecfg, bool rescan
if(msg.columns) if(msg.columns)
f += sprintf(fmsgbuf+f, "\1COLS: %u\r", (unsigned int)msg.columns); f += sprintf(fmsgbuf+f, "\1COLS: %u\r", (unsigned int)msg.columns);
if(msg.ftn_bbsid != NULL) /* use original BBSID */
f += sprintf(fmsgbuf + f, "\1BBSID: %.256s\r", msg.ftn_bbsid);
else if(msg.from_net.type != NET_FIDO)
f += sprintf(fmsgbuf + f, "\1BBSID: %.256s\r", scfg.sys_id);
if(rescan) if(rescan)
f+=sprintf(fmsgbuf+f,"\1RESCANNED %s\r", smb_faddrtoa(&scfg.sub[subnum]->faddr,NULL)); f+=sprintf(fmsgbuf+f,"\1RESCANNED %s\r", smb_faddrtoa(&scfg.sub[subnum]->faddr,NULL));
......
/* Synchronet message base constant and structure definitions */ /* Synchronet message base constant and structure definitions */
/* $Id: smbdefs.h,v 1.119 2019/07/30 10:20:20 rswindell Exp $ */
// vi: tabstop=4
/**************************************************************************** /****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright Rob Swindell - http://www.synchro.net/copyright.html * * Copyright Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This program is free software; you can redistribute it and/or * * This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License * * modify it under the terms of the GNU Lesser General Public License *
* as published by the Free Software Foundation; either version 2 * * as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. * * of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or * * See the GNU Lesser General Public License for more details: lgpl.txt or *
* http://www.fsf.org/copyleft/gpl.html * * http://www.fsf.org/copyleft/lesser.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* * * *
* For Synchronet coding style and modification guidelines, see * * For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html * * http://www.synchro.net/source.html *
* * * *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. * * Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/ ****************************************************************************/
...@@ -224,6 +209,7 @@ ...@@ -224,6 +209,7 @@
#define FIDOFLAGS 0xa7 #define FIDOFLAGS 0xa7
#define FIDOTID 0xa8 #define FIDOTID 0xa8
#define FIDOCHARSET 0xa9 // CHRS or CHARSET control line #define FIDOCHARSET 0xa9 // CHRS or CHARSET control line
#define FIDOBBSID 0xaa
// RFC822* header field values are strings of US-ASCII chars, but potentially MIME-encoded (RFC2047) // RFC822* header field values are strings of US-ASCII chars, but potentially MIME-encoded (RFC2047)
// (i.e. base64 or Q-encoded UTF-8, ISO-8859-1, etc.) // (i.e. base64 or Q-encoded UTF-8, ISO-8859-1, etc.)
...@@ -563,6 +549,7 @@ typedef struct { /* Message */ ...@@ -563,6 +549,7 @@ typedef struct { /* Message */
*ftn_area, /* FTN AREA */ *ftn_area, /* FTN AREA */
*ftn_flags, /* FTN FLAGS */ *ftn_flags, /* FTN FLAGS */
*ftn_charset, /* FTN CHRS */ *ftn_charset, /* FTN CHRS */
*ftn_bbsid, /* FTN BBSID */
*ftn_msgid, /* FTN MSGID */ *ftn_msgid, /* FTN MSGID */
*ftn_reply; /* FTN REPLY */ *ftn_reply; /* FTN REPLY */
char* summary; /* Summary */ char* summary; /* Summary */
......
...@@ -840,6 +840,9 @@ static void set_convenience_ptr(smbmsg_t* msg, uint16_t hfield_type, void* hfiel ...@@ -840,6 +840,9 @@ static void set_convenience_ptr(smbmsg_t* msg, uint16_t hfield_type, void* hfiel
case FIDOCHARSET: case FIDOCHARSET:
msg->ftn_charset=(char*)hfield_dat; msg->ftn_charset=(char*)hfield_dat;
break; break;
case FIDOBBSID:
msg->ftn_bbsid=(char*)hfield_dat;
break;
case RFC822HEADER: case RFC822HEADER:
{ {
char* p = (char*)hfield_dat; char* p = (char*)hfield_dat;
......
...@@ -81,6 +81,7 @@ char* SMBCALL smb_hfieldtype(uint16_t type) ...@@ -81,6 +81,7 @@ char* SMBCALL smb_hfieldtype(uint16_t type)
case FIDOFLAGS: return("X-FTN-Flags"); case FIDOFLAGS: return("X-FTN-Flags");
case FIDOTID: return("X-FTN-TID"); case FIDOTID: return("X-FTN-TID");
case FIDOCHARSET: return("X-FTN-CHRS"); case FIDOCHARSET: return("X-FTN-CHRS");
case FIDOBBSID: return("X-FTN-BBSID");
case RFC822HEADER: return("OtherHeader"); case RFC822HEADER: return("OtherHeader");
case RFC822MSGID: return("Message-ID"); /* RFC-compliant */ case RFC822MSGID: return("Message-ID"); /* RFC-compliant */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment