Skip to content
Snippets Groups Projects
Commit bfc4e49f authored by rswindell's avatar rswindell
Browse files

Using the new lookup_user() function and the new text.dat string

(MsgPostedToYouVia) to send telegrams to local users when messages posted
"to them" are imported via QWK.
parent 27e3a9a5
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
str_list_t host_can=NULL;
str_list_t subject_can=NULL;
str_list_t twit_list=NULL;
link_list_t user_list={0};
const char* hostname;
memset(&msg,0,sizeof(msg));
......@@ -360,6 +361,14 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
signal_sub_sem(&cfg,j);
msgs++;
tmsgs++;
int destuser = lookup_user(&cfg, &user_list, msg.to);
if(destuser > 0) {
SAFEPRINTF4(str, text[MsgPostedToYouVia]
,msg.from
,cfg.grp[cfg.sub[n]->grp]->sname, cfg.sub[n]->lname
,cfg.qhub[hubnum]->id);
putsmsg(&cfg, destuser, str);
}
} else {
if(dupe)
dupes++;
......@@ -386,6 +395,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
strListFree(&host_can);
strListFree(&subject_can);
strListFree(&twit_list);
listFree(&user_list);
delfiles(cfg.temp_dir,"*.NDX");
SAFEPRINTF(str,"%sMESSAGES.DAT",cfg.temp_dir);
......
......@@ -69,6 +69,7 @@ bool sbbs_t::unpack_rep(char* repfile)
str_list_t host_can=NULL;
str_list_t subject_can=NULL;
str_list_t twit_list=NULL;
link_list_t user_list={0};
const char* hostname;
const char* AttemptedToUploadREPpacket="Attempted to upload REP packet";
......@@ -554,6 +555,14 @@ bool sbbs_t::unpack_rep(char* repfile)
,cfg.grp[cfg.sub[n]->grp]->sname,cfg.sub[n]->lname);
signal_sub_sem(&cfg,n);
logline("P+",str);
int destuser = lookup_user(&cfg, &user_list, msg.to);
if(destuser > 0) {
SAFEPRINTF4(str, text[MsgPostedToYouVia]
,msg.from
,cfg.grp[cfg.sub[n]->grp]->sname, cfg.sub[n]->lname
,(useron.rest&FLAG('Q')) ? useron.alias : "QWK");
putsmsg(&cfg, destuser, str);
}
if(!(useron.rest&FLAG('Q')))
user_event(EVENT_POST);
tmsgs++;
......@@ -579,6 +588,7 @@ bool sbbs_t::unpack_rep(char* repfile)
strListFree(&host_can);
strListFree(&subject_can);
strListFree(&twit_list);
listFree(&user_list);
if(lastsub!=INVALID_SUB)
smb_close(&smb);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment