diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-26 00:24:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-26 00:24:45 +0300 |
commit | a0e63acd1443caa477ac5f7954557a17949c3675 (patch) | |
tree | 560c07d6147da181911f934e520b0acc48f68996 /src/net/eathena/mail2recv.cpp | |
parent | 4f75520b908b11f48c566c7bf0c10f6be5ab74bf (diff) | |
download | mv-a0e63acd1443caa477ac5f7954557a17949c3675.tar.gz mv-a0e63acd1443caa477ac5f7954557a17949c3675.tar.bz2 mv-a0e63acd1443caa477ac5f7954557a17949c3675.tar.xz mv-a0e63acd1443caa477ac5f7954557a17949c3675.zip |
Close mail edit window on success send.
Also show mail send error messages.
Diffstat (limited to 'src/net/eathena/mail2recv.cpp')
-rw-r--r-- | src/net/eathena/mail2recv.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp index fe36172b9..e3dc5b9da 100644 --- a/src/net/eathena/mail2recv.cpp +++ b/src/net/eathena/mail2recv.cpp @@ -295,8 +295,30 @@ void Mail2Recv::processCheckNameResult(Net::MessageIn &msg) void Mail2Recv::processSendResult(Net::MessageIn &msg) { - UNIMPLEMENTEDPACKET; - msg.readUInt8("result"); + const int res = msg.readUInt8("result"); + switch (res) + { + case 0: + NotifyManager::notify(NotifyTypes::MAIL_SEND_OK); + if (mailEditWindow != nullptr) + mailEditWindow->close(); + break; + case 1: + NotifyManager::notify(NotifyTypes::MAIL_SEND_FATAL_ERROR); + break; + case 2: + NotifyManager::notify(NotifyTypes::MAIL_SEND_COUNT_ERROR); + break; + case 3: + NotifyManager::notify(NotifyTypes::MAIL_SEND_ITEM_ERROR); + break; + case 4: + NotifyManager::notify(NotifyTypes::MAIL_SEND_RECEIVER_ERROR); + break; + default: + NotifyManager::notify(NotifyTypes::MAIL_SEND_ERROR); + break; + } } void Mail2Recv::processMailListPage(Net::MessageIn &msg) |