summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-20 21:55:56 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-20 21:55:56 +0300
commit99df456164cbb994e2d789c25b193074476a97a2 (patch)
treed81a08e2896ce891dc1b6cdb011c672ef7aa10c3 /src/net
parent5688ea69de4884a464cefd4b47069b15f16b9e36 (diff)
downloadmanaplus-99df456164cbb994e2d789c25b193074476a97a2.tar.gz
manaplus-99df456164cbb994e2d789c25b193074476a97a2.tar.bz2
manaplus-99df456164cbb994e2d789c25b193074476a97a2.tar.xz
manaplus-99df456164cbb994e2d789c25b193074476a97a2.zip
Move requesttradelistener into separate file.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/tradehandler.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index 19e597967..48d80c9ee 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -39,6 +39,8 @@
#include "net/ea/eaprotocol.h"
+#include "listeners/requesttradelistener.h"
+
#include "debug.h"
extern std::string tradePartnerName;
@@ -49,17 +51,7 @@ ConfirmDialog *confirmDlg = nullptr;
*/
namespace
{
- struct RequestTradeListener : public ActionListener
- {
- void action(const ActionEvent &event)
- {
- confirmDlg = nullptr;
- const std::string &eventId = event.getId();
- if (eventId == "ignore")
- player_relations.ignoreTrade(tradePartnerName);
- Net::getTradeHandler()->respond(eventId == "yes");
- }
- } listener;
+ RequestTradeListener listener;
} // namespace
namespace Ea