diff --git a/cfgs/config/advanced.rus b/cfgs/config/advanced.rus index a8eface..08fa989 100644 --- a/cfgs/config/advanced.rus +++ b/cfgs/config/advanced.rus @@ -2303,6 +2303,8 @@ EndGroup // Tearline // Template // TwitMode +// TwitName +// TwitSubj // UseFwd // UserName // UseSoftCrxLat diff --git a/docs/notework.txt b/docs/notework.txt index b2a66d3..da2e30a 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,8 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ ++ TwitName and TwitSubj now may be used in random system groups. + + Win32-MSVC version: processor name will be used instead of "x86" in @widepid and @osver macros. diff --git a/golded3/gccfgg8.cpp b/golded3/gccfgg8.cpp index f51a980..755e82d 100644 --- a/golded3/gccfgg8.cpp +++ b/golded3/gccfgg8.cpp @@ -282,14 +282,23 @@ void CfgTwitname() { } } strxcpy(tn.name, val, sizeof(tn.name)); - CFG->twitname.push_back(tn); + + if(cfgingroup) + CFG->grp.AddItm(GRP_TWITNAME, &tn, sizeof(tn)); + else + CFG->twitname.push_back(tn); } // ------------------------------------------------------------------ -void CfgTwitsubj() { +void CfgTwitsubj() +{ + std::string str = StripQuotes(val); - CFG->twitsubj.push_back(StripQuotes(val)); + if(cfgingroup) + CFG->grp.AddItm(GRP_TWITSUBJ, str); + else + CFG->twitsubj.push_back(str); } // ------------------------------------------------------------------ diff --git a/golded3/gerand.cpp b/golded3/gerand.cpp index 5381c3b..58c1210 100644 --- a/golded3/gerand.cpp +++ b/golded3/gerand.cpp @@ -174,6 +174,9 @@ void Area::InitData() { strxcpy(adat->wtpl, CFG->wtpl.c_str(), sizeof(adat->wtpl)); adat->templatematch = CFG->templatematch; adat->twitmode = CFG->twitmode; + adat->inittwit = true; + adat->twitname = CFG->twitname; + adat->twitsubj = CFG->twitsubj; adat->usearea = CFG->usearea; adat->usefwd = CFG->usefwd; strcpy(adat->username.name, CFG->username.empty() ? "" : CFG->username[CFG->usernameno].name); @@ -360,6 +363,29 @@ void Area::RandomizeData(int mode) { CFG->grp.GetItm(GRP_TEMPLATEMATCH, adat->templatematch); CFG->grp.GetItm(GRP_TWITMODE, adat->twitmode); + + if (adat->inittwit) + { + Node node; + std::string subj; + + int i, nr = CFG->grp.GetItm(GRP_TWITNAME, &node, sizeof(node)); + for (i = 0; i < nr; i++) + { + CFG->grp.GetItm(GRP_TWITNAME, &node, sizeof(node), i); + adat->twitname.push_back(node); + } + + nr = CFG->grp.GetItm(GRP_TWITSUBJ, subj); + for (i = 0; i < nr; i++) + { + CFG->grp.GetItm(GRP_TWITSUBJ, subj, i); + adat->twitsubj.push_back(subj); + } + + adat->inittwit = false; + } + CFG->grp.GetItm(GRP_USEAREA, adat->usearea); CFG->grp.GetItm(GRP_USEFWD, adat->usefwd); diff --git a/golded3/geread.cpp b/golded3/geread.cpp index e7a75b3..094a6f0 100644 --- a/golded3/geread.cpp +++ b/golded3/geread.cpp @@ -1055,7 +1055,8 @@ int MsgIsTwit(GMsg* msg, bool& istwitto, bool& istwitsubj) { // Check for twit names std::vector::iterator tn; - for(tn = CFG->twitname.begin(); tn != CFG->twitname.end(); tn++) { + for(tn = AA->adat->twitname.begin(); tn != AA->adat->twitname.end(); tn++) + { if(msg->orig.match(tn->addr)) { if(*tn->name == NUL or strwild(msg->By(), tn->name)) { istwit = true; @@ -1076,7 +1077,8 @@ int MsgIsTwit(GMsg* msg, bool& istwitto, bool& istwitsubj) { // Check for twit subjects if(not istwit) { gstrarray::iterator n; - for(n = CFG->twitsubj.begin(); n != CFG->twitsubj.end(); n++) { + for(n = AA->adat->twitsubj.begin(); n != AA->adat->twitsubj.end(); n++) + { if(striinc(n->c_str(), msg->re)) { istwitsubj = true; istwit = true; diff --git a/golded3/gmarea.h b/golded3/gmarea.h index 17cb857..5d7f721 100644 --- a/golded3/gmarea.h +++ b/golded3/gmarea.h @@ -323,6 +323,9 @@ struct AreaData { Path outputfile; INam searchfor; int twitmode; + bool inittwit; + std::vector twitname; + gstrarray twitsubj; bool viewhidden; bool viewkludge; bool viewquote; diff --git a/goldlib/gall/gutlgrp.h b/goldlib/gall/gutlgrp.h index b09cfeb..661c97a 100644 --- a/goldlib/gall/gutlgrp.h +++ b/goldlib/gall/gutlgrp.h @@ -96,6 +96,8 @@ enum { GRP_TEMPLATE, GRP_TEMPLATEMATCH, GRP_TWITMODE, + GRP_TWITNAME, + GRP_TWITSUBJ, GRP_USEAREA, GRP_USEFWD, GRP_USERNAME,