Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit bfc4e49f authored by rswindell's avatar rswindell

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
......@@ -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";
......@@ -553,7 +554,15 @@ bool sbbs_t::unpack_rep(char* repfile)
SAFEPRINTF2(str,"posted QWK message on %s %s"
,cfg.grp[cfg.sub[n]->grp]->sname,cfg.sub[n]->lname);
signal_sub_sem(&cfg,n);
logline("P+",str);
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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment