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

Create/use SysopPageNotification text.dat string

to notify sysop (user #1) that they were paged. Previously, this was
a hard-coded string. The new string in text.dat is the same, but adds
2 BELs (CTRL-G chars) and is now customizable.

Created an sbbs_t::notify() method to make this easier to use and that
method supports @-code expansion, so this text.dat string supports @-codes
(which I used).

This addresses the feature request in issue #828 (beep the sysop in the
telegram/short message, when they're paged).
parent f8e11591
No related branches found
No related tags found
No related merge requests found
Pipeline #7280 passed
......@@ -1081,3 +1081,4 @@
"Oct" 894 Oct
"Nov" 895 Nov
"Dec" 896 Dec
"\7@ALIAS@ paged you to chat from node @NODE@\7" 897 SysopPageNotification
......@@ -611,8 +611,7 @@ bool sbbs_t::sysop_page(void)
if(!(sys_status&SS_SYSPAGE)) {
logline("C", "paged sysop for chat");
SAFEPRINTF2(str, "%s paged you to chat from node %u", useron.alias, cfg.node_num);
notify(&cfg, 1, str, NULL);
notify(text[SysopPageNotification]);
ftouch(syspage_semfile);
char topic[128];
SAFEPRINTF(topic, "page/node/%u", cfg.node_num);
......
......@@ -707,3 +707,10 @@ extern "C" int notify(scfg_t* cfg, uint usernumber, const char* subject, const c
,subject);
return putsmsg(cfg, usernumber, smsg);
}
bool sbbs_t::notify(const char* subject, const char* text)
{
char buf[128];
return ::notify(&cfg, /* usernumber: */1, expand_atcodes(subject, buf, sizeof buf), text) == 0;
}
......@@ -885,6 +885,7 @@ public:
/* postmsg.cpp */
bool postmsg(int subnum, int wm_mode = WM_NONE, smb_t* resmb = NULL, smbmsg_t* remsg = NULL);
bool notify(const char* subject, const char* text = NULL);
/* mail.cpp */
int delmail(uint usernumber,int which);
......
......@@ -913,6 +913,7 @@ enum text {
,Oct
,Nov
,Dec
,SysopPageNotification
,TOTAL_TEXT
};
......
......@@ -1456,4 +1456,6 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x4f\x63\x74" // 894 Oct
,"\x4e\x6f\x76" // 895 Nov
,"\x44\x65\x63" // 896 Dec
,"\x07\x40\x41\x4c\x49\x41\x53\x40\x20\x70\x61\x67\x65\x64\x20\x79\x6f\x75\x20\x74\x6f\x20\x63\x68\x61\x74\x20\x66\x72\x6f\x6d\x20"
"\x6e\x6f\x64\x65\x20\x40\x4e\x4f\x44\x45\x40\x07" // 897 SysopPageNotification
};
......@@ -897,4 +897,5 @@ const char* const text_id[]={
,"Oct"
,"Nov"
,"Dec"
,"SysopPageNotification"
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment