theClient->getRealNickUserHost().c_str(),
targetUser->getUserName().c_str(), flag);
+bot->logLastComMessage(theClient, Message);
+
} //ADDFLAGCommand::Exec
} //Namespace cf
} //Namespace gnuworld
theClient->getRealNickUserHost().c_str(),
targetUser->getUserName().c_str(), st[2].c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
theClient->getRealNickUserHost().c_str(),
theChan->getChannel().c_str(), st.assemble(2).c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
} // namespace cf
st[1].c_str());
}
+bot->logLastComMessage(theClient, Message);
+
return;
} //ADDUSERCommand::Exec
} //namespace cf
theClient->getRealNickUserHost().c_str(),
theChan->getChannel().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
} // namespace cf
theChan->getChannel().c_str(),
extraLog.c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
} // namespace cf
netChan->getName().c_str(),
(override) ? " [override]" : "");
+bot->logLastComMessage(theClient, Message);
+
return;
}
theClient->getRealNickUserHost().c_str(),
netChan->getName().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
}
}
+bot->logLastComMessage(theClient, Message);
+
}
} // namespace cf
theClient->getRealNickUserHost().c_str(),
targetUser->getUserName().c_str(), flag);
+bot->logLastComMessage(theClient, Message);
+
} //DELFLAGCommand::Exec
} //Namespace cf
theClient->getRealNickUserHost().c_str(),
targetUser->getUserName().c_str(), st[2].c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
theClient->getRealNickUserHost().c_str(),
theChan->getChannel().c_str(), messageId);
+bot->logLastComMessage(theClient, Message);
+
return;
}
std::string("Error deleting user %s.")).c_str(), st[1].c_str());
}
+bot->logLastComMessage(theClient, Message);
+
return;
} //DELUSERCommand::Exec
theClient->getRealNickUserHost().c_str(),
theChan->getChannel().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
theClient->getRealNickUserHost().c_str(),
theChan->getChannel().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
theClient->getRealNickUserHost().c_str(),
theChannel->getName().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
/* Dispose of our connection instance */
bot->theManager->removeConnection(cacheCon);
+bot->logLastComMessage(theClient, Message);
+
return;
}
{
namespace cf
{
-void LISTBLOCKEDCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string&)
+void LISTBLOCKEDCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
{
/* Check if channel blocking has been disabled in the config. */
theUser->getUserName().c_str(),
theClient->getRealNickUserHost().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
} // namespace cf
theClient->getRealNickUserHost().c_str(),
targetUser->getUserName().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
} //LISTHOSTSCommand::Exec
st[1].c_str(),
(st.size() > 2) ? st.assemble(2).c_str() : "");
+bot->logLastComMessage(theClient, Message);
+
return;
}
theClient->getRealNickUserHost().c_str(),
netChan->getName().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
theClient->getRealNickUserHost().c_str(),
st.assemble(1).c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
theClient->getRealNickUserHost().c_str(),
!option.empty() ? option.c_str() : "");
+bot->logLastComMessage(theClient, Message);
return;
}
server->LoadClient("libchanfix", bot->getConfigFileName());
+bot->logLastComMessage(theClient, Message);
+
return;
}
theUser ? theUser->getUserName().c_str() : theClient->getUserName().c_str(),
theClient->getRealNickUserHost().c_str(), netChan->getName().c_str(),
(alert) ? " [alert]" : "");
+
+bot->logLastComMessage(theClient, Message);
+
return;
}
bot->SendTo(theClient, strScoresNOP.str());
}
+bot->logLastComMessage(theClient, Message);
return;
}
language::setting_doesnt_exist,
std::string("This setting does not exist.")).c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
targetUser->getUserName().c_str(),
group.c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
} //SETGROUPCommand::Exec
} //namespace cf
else
server->Shutdown( st.assemble(1) );
+bot->logLastComMessage(theClient, Message);
+
return;
}
namespace cf
{
-void STATUSCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string&)
+void STATUSCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
{
bot->SendTo(theClient, "[evilnet development's GNUWorld %s]",
theUser ? theUser->getUserName().c_str() : "!NOT-LOGGED-IN!",
theClient->getRealNickUserHost().c_str());
+bot->logLastComMessage(theClient, Message);
return;
}
theClient->getRealNickUserHost().c_str(),
targetUser->getUserName().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
} //SUSPENDCommand::Exec
} //Namespace cf
theClient->getRealNickUserHost().c_str(),
theChan->getChannel().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
} // namespace cf
theClient->getRealNickUserHost().c_str(),
theChan->getChannel().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
} // namespace cf
theClient->getRealNickUserHost().c_str(),
targetUser->getUserName().c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
} //UNSUSPENDCommand::Exec
} //namespace cf
theClient->getRealNickUserHost().c_str(),
st[1].c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
language::setting_doesnt_exist,
std::string("This setting does not exist.")).c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
}
std::string("Number of users: %d.")).c_str(),
numUsersInGroup);
+bot->logLastComMessage(theClient, Message);
+
return;
} //WHOGROUPCommand::Exec
} //namespace cf
theUser2->getLastUpdatedBy().c_str(),
bot->prettyDuration(theUser2->getLastUpdated()).c_str());
+bot->logLastComMessage(theClient, Message);
+
return;
} //WHOISCommand::Exec
} //namespace cf
sqlUser::F_OWNER
));
RegisterCommand(new LASTCOMCommand(this, "LASTCOM",
- "[days]",
+ "[amount of commands] [days from]",
1,
sqlUser::F_OWNER
));
commHandler->second->Exec(theClient, theUser ? theUser : NULL, Message);
-if ((Command != "CANFIX" && Command != "HELP")) {
- std::string log;
- PgDatabase* cacheCon = theManager->getConnection();
-
- static const char *Main = "INSERT into comlog (ts,user_name,command) VALUES (now()::abstime::int4,'";
-
- std::stringstream insertString;
- insertString << Main
- << theClient->getAccount()
- << "','"
- << Command
- << " ";
- unsigned int pos = 1;
- while (pos < st.size()) {
- insertString << st[pos]
- << " ";
- pos++;
- }
-
- insertString << "')"
- << std::ends;
-
- if (!cacheCon->ExecCommandOk(insertString.str().c_str())) {
- elog << "sqlChannel::Insert> Something went wrong: "
- << cacheCon->ErrorMessage()
- << std::endl;
- }
-
- theManager->removeConnection(cacheCon);
-}
-
xClient::OnPrivateMessage(theClient, Message);
}
} // for
}
+bool chanfix::logLastComMessage(iClient* theClient, const std::string& Message)
+{
+ StringTokenizer st(Message);
+ if (st.empty())
+ return false;
+
+ const std::string Command = string_upper(st[0]);
+
+ std::string log;
+ PgDatabase* cacheCon = theManager->getConnection();
+
+ static const char *Main = "INSERT into comlog (ts,user_name,command) VALUES (now()::abstime::int4,'";
+
+ std::stringstream insertString;
+ insertString << Main
+ << theClient->getAccount()
+ << "','"
+ << Command
+ << " ";
+
+ unsigned int pos = 1;
+ while (pos < st.size()) {
+ insertString << st[pos]
+ << " ";
+ pos++;
+ }
+
+ insertString << "')"
+ << std::ends;
+
+ if (!cacheCon->ExecCommandOk(insertString.str().c_str())) {
+ elog << "sqlChannel::Insert> Something went wrong: "
+ << cacheCon->ErrorMessage()
+ << std::endl;
+ }
+
+ theManager->removeConnection(cacheCon);
+
+ return true;
+}
+
/* msgTopOps */
bool chanfix::msgTopOps(Channel* netChan) {
void autoFix();
void manualFix(Channel*);
+ bool logLastComMessage(iClient*, const std::string&);
bool msgTopOps(Channel*);
bool fixChan(sqlChannel*, bool);