summaryrefslogtreecommitdiff
path: root/src/net/ea/chathandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-10-08 01:00:52 +0300
committerAndrei Karas <akaras@inbox.ru>2011-10-08 01:02:48 +0300
commit29187a2582c04e3ede63f9c58f09dbbe34834a30 (patch)
tree93b77c0ad573af9c6d52a6932e76f6c223e2c8f3 /src/net/ea/chathandler.cpp
parentaf98cb5dea5644e0d95a5bf41c03655e4ab808ef (diff)
downloadManaVerse-29187a2582c04e3ede63f9c58f09dbbe34834a30.tar.gz
ManaVerse-29187a2582c04e3ede63f9c58f09dbbe34834a30.tar.bz2
ManaVerse-29187a2582c04e3ede63f9c58f09dbbe34834a30.tar.xz
ManaVerse-29187a2582c04e3ede63f9c58f09dbbe34834a30.zip
Add checks and fix code style.
Diffstat (limited to 'src/net/ea/chathandler.cpp')
-rw-r--r--src/net/ea/chathandler.cpp34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index c18b1bb9a..3863fc6f3 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -168,13 +168,11 @@ void ChatHandler::processWhisper(Net::MessageIn &msg)
return;
}
- if (player_relations.hasPermission(
- nick, PlayerRelation::WHISPER))
+ if (player_relations.hasPermission(nick, PlayerRelation::WHISPER))
{
bool tradeBot = config.getBoolValue("tradebot");
bool showMsg = !config.getBoolValue("hideShopMessages");
- if (player_relations.hasPermission(
- nick, PlayerRelation::TRADE))
+ if (player_relations.hasPermission(nick, PlayerRelation::TRADE))
{
if (shopWindow)
{ //commands to shop from player
@@ -184,8 +182,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg)
{
if (showMsg && chatWindow)
chatWindow->addWhisper(nick, chatMsg);
- shopWindow->giveList(nick,
- ShopWindow::SELL);
+ shopWindow->giveList(nick, ShopWindow::SELL);
}
}
else if (chatMsg.find("!buylist ") == 0)
@@ -194,8 +191,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg)
{
if (showMsg && chatWindow)
chatWindow->addWhisper(nick, chatMsg);
- shopWindow->giveList(nick,
- ShopWindow::BUY);
+ shopWindow->giveList(nick, ShopWindow::BUY);
}
}
else if (chatMsg.find("!buyitem ") == 0)
@@ -205,7 +201,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg)
if (tradeBot)
{
shopWindow->processRequest(nick, chatMsg,
- ShopWindow::BUY);
+ ShopWindow::BUY);
}
}
else if (chatMsg.find("!sellitem ") == 0)
@@ -215,7 +211,7 @@ void ChatHandler::processWhisper(Net::MessageIn &msg)
if (tradeBot)
{
shopWindow->processRequest(nick, chatMsg,
- ShopWindow::SELL);
+ ShopWindow::SELL);
}
}
else if (chatMsg.length() > 3
@@ -224,11 +220,8 @@ void ChatHandler::processWhisper(Net::MessageIn &msg)
chatMsg = chatMsg.erase(0, 2);
if (showMsg && chatWindow)
chatWindow->addWhisper(nick, chatMsg);
- if (chatMsg.find("B1") == 0
- || chatMsg.find("S1") == 0)
- {
+ if (chatMsg.find("B1") == 0 || chatMsg.find("S1") == 0)
shopWindow->showList(nick, chatMsg);
- }
}
else if (chatWindow)
{
@@ -242,9 +235,8 @@ void ChatHandler::processWhisper(Net::MessageIn &msg)
}
else
{
- if (chatWindow && (showMsg
- || (chatMsg.find("!selllist")
- != 0 && chatMsg.find("!buylist") != 0)))
+ if (chatWindow && (showMsg || (chatMsg.find("!selllist") != 0
+ && chatMsg.find("!buylist") != 0)))
{
chatWindow->addWhisper(nick, chatMsg);
}
@@ -277,8 +269,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg)
std::string sender_name = ((pos == std::string::npos)
? "" : chatMsg.substr(0, pos));
- if (sender_name != being->getName()
- && being->getType() == Being::PLAYER)
+ if (sender_name != being->getName() && being->getType() == Being::PLAYER)
{
if (!being->getName().empty())
sender_name = being->getName();
@@ -296,8 +287,8 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg)
if (player_relations.checkPermissionSilently(sender_name,
PlayerRelation::SPEECH_LOG) && chatWindow)
{
- chatWindow->resortChatLog(removeColors(sender_name) + " : "
- + chatMsg, BY_OTHER);
+ chatWindow->resortChatLog(removeColors(sender_name)
+ + " : " + chatMsg, BY_OTHER);
}
if (player_relations.hasPermission(sender_name,
@@ -363,4 +354,3 @@ void ChatHandler::processMVP(Net::MessageIn &msg)
}
} // namespace Ea
-