diff options
author | Kim Wallis <walliski@users.noreply.github.com> | 2017-06-13 09:57:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-13 09:57:20 +0300 |
commit | 42e8f439808882d2dae60f2a161eabead14e4b0d (patch) | |
tree | 3e667120a5f0702a4e769480015f3b29eb64c2ba | |
parent | 494f8981e665f39008e39e6a09f981b5d2588948 (diff) | |
parent | cd3c5cf25c444c17839a0fb67751ba0242c411ea (diff) |
Merge pull request #18 from smuth4/master
Add lowercase versions of $NETWORK and $USER
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | backlog.cpp | 6 |
2 files changed, 6 insertions, 3 deletions
@@ -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; |