summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUser Smuth <smuth@i.kannox.me>2017-06-12 16:28:15 +0000
committerUser Smuth <smuth@i.kannox.me>2017-06-12 16:28:15 +0000
commitcd3c5cf25c444c17839a0fb67751ba0242c411ea (patch)
tree3e667120a5f0702a4e769480015f3b29eb64c2ba
parent494f8981e665f39008e39e6a09f981b5d2588948 (diff)
Add lowercase versions of $NETWORK and $USER
-rw-r--r--README.md3
-rw-r--r--backlog.cpp6
2 files changed, 6 insertions, 3 deletions
diff --git a/README.md b/README.md
index 36865b6..ce2799d 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,8 @@ path as an argument when loading the module)
LogPath /path/to/your/logs/$USER_$NETWORK_$WINDOW_*.log
**$USER** will be replaced with your ZNC username, **$NETWORK** with the current
-network and **$WINDOW** with the requested channel/window name. The last found
+network and **$WINDOW** with the requested channel/window name. **$user** and
+**$network** can also be used to force the string to be lowercase. The last found
asterisk character **'\*'** in the string is assumed to be a date, and the order in
which the files are read is determined by a simple alphabetical sort. (ie.
date format order must be year-month-date)
diff --git a/backlog.cpp b/backlog.cpp
index 39ea131..9ad9d21 100644
--- a/backlog.cpp
+++ b/backlog.cpp
@@ -63,12 +63,12 @@ void CBacklogMod::OnModCommand(const CString& sCommand) {
PutModule("");
PutModule("Commands:");
PutModule("Help (print this text)");
- PutModule("LogPath <path> (use keywords $USER, $NETWORK, $WINDOW and an asterisk * for date)");
+ PutModule("LogPath <path> (use keywords $USER, $NETWORK, $WINDOW, $user, $network and an asterisk * for date)");
PutModule("PrintStatusMsgs true/false (print join/part/rename messages)");
return;
} else if (sCommand.Token(0).Equals("logpath")) {
if(Arg.empty()) {
- PutModule("Usage: LogPath <path> (use keywords $USER, $NETWORK, $WINDOW and an asterisk * for date:)");
+ PutModule("Usage: LogPath <path> (use keywords $USER, $NETWORK, $WINDOW, $user, $network and an asterisk * for date:)");
PutModule("Current LogPath is set to: " + GetNV("LogPath"));
return;
}
@@ -102,8 +102,10 @@ void CBacklogMod::OnModCommand(const CString& sCommand) {
CString Path = GetNV("LogPath").substr(); // make copy
Path.Replace("$NETWORK", Network);
+ Path.Replace("$network", Network.AsLower());
Path.Replace("$WINDOW", CString(Channel.Replace_n("/", "-").Replace_n("\\", "-")).AsLower());
Path.Replace("$USER", User);
+ Path.Replace("$user", User.AsLower());
CString DirPath = Path.substr(0, Path.find_last_of("/"));
CString FilePath;