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

Add new @-codes: MSG_TO_FIRST and MSG_FROM_FIRST

The first word of the message recipient or author's name.

For Accession.
parent e35e7886
No related branches found
No related tags found
No related merge requests found
Pipeline #4956 passed
......@@ -1863,6 +1863,14 @@ const char* sbbs_t::atcode(const char* sp, char* str, size_t maxlen, int* pmode,
*pmode |= (current_msg->hdr.auxattr & MSG_HFIELDS_UTF8);
return(current_msg_to);
}
if(!strcmp(sp,"MSG_TO_FIRST") && current_msg_to!=NULL) {
if(pmode != NULL && current_msg != NULL)
*pmode |= (current_msg->hdr.auxattr & MSG_HFIELDS_UTF8);
safe_snprintf(str, maxlen, "%s", current_msg_to);
if((tp = strchr(str, ' ')) != NULL)
*tp = '\0';
return str;
}
if(!strcmp(sp,"MSG_TO_EXT") && current_msg!=NULL) {
if(current_msg->to_ext==NULL)
return(nulstr);
......@@ -1901,6 +1909,15 @@ const char* sbbs_t::atcode(const char* sp, char* str, size_t maxlen, int* pmode,
*pmode |= (current_msg->hdr.auxattr & MSG_HFIELDS_UTF8);
return(current_msg_from);
}
if(!strcmp(sp,"MSG_FROM_FIRST") && current_msg != NULL && current_msg_from != NULL) {
if(current_msg->hdr.attr&MSG_ANONYMOUS && !SYSOP)
safe_snprintf(str, maxlen, "%s", text[Anonymous]);
else
safe_snprintf(str, maxlen, "%s", current_msg_from);
if((tp = strchr(str, ' ')) != NULL)
*tp = '\0';
return str;
}
if(!strcmp(sp,"MSG_FROM_EXT") && current_msg!=NULL) {
if(!(current_msg->hdr.attr&MSG_ANONYMOUS) || SYSOP)
if(current_msg->from_ext!=NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment