summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Eskola <fruitiex@gmail.com>2013-08-10 04:38:13 +0300
committerRasmus Eskola <fruitiex@gmail.com>2013-08-10 04:38:13 +0300
commitb555858e69c01e4394eb6dc6bc6c166329c4db22 (patch)
tree9de4e3f028db180699a1d0396d10e13e8bca9baa
parent7cd8832c3314b697f78ea63383bd7dc3289ef7c3 (diff)
warn user of empty logpath at first load, remove unneeded comments,
increase default reqLines
-rw-r--r--backlog.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/backlog.cpp b/backlog.cpp
index 0aaca6c..e3a1e8b 100644
--- a/backlog.cpp
+++ b/backlog.cpp
@@ -29,13 +29,6 @@
class CBacklogMod : public CModule {
public:
MODCONSTRUCTOR(CBacklogMod) {}
- /*
- AddHelpCommand();
- AddCommand("LogPath", static_cast<CModCommand::ModCmdFunc>(&CBacklogMod::SetLogPath),
- "<path>");
- AddCommand("Get", static_cast<CModCommand::ModCmdFunc>(&CBacklogMod::SetLogPath),
- }
- */
virtual bool OnLoad(const CString& sArgs, CString& sMessage);
virtual ~CBacklogMod();
@@ -47,13 +40,13 @@ private:
bool CBacklogMod::OnLoad(const CString& sArgs, CString& sMessage) {
LogPath = sArgs;
- PutModule("I'm being loaded with the arguments: [" + sArgs + "]");
if(LogPath.empty()) {
LogPath = GetNV("LogPath");
if(LogPath.empty()) {
- // TODO: guess logpath
-
+ // TODO: guess logpath?
+ PutModule("LogPath is empty, set it with the LogPath command");
+ PutModule("Usage: LogPath <path> (use keywords $USER, $NETWORK, $WINDOW)");
}
} else {
SetNV("LogPath", LogPath);
@@ -63,12 +56,11 @@ bool CBacklogMod::OnLoad(const CString& sArgs, CString& sMessage) {
}
CBacklogMod::~CBacklogMod() {
- PutModule("I'm being unloaded!");
}
void CBacklogMod::OnModCommand(const CString& sCommand) {
if (sCommand.Token(0).CaseCmp("help") == 0) {
- // TODO: help text, look how AddHelpCommand() does it in other ZNC code
+ // TODO: proper help text, look how AddHelpCommand() does it in other ZNC code
PutModule("Help");
return;
}
@@ -77,6 +69,7 @@ void CBacklogMod::OnModCommand(const CString& sCommand) {
if(LogPath.empty()) {
PutModule("Usage: LogPath <path> (use keywords $USER, $NETWORK, $WINDOW)");
+ PutModule("Current LogPath is set to: " + GetNV("LogPath"));
return;
}
@@ -93,7 +86,7 @@ void CBacklogMod::OnModCommand(const CString& sCommand) {
int printedLines = 0;
int reqLines = sCommand.Token(1).ToInt();
if(reqLines <= 0) {
- reqLines = 50;
+ reqLines = 150;
}
CString Path = LogPath.substr(); // make copy