summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-26 19:33:11 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-26 19:33:11 +0300
commit86735e142e86391e46b0eafbcb7ef01e25fc969a (patch)
treea717ba215baae052de204ed7b8e50b20c453882a /src/net/eathena
parentd3f61bb7da045c7d0a955a3859aac713d1bfc6e7 (diff)
downloadmv-86735e142e86391e46b0eafbcb7ef01e25fc969a.tar.gz
mv-86735e142e86391e46b0eafbcb7ef01e25fc969a.tar.bz2
mv-86735e142e86391e46b0eafbcb7ef01e25fc969a.tar.xz
mv-86735e142e86391e46b0eafbcb7ef01e25fc969a.zip
Add support for getting attached items from mail message.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/mail2recv.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp
index 1cb2a7f58..392e679d6 100644
--- a/src/net/eathena/mail2recv.cpp
+++ b/src/net/eathena/mail2recv.cpp
@@ -467,10 +467,31 @@ void Mail2Recv::processRequestMoney(Net::MessageIn &msg)
void Mail2Recv::processRequestItems(Net::MessageIn &msg)
{
- UNIMPLEMENTEDPACKET;
- msg.readInt64("mail id");
+ const int64_t mailId = msg.readInt64("mail id");
msg.readUInt8("open type");
- msg.readUInt8("result");
+ const int res = msg.readUInt8("result");
+ switch (res)
+ {
+ case 0:
+ NotifyManager::notify(
+ NotifyTypes::MAIL_GET_ATTACH_OK);
+ if (mailViewWindow)
+ mailViewWindow->removeItems(mailId);
+ break;
+ case 1:
+ NotifyManager::notify(
+ NotifyTypes::MAIL_GET_ATTACH_ERROR);
+ break;
+ case 2:
+ NotifyManager::notify(
+ NotifyTypes::MAIL_GET_ATTACH_FULL_ERROR);
+ break;
+ default:
+ UNIMPLEMENTEDPACKETFIELD(res);
+ NotifyManager::notify(
+ NotifyTypes::MAIL_GET_ATTACH_ERROR);
+ break;
+ }
}
} // namespace EAthena