Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
dcd394f5
Commit
dcd394f5
authored
22 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Creates a FIDOPID (program identifier) header field when storing messages.
parent
4633008e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/postmsg.cpp
+29
-1
29 additions, 1 deletion
src/sbbs3/postmsg.cpp
src/sbbs3/smbutil.c
+13
-1
13 additions, 1 deletion
src/sbbs3/smbutil.c
with
42 additions
and
2 deletions
src/sbbs3/postmsg.cpp
+
29
−
1
View file @
dcd394f5
...
@@ -37,6 +37,26 @@
...
@@ -37,6 +37,26 @@
#include
"sbbs.h"
#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. */
/* Posts a message on subboard number sub, with 'top' as top of message. */
/* Returns 1 if posted, 0 if not. */
/* Returns 1 if posted, 0 if not. */
...
@@ -46,6 +66,7 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
...
@@ -46,6 +66,7 @@ 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
]
char
str
[
256
],
touser
[
256
],
title
[
LEN_TITLE
+
1
],
buf
[
SDT_BLOCK_LEN
]
,
top
[
256
];
,
top
[
256
];
char
msg_id
[
256
];
char
msg_id
[
256
];
char
*
pid
;
ushort
xlat
,
msgattr
;
ushort
xlat
,
msgattr
;
int
i
,
j
,
x
,
file
,
storage
;
int
i
,
j
,
x
,
file
,
storage
;
ulong
l
,
length
,
offset
,
crc
=
0xffffffff
;
ulong
l
,
length
,
offset
,
crc
=
0xffffffff
;
...
@@ -271,6 +292,9 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
...
@@ -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
.
time
=
msg
.
hdr
.
when_imported
.
time
;
msg
.
idx
.
number
=
smb
.
status
.
last_msg
+
1
;
/* this *should* be the new message number */
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) */
/* Generate default (RFC822) message-id (always) */
SAFECOPY
(
msg_id
,
get_msgid
(
&
cfg
,
subnum
,
&
msg
));
SAFECOPY
(
msg_id
,
get_msgid
(
&
cfg
,
subnum
,
&
msg
));
smb_hfield
(
&
msg
,
RFC822MSGID
,
strlen
(
msg_id
),
msg_id
);
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)
...
@@ -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
)
extern
"C"
int
DLLCALL
savemsg
(
scfg_t
*
cfg
,
smb_t
*
smb
,
smbmsg_t
*
msg
,
char
*
msgbuf
)
{
{
char
pad
=
0
;
char
pad
=
0
;
char
*
pid
;
char
msg_id
[
256
];
char
msg_id
[
256
];
ushort
xlat
;
ushort
xlat
;
int
i
;
int
i
;
...
@@ -479,6 +504,9 @@ extern "C" int DLLCALL savemsg(scfg_t* cfg, smb_t* smb, smbmsg_t* msg, char* msg
...
@@ -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
);
smb_dfield
(
msg
,
TEXT_BODY
,
length
);
pid
=
program_id
();
smb_hfield
(
msg
,
FIDOPID
,
strlen
(
pid
),
pid
);
/* Generate default (RFC822) message-id */
/* Generate default (RFC822) message-id */
if
(
smb_get_hfield
(
msg
,
RFC822MSGID
,
NULL
)
==
NULL
)
{
if
(
smb_get_hfield
(
msg
,
RFC822MSGID
,
NULL
)
==
NULL
)
{
SAFECOPY
(
msg_id
,
get_msgid
(
cfg
,
smb
->
subnum
,
msg
));
SAFECOPY
(
msg_id
,
get_msgid
(
cfg
,
smb
->
subnum
,
msg
));
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/smbutil.c
+
13
−
1
View file @
dcd394f5
...
@@ -36,6 +36,8 @@
...
@@ -36,6 +36,8 @@
****************************************************************************/
****************************************************************************/
#define SMBUTIL_VER "2.31"
#define SMBUTIL_VER "2.31"
char
revision
[
16
];
char
compiler
[
32
];
#define NOANALYSIS (1L<<0)
#define NOANALYSIS (1L<<0)
...
@@ -321,6 +323,15 @@ void postmsg(char type, char* to, char* to_number, char* to_address,
...
@@ -321,6 +323,15 @@ void postmsg(char type, char* to, char* to_number, char* to_address,
smb_freemsgdat
(
&
smb
,
offset
,
length
,
1
);
smb_freemsgdat
(
&
smb
,
offset
,
length
,
1
);
exit
(
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
);
i
=
smb_addmsghdr
(
&
smb
,
&
msg
,
smb
.
status
.
attr
&
SMB_HYPERALLOC
);
if
(
i
)
{
if
(
i
)
{
...
@@ -1259,7 +1270,6 @@ int main(int argc, char **argv)
...
@@ -1259,7 +1270,6 @@ int main(int argc, char **argv)
{
{
char
cmd
[
128
]
=
""
,
*
p
,
*
s
;
char
cmd
[
128
]
=
""
,
*
p
,
*
s
;
char
path
[
MAX_PATH
+
1
];
char
path
[
MAX_PATH
+
1
];
char
revision
[
16
];
char
*
to
=
NULL
;
char
*
to
=
NULL
;
char
*
to_number
=
NULL
;
char
*
to_number
=
NULL
;
char
*
to_address
=
NULL
;
char
*
to_address
=
NULL
;
...
@@ -1274,6 +1284,8 @@ int main(int argc, char **argv)
...
@@ -1274,6 +1284,8 @@ int main(int argc, char **argv)
sscanf
(
"$Revision$"
+
11
,
"%s"
,
revision
);
sscanf
(
"$Revision$"
+
11
,
"%s"
,
revision
);
DESCRIBE_COMPILER
(
compiler
);
smb
.
file
[
0
]
=
0
;
smb
.
file
[
0
]
=
0
;
fprintf
(
stderr
,
"
\n
SMBUTIL v%s-%s (rev %s) SMBLIB %s - Synchronet Message Base "
\
fprintf
(
stderr
,
"
\n
SMBUTIL v%s-%s (rev %s) SMBLIB %s - Synchronet Message Base "
\
"Utility
\n\n
"
"Utility
\n\n
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment