Skip to content

Commit

Permalink
移除了讨论组列表
Browse files Browse the repository at this point in the history
实践中讨论组列表并不能发挥什么作用,于是取消该设定
  • Loading branch information
mystringEmpty committed Jul 24, 2019
1 parent b60910a commit 0c71ac2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 37 deletions.
19 changes: 0 additions & 19 deletions Dice/Dice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ void dataBackUp() {
ofstreamBlackQQ << it << std::endl;
}
ofstreamBlackQQ.close();
//备份讨论组列表
ofstream ofstreamDiscussList(strFileLoc + "DiscussList.map", ios::out | ios::trunc);
for (auto it : DiscussList)
{
ofstreamDiscussList << it.first << "\n" << it.second << std::endl;
}
ofstreamDiscussList.close();
//备份聊天列表
ofstream ofstreamLastMsgList(strFileLoc + "LastMsgList.MYmap", ios::out | ios::trunc);
for (auto it : mLastMsgList)
Expand Down Expand Up @@ -500,18 +493,6 @@ EVE_Enable(eventEnable)
}
}
ifstreamBlackQQ.close();
//读取讨论组列表
ifstream ifstreamDiscussList(strFileLoc + "DiscussList.map");
if (ifstreamDiscussList)
{
long long llDiscuss;
time_t tNow;
while (ifstreamDiscussList >> llDiscuss >> tNow)
{
DiscussList[llDiscuss]=tNow;
}
}
ifstreamDiscussList.close();
//读取聊天列表
ifstream ifstreamLastMsgList(strFileLoc + "LastMsgList.MYmap");
if (ifstreamLastMsgList)
Expand Down
30 changes: 16 additions & 14 deletions Dice/DiceConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ std::map<std::string, bool>boolConsole = { {"DisabledGlobal",false},
{"KickedBanInviter",true} };
//骰娘列表
std::map<long long, long long> mDiceList;
//讨论组消息记录
std::map<long long, time_t> DiscussList;
//群邀请者
std::map<long long, long long> mGroupInviter;
//个性化语句
Expand Down Expand Up @@ -302,6 +300,22 @@ void warningHandler() {
int intDayLim = stoi(strPara);
string strDayLim = to_string(intDayLim);
time_t tNow = time(NULL);;
for (auto eachChat : mLastMsgList) {
if (eachChat.first.second == Private)continue;
int intDay = (int)(tNow - eachChat.second) / 86400;
if (intDay > intDayLim) {
strReply += printChat(eachChat.first) + ":" + to_string(intDay) + "\n";
AddMsgToQueue(format(GlobalMsg["strOverdue"], { GlobalMsg["strSelfName"], to_string(intDay) }), eachChat.first.first, eachChat.first.second);
Sleep(100);
if (eachChat.first.second == Group) {
setGroupLeave(eachChat.first.first);
if (GroupList.count(eachChat.first.first))GroupList.erase(eachChat.first.first);
}
else setDiscussLeave(eachChat.first.first);
mLastMsgList.erase(eachChat.first);
intCnt++;
}
}
for (auto eachGroup : GroupList) {
int intDay = (int)(tNow - getGroupMemberInfo(eachGroup.first, getLoginQQ()).LastMsgTime)/86400;
if (intDay > intDayLim) {
Expand All @@ -313,18 +327,6 @@ void warningHandler() {
intCnt++;
}
}
for (auto eachDiscuss : DiscussList) {
int intDay = (int)(tNow - eachDiscuss.second) / 86400;
if (intDay > intDayLim){
strReply += printChat({ eachDiscuss.first,Discuss }) + ":" + to_string(intDay) + "\n";
AddMsgToQueue(format(GlobalMsg["strOverdue"], { GlobalMsg["strSelfName"], to_string(intDay) }), eachDiscuss.first, Group);
Sleep(10);
setDiscussLeave(eachDiscuss.first);
DiscussList.erase(eachDiscuss.first);
mLastMsgList.erase({ eachDiscuss.first ,Discuss });
intCnt++;
}
}
strReply += GlobalMsg["strSelfName"] + "已筛除潜水" + strDayLim + "天群聊" + to_string(intCnt) + "个√";
AddMsgToQueue(strReply,masterQQ);
}
Expand Down
2 changes: 0 additions & 2 deletions Dice/DiceConsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
extern std::map<std::string, bool>boolConsole;
//骰娘列表
extern std::map<long long, long long> mDiceList;
//讨论组消息记录
extern std::map<long long, time_t> DiscussList;
//个性化语句
extern std::map<std::string, std::string> PersonalMsg;
//botoff的群
Expand Down
2 changes: 0 additions & 2 deletions Dice/DiceEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ class FromMsg {
+ "全局.me开关:" + (boolConsole["DisabledMe"] ? "禁用" : "启用") + "\n"
+ "全局.jrrp开关:" + (boolConsole["DisabledJrrp"] ? "禁用" : "启用");
if (isAdmin) strReply += "\n所在群聊数:" + to_string(getGroupList().size()) + "\n"
+ (DiscussList.size() ? "有记录的讨论组数:" + to_string(DiscussList.size()) + "\n" : "")
+ "黑名单用户数:" + to_string(BlackQQ.size()) + "\n"
+ "黑名单群数:" + to_string(BlackGroup.size()) + "\n"
+ "白名单用户数:" + to_string(WhiteQQ.size()) + "\n"
Expand Down Expand Up @@ -351,7 +350,6 @@ class FromMsg {
else if (llTargetID > 1000000000 && setDiscussLeave(llTargetID) == 0) {
mLastMsgList.erase({ llTargetID ,Discuss });
AdminNotify("已令" + GlobalMsg["strSelfName"] + "退出讨论组" + to_string(llTargetID) + "");
DiscussList.erase(llTargetID);
}
else {
reply(GlobalMsg["strGroupGetErr"]);
Expand Down

0 comments on commit 0c71ac2

Please sign in to comment.