diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-02-15 02:10:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-02-15 02:10:09 +0300 |
commit | 435c12617241fb87225987f2e3f0521cf2dbae75 (patch) | |
tree | 16add38ce29c63cea06757bb835eadbfb4e59a01 | |
parent | c29d9bec9751fbd836e59cb3ba60e778fca2f987 (diff) | |
download | mv-435c12617241fb87225987f2e3f0521cf2dbae75.tar.gz mv-435c12617241fb87225987f2e3f0521cf2dbae75.tar.bz2 mv-435c12617241fb87225987f2e3f0521cf2dbae75.tar.xz mv-435c12617241fb87225987f2e3f0521cf2dbae75.zip |
Remove unused channel parameter from talk methods.s20180215
-rw-r--r-- | src/gui/widgets/tabs/chat/chattab.cpp | 3 | ||||
-rw-r--r-- | src/net/chathandler.h | 9 | ||||
-rw-r--r-- | src/net/ea/chathandler.cpp | 5 | ||||
-rw-r--r-- | src/net/ea/chathandler.h | 3 | ||||
-rw-r--r-- | src/net/eathena/chathandler.cpp | 6 | ||||
-rw-r--r-- | src/net/eathena/chathandler.h | 6 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 10 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.h | 6 | ||||
-rw-r--r-- | src/progs/manaplus/actions/chat.cpp | 4 | ||||
-rw-r--r-- | src/progs/manaplus/actions/pets.cpp | 2 | ||||
-rw-r--r-- | src/utils/chatutils.cpp | 4 | ||||
-rw-r--r-- | src/utils/gmfunctions.cpp | 24 |
12 files changed, 30 insertions, 52 deletions
diff --git a/src/gui/widgets/tabs/chat/chattab.cpp b/src/gui/widgets/tabs/chat/chattab.cpp index 26b951c06..8d3ccafbb 100644 --- a/src/gui/widgets/tabs/chat/chattab.cpp +++ b/src/gui/widgets/tabs/chat/chattab.cpp @@ -433,8 +433,7 @@ void ChatTab::handleInput(const std::string &msg) { if (chatHandler) { - chatHandler->talk(ChatWindow::doReplace(msg), - mChannelName); + chatHandler->talk(ChatWindow::doReplace(msg)); } } diff --git a/src/net/chathandler.h b/src/net/chathandler.h index 4ffa62cd8..5c236b4f4 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -43,16 +43,13 @@ class ChatHandler notfinal virtual ~ChatHandler() { } - virtual void talk(const std::string &restrict text, - const std::string &restrict channel) const = 0; + virtual void talk(const std::string &restrict text) const = 0; - virtual void talkPet(const std::string &restrict text, - const std::string &restrict channel) const = 0; + virtual void talkPet(const std::string &restrict text) const = 0; virtual void talkRaw(const std::string &text) const = 0; - virtual void me(const std::string &restrict text, - const std::string &restrict channel) const = 0; + virtual void me(const std::string &restrict text) const = 0; virtual void privateMessage(const std::string &restrict recipient, const std::string &restrict text) diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 6b0d4bd2a..d616ab4ec 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -52,12 +52,11 @@ void ChatHandler::clear() const ChatRecv::mSkipping = true; } -void ChatHandler::me(const std::string &restrict text, - const std::string &restrict channel) const +void ChatHandler::me(const std::string &restrict text) const { // here need string duplication std::string action = strprintf("*%s*", text.c_str()); - talk(action, channel); + talk(action); } } // namespace Ea diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index a7fdb0e88..da6d1397c 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -41,8 +41,7 @@ class ChatHandler notfinal : public Net::ChatHandler ~ChatHandler() override; - void me(const std::string &restrict text, - const std::string &restrict channel) const override final; + void me(const std::string &restrict text) const override final; void clear() const override final; }; diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 10f55bba4..22a84e32f 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -54,8 +54,7 @@ ChatHandler::~ChatHandler() chatHandler = nullptr; } -void ChatHandler::talk(const std::string &restrict text, - const std::string &restrict channel A_UNUSED) const +void ChatHandler::talk(const std::string &restrict text) const { if (localPlayer == nullptr) return; @@ -287,8 +286,7 @@ void ChatHandler::partChannel(const std::string &channel) const } } -void ChatHandler::talkPet(const std::string &restrict text, - const std::string &restrict channel A_UNUSED) const +void ChatHandler::talkPet(const std::string &restrict text) const { if (text.empty()) return; diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h index e62cbb7d2..8e116ffc5 100644 --- a/src/net/eathena/chathandler.h +++ b/src/net/eathena/chathandler.h @@ -38,8 +38,7 @@ class ChatHandler final : public Ea::ChatHandler ~ChatHandler() override final; - void talk(const std::string &restrict text, - const std::string &restrict channel) const override final; + void talk(const std::string &restrict text) const override final; void talkRaw(const std::string &text) const override final; @@ -79,8 +78,7 @@ class ChatHandler final : public Ea::ChatHandler void partChannel(const std::string &channel) const override final; - void talkPet(const std::string &restrict text, - const std::string &restrict channel) const override final; + void talkPet(const std::string &restrict text) const override final; void leaveChatRoom() const override final; diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 0efc12a27..4acf65ddd 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -52,8 +52,7 @@ ChatHandler::~ChatHandler() chatHandler = nullptr; } -void ChatHandler::talk(const std::string &restrict text, - const std::string &restrict channel A_UNUSED) const +void ChatHandler::talk(const std::string &restrict text) const { if (localPlayer == nullptr) return; @@ -98,7 +97,7 @@ void ChatHandler::channelMessage(const std::string &restrict channel, const std::string &restrict text) const { if (channel == TRADE_CHANNEL) - talk("\302\202" + text, GENERAL_CHANNEL); + talk("\302\202" + text); else if (channel == GM_CHANNEL) Gm::runCommand("wgm", text); } @@ -230,12 +229,11 @@ void ChatHandler::partChannel(const std::string &channel A_UNUSED) const { } -void ChatHandler::talkPet(const std::string &restrict text, - const std::string &restrict channel) const +void ChatHandler::talkPet(const std::string &restrict text) const { // here need string duplication std::string action = strprintf("\302\202\303 %s", text.c_str()); - talk(action, channel); + talk(action); } void ChatHandler::leaveChatRoom() const diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h index 58400b265..ec5fb9bf3 100644 --- a/src/net/tmwa/chathandler.h +++ b/src/net/tmwa/chathandler.h @@ -38,8 +38,7 @@ class ChatHandler final : public Ea::ChatHandler ~ChatHandler() override final; - void talk(const std::string &restrict text, - const std::string &restrict channel) const override final; + void talk(const std::string &restrict text) const override final; void talkRaw(const std::string &text) const override final; @@ -79,8 +78,7 @@ class ChatHandler final : public Ea::ChatHandler void partChannel(const std::string &channel) const override final; - void talkPet(const std::string &restrict text, - const std::string &restrict channel) const override final; + void talkPet(const std::string &restrict text) const override final; void leaveChatRoom() const override final; diff --git a/src/progs/manaplus/actions/chat.cpp b/src/progs/manaplus/actions/chat.cpp index bbfefc826..986dda3ed 100644 --- a/src/progs/manaplus/actions/chat.cpp +++ b/src/progs/manaplus/actions/chat.cpp @@ -69,7 +69,7 @@ static void outString(ChatTab *const tab, if (tab == nullptr) { if (chatHandler != nullptr) - chatHandler->talk(def, GENERAL_CHANNEL); + chatHandler->talk(def); return; } @@ -126,7 +126,7 @@ static void outString(ChatTab *const tab, case ChatTabType::BATTLE: case ChatTabType::LANG: if (chatHandler != nullptr) - chatHandler->talk(str, GENERAL_CHANNEL); + chatHandler->talk(str); break; } } diff --git a/src/progs/manaplus/actions/pets.cpp b/src/progs/manaplus/actions/pets.cpp index f8785829a..301d05266 100644 --- a/src/progs/manaplus/actions/pets.cpp +++ b/src/progs/manaplus/actions/pets.cpp @@ -73,7 +73,7 @@ impHandler(talkPet) std::string args = event.args; if (findCutFirst(args, "/me ")) args = textToMe(args); - chatHandler->talkPet(args, GENERAL_CHANNEL); + chatHandler->talkPet(args); return true; } diff --git a/src/utils/chatutils.cpp b/src/utils/chatutils.cpp index 0e2d7e2cb..db87e1644 100644 --- a/src/utils/chatutils.cpp +++ b/src/utils/chatutils.cpp @@ -54,7 +54,7 @@ void outStringNormal(ChatTab *const tab, if (tab == nullptr) { - chatHandler->talk(str, GENERAL_CHANNEL); + chatHandler->talk(str); return; } @@ -112,7 +112,7 @@ void outStringNormal(ChatTab *const tab, case ChatTabType::LANG: case ChatTabType::GM: case ChatTabType::CHANNEL: - chatHandler->talk(def, GENERAL_CHANNEL); + chatHandler->talk(def); break; } } diff --git a/src/utils/gmfunctions.cpp b/src/utils/gmfunctions.cpp index 90e78f5ca..412f1a1a9 100644 --- a/src/utils/gmfunctions.cpp +++ b/src/utils/gmfunctions.cpp @@ -40,8 +40,7 @@ void runCommand(const std::string &command, { chatHandler->talk(std::string( settings.gmCommandSymbol).append( - command), - GENERAL_CHANNEL); + command)); } else { @@ -49,8 +48,7 @@ void runCommand(const std::string &command, settings.gmCommandSymbol).append( command).append( " ").append( - params), - GENERAL_CHANNEL); + params)); } } @@ -58,8 +56,7 @@ void runCommand(const std::string &command) { chatHandler->talk(std::string( settings.gmCommandSymbol).append( - command), - GENERAL_CHANNEL); + command)); } void runCharCommand(const std::string &command, @@ -72,8 +69,7 @@ void runCharCommand(const std::string &command, { chatHandler->talk(std::string( settings.gmCommandSymbol).append( - command), - GENERAL_CHANNEL); + command)); } else { @@ -81,8 +77,7 @@ void runCharCommand(const std::string &command, settings.gmCommandSymbol).append( command).append( " ").append( - params), - GENERAL_CHANNEL); + params)); } } else @@ -93,8 +88,7 @@ void runCharCommand(const std::string &command, " \"").append( name).append( "\" ").append( - params), - GENERAL_CHANNEL); + params)); } } @@ -105,8 +99,7 @@ void runCharCommand(const std::string &command, { chatHandler->talk(std::string( settings.gmCommandSymbol).append( - command), - GENERAL_CHANNEL); + command)); } else { @@ -114,8 +107,7 @@ void runCharCommand(const std::string &command, settings.gmCharCommandSymbol).append( command).append( " ").append( - name), - GENERAL_CHANNEL); + name)); } } |