diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-06 20:53:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-06 20:53:45 +0300 |
commit | e6a0f5d75e7b26db76d24e0d1773a33fa4315611 (patch) | |
tree | c53062c7717ebe8665635e308b63770f7c7a9ac3 /src/being | |
parent | 51be674df969fbed48503c3482268599e8b3a01b (diff) | |
download | manaplus-e6a0f5d75e7b26db76d24e0d1773a33fa4315611.tar.gz manaplus-e6a0f5d75e7b26db76d24e0d1773a33fa4315611.tar.bz2 manaplus-e6a0f5d75e7b26db76d24e0d1773a33fa4315611.tar.xz manaplus-e6a0f5d75e7b26db76d24e0d1773a33fa4315611.zip |
Add variable in away message with player name.
If present it will be replace to target player name.
Variable: 'NAME'
Example: /away hi 'NAME'.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/localplayer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index dd06b87a1..66d662a8d 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -1891,8 +1891,11 @@ void LocalPlayer::afkRespond(ChatTab *const tab, const std::string &nick) if (mAfkTime == 0 || time < mAfkTime || time - mAfkTime > awayLimitTimer) { - std::string msg("*AFK*: " - + config.getStringValue("afkMessage")); + std::string str(config.getStringValue("afkMessage")); + if (str.find("'NAME'") != std::string::npos) + replaceAll(str, "'NAME'", nick); + + std::string msg("*AFK*: " + str); if (config.getIntValue("afkFormat") == 1) msg = "*" + msg + "*"; |