Commit dcd394f5 authored by rswindell's avatar rswindell
Browse files

Creates a FIDOPID (program identifier) header field when storing messages.

parent 4633008e
......@@ -37,6 +37,26 @@
#include "sbbs.h"
extern const char* beta_version;
static char* program_id()
{
static char str[128];
char compiler[64];
DESCRIBE_COMPILER(compiler);
sprintf(str,"%.10s v%s%c-%s%s%s %s %s\r"
,VERSION_NOTICE,VERSION,REVISION,PLATFORM_DESC
,beta_version
#ifdef _DEBUG
," Debug"
#else
,""
#endif
,__DATE__,compiler);
return(str);
}
/****************************************************************************/
/* Posts a message on subboard number sub, with 'top' as top of message. */
/* Returns 1 if posted, 0 if not. */
......@@ -46,10 +66,11 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
char str[256],touser[256],title[LEN_TITLE+1],buf[SDT_BLOCK_LEN]
,top[256];
char msg_id[256];
char* pid;
ushort xlat,msgattr;
int i,j,x,file,storage;
ulong l,length,offset,crc=0xffffffff;
FILE *instream;
FILE* instream;
smbmsg_t msg,tmpmsg;
if(remsg) {
......@@ -271,6 +292,9 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
msg.idx.time=msg.hdr.when_imported.time;
msg.idx.number=smb.status.last_msg+1; /* this *should* be the new message number */
pid=program_id();
smb_hfield(&msg,FIDOPID,strlen(pid),pid);
/* Generate default (RFC822) message-id (always) */
SAFECOPY(msg_id,get_msgid(&cfg,subnum,&msg));
smb_hfield(&msg,RFC822MSGID,strlen(msg_id),msg_id);
......@@ -375,6 +399,7 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
extern "C" int DLLCALL savemsg(scfg_t* cfg, smb_t* smb, smbmsg_t* msg, char* msgbuf)
{
char pad=0;
char* pid;
char msg_id[256];
ushort xlat;
int i;
......@@ -479,6 +504,9 @@ extern "C" int DLLCALL savemsg(scfg_t* cfg, smb_t* smb, smbmsg_t* msg, char* msg
}
smb_dfield(msg,TEXT_BODY,length);
pid=program_id();
smb_hfield(msg,FIDOPID,strlen(pid),pid);
/* Generate default (RFC822) message-id */
if(smb_get_hfield(msg,RFC822MSGID,NULL)==NULL) {
SAFECOPY(msg_id,get_msgid(cfg,smb->subnum,msg));
......
......@@ -36,6 +36,8 @@
****************************************************************************/
#define SMBUTIL_VER "2.31"
char revision[16];
char compiler[32];
#define NOANALYSIS (1L<<0)
......@@ -321,6 +323,15 @@ void postmsg(char type, char* to, char* to_number, char* to_address,
smb_freemsgdat(&smb,offset,length,1);
exit(1); }
sprintf(str,"SMBUTIL v%s-%s r%s %s %s"
,SMBUTIL_VER
,PLATFORM_DESC
,revision
,__DATE__
,compiler
);
smb_hfield(&msg,FIDOPID,(ushort)strlen(str),str);
i=smb_addmsghdr(&smb,&msg,smb.status.attr&SMB_HYPERALLOC);
if(i) {
......@@ -1259,7 +1270,6 @@ int main(int argc, char **argv)
{
char cmd[128]="",*p,*s;
char path[MAX_PATH+1];
char revision[16];
char* to=NULL;
char* to_number=NULL;
char* to_address=NULL;
......@@ -1274,6 +1284,8 @@ int main(int argc, char **argv)
sscanf("$Revision$" + 11, "%s", revision);
DESCRIBE_COMPILER(compiler);
smb.file[0]=0;
fprintf(stderr,"\nSMBUTIL v%s-%s (rev %s) SMBLIB %s - Synchronet Message Base "\
"Utility\n\n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment