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

Add an 'enabled' property for QWKnet hubs, defaults to true, part 2

Missing part of yesterday's commit, whoops
parent 989644c4
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3826 passed
......@@ -2889,6 +2889,8 @@ void event_thread(void* arg)
/* QWK Networking Call-out semaphores */
for(i=0;i<sbbs->cfg.total_qhubs;i++) {
if(!sbbs->cfg.qhub[i]->enabled)
continue;
if(sbbs->cfg.qhub[i]->node != NODE_ANY
&& (sbbs->cfg.qhub[i]->node<first_node || sbbs->cfg.qhub[i]->node>last_node))
continue;
......@@ -2924,6 +2926,8 @@ void event_thread(void* arg)
/* QWK Networking Call-out Events */
sbbs->event_code = "QNET";
for(i=0;i<sbbs->cfg.total_qhubs && !sbbs->terminated;i++) {
if(!sbbs->cfg.qhub[i]->enabled)
continue;
if(sbbs->cfg.qhub[i]->node != NODE_ANY
&& (sbbs->cfg.qhub[i]->node<first_node || sbbs->cfg.qhub[i]->node>last_node))
continue;
......
......@@ -334,6 +334,7 @@ typedef struct { /* QWK Network Hub */
sub_t** sub;
time32_t last; /* Last network attempt */
uint32_t misc; /* QHUB_* flags */
BOOL enabled;
} qhub_t;
......
......@@ -511,6 +511,7 @@ BOOL read_msgs_cfg(scfg_t* cfg, char* error, size_t maxerrlen)
memset(cfg->qhub[i],0,sizeof(qhub_t));
SAFECOPY(cfg->qhub[i]->id, name + 5);
cfg->qhub[i]->enabled = iniGetBool(section, NULL, "enabled", TRUE);
cfg->qhub[i]->time = iniGetShortInt(section, NULL, "time", 0);
cfg->qhub[i]->freq = iniGetShortInt(section, NULL, "freq", 0);
cfg->qhub[i]->days = (char)iniGetShortInt(section, NULL, "days", 0);
......
......@@ -493,6 +493,7 @@ BOOL write_msgs_cfg(scfg_t* cfg, int backup_level)
for(uint i=0; i<cfg->total_qhubs; i++) {
SAFEPRINTF(name, "qhub:%s", cfg->qhub[i]->id);
str_list_t section = strListInit();
iniSetBool(&section, name, "enabled", cfg->qhub[i]->enabled, NULL);
iniSetShortInt(&section, name, "time", cfg->qhub[i]->time, NULL);
iniSetShortInt(&section, name, "freq", cfg->qhub[i]->freq, NULL);
iniSetShortInt(&section, name, "days", cfg->qhub[i]->days, NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment