Skip to content

Commit 0c71ac2

Browse files
committed
移除了讨论组列表
实践中讨论组列表并不能发挥什么作用,于是取消该设定
1 parent b60910a commit 0c71ac2

File tree

4 files changed

+16
-37
lines changed

4 files changed

+16
-37
lines changed

Dice/Dice.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,6 @@ void dataBackUp() {
168168
ofstreamBlackQQ << it << std::endl;
169169
}
170170
ofstreamBlackQQ.close();
171-
//备份讨论组列表
172-
ofstream ofstreamDiscussList(strFileLoc + "DiscussList.map", ios::out | ios::trunc);
173-
for (auto it : DiscussList)
174-
{
175-
ofstreamDiscussList << it.first << "\n" << it.second << std::endl;
176-
}
177-
ofstreamDiscussList.close();
178171
//备份聊天列表
179172
ofstream ofstreamLastMsgList(strFileLoc + "LastMsgList.MYmap", ios::out | ios::trunc);
180173
for (auto it : mLastMsgList)
@@ -500,18 +493,6 @@ EVE_Enable(eventEnable)
500493
}
501494
}
502495
ifstreamBlackQQ.close();
503-
//读取讨论组列表
504-
ifstream ifstreamDiscussList(strFileLoc + "DiscussList.map");
505-
if (ifstreamDiscussList)
506-
{
507-
long long llDiscuss;
508-
time_t tNow;
509-
while (ifstreamDiscussList >> llDiscuss >> tNow)
510-
{
511-
DiscussList[llDiscuss]=tNow;
512-
}
513-
}
514-
ifstreamDiscussList.close();
515496
//读取聊天列表
516497
ifstream ifstreamLastMsgList(strFileLoc + "LastMsgList.MYmap");
517498
if (ifstreamLastMsgList)

Dice/DiceConsole.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ std::map<std::string, bool>boolConsole = { {"DisabledGlobal",false},
4545
{"KickedBanInviter",true} };
4646
//骰娘列表
4747
std::map<long long, long long> mDiceList;
48-
//讨论组消息记录
49-
std::map<long long, time_t> DiscussList;
5048
//群邀请者
5149
std::map<long long, long long> mGroupInviter;
5250
//个性化语句
@@ -302,6 +300,22 @@ void warningHandler() {
302300
int intDayLim = stoi(strPara);
303301
string strDayLim = to_string(intDayLim);
304302
time_t tNow = time(NULL);;
303+
for (auto eachChat : mLastMsgList) {
304+
if (eachChat.first.second == Private)continue;
305+
int intDay = (int)(tNow - eachChat.second) / 86400;
306+
if (intDay > intDayLim) {
307+
strReply += printChat(eachChat.first) + ":" + to_string(intDay) + "\n";
308+
AddMsgToQueue(format(GlobalMsg["strOverdue"], { GlobalMsg["strSelfName"], to_string(intDay) }), eachChat.first.first, eachChat.first.second);
309+
Sleep(100);
310+
if (eachChat.first.second == Group) {
311+
setGroupLeave(eachChat.first.first);
312+
if (GroupList.count(eachChat.first.first))GroupList.erase(eachChat.first.first);
313+
}
314+
else setDiscussLeave(eachChat.first.first);
315+
mLastMsgList.erase(eachChat.first);
316+
intCnt++;
317+
}
318+
}
305319
for (auto eachGroup : GroupList) {
306320
int intDay = (int)(tNow - getGroupMemberInfo(eachGroup.first, getLoginQQ()).LastMsgTime)/86400;
307321
if (intDay > intDayLim) {
@@ -313,18 +327,6 @@ void warningHandler() {
313327
intCnt++;
314328
}
315329
}
316-
for (auto eachDiscuss : DiscussList) {
317-
int intDay = (int)(tNow - eachDiscuss.second) / 86400;
318-
if (intDay > intDayLim){
319-
strReply += printChat({ eachDiscuss.first,Discuss }) + ":" + to_string(intDay) + "\n";
320-
AddMsgToQueue(format(GlobalMsg["strOverdue"], { GlobalMsg["strSelfName"], to_string(intDay) }), eachDiscuss.first, Group);
321-
Sleep(10);
322-
setDiscussLeave(eachDiscuss.first);
323-
DiscussList.erase(eachDiscuss.first);
324-
mLastMsgList.erase({ eachDiscuss.first ,Discuss });
325-
intCnt++;
326-
}
327-
}
328330
strReply += GlobalMsg["strSelfName"] + "已筛除潜水" + strDayLim + "天群聊" + to_string(intCnt) + "个√";
329331
AddMsgToQueue(strReply,masterQQ);
330332
}

Dice/DiceConsole.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
extern std::map<std::string, bool>boolConsole;
2626
//骰娘列表
2727
extern std::map<long long, long long> mDiceList;
28-
//讨论组消息记录
29-
extern std::map<long long, time_t> DiscussList;
3028
//个性化语句
3129
extern std::map<std::string, std::string> PersonalMsg;
3230
//botoff的群

Dice/DiceEvent.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ class FromMsg {
123123
+ "全局.me开关:" + (boolConsole["DisabledMe"] ? "禁用" : "启用") + "\n"
124124
+ "全局.jrrp开关:" + (boolConsole["DisabledJrrp"] ? "禁用" : "启用");
125125
if (isAdmin) strReply += "\n所在群聊数:" + to_string(getGroupList().size()) + "\n"
126-
+ (DiscussList.size() ? "有记录的讨论组数:" + to_string(DiscussList.size()) + "\n" : "")
127126
+ "黑名单用户数:" + to_string(BlackQQ.size()) + "\n"
128127
+ "黑名单群数:" + to_string(BlackGroup.size()) + "\n"
129128
+ "白名单用户数:" + to_string(WhiteQQ.size()) + "\n"
@@ -351,7 +350,6 @@ class FromMsg {
351350
else if (llTargetID > 1000000000 && setDiscussLeave(llTargetID) == 0) {
352351
mLastMsgList.erase({ llTargetID ,Discuss });
353352
AdminNotify("已令" + GlobalMsg["strSelfName"] + "退出讨论组" + to_string(llTargetID) + "");
354-
DiscussList.erase(llTargetID);
355353
}
356354
else {
357355
reply(GlobalMsg["strGroupGetErr"]);

0 commit comments

Comments
 (0)