summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/mailmessage.h6
-rw-r--r--src/gui/windows/mailwindow.cpp12
-rw-r--r--src/gui/windows/mailwindow.h3
3 files changed, 17 insertions, 4 deletions
diff --git a/src/gui/mailmessage.h b/src/gui/mailmessage.h
index b5ce75612..0f6d4f6b5 100644
--- a/src/gui/mailmessage.h
+++ b/src/gui/mailmessage.h
@@ -23,6 +23,8 @@
#include "const/resources/item/cards.h"
+#include "enums/net/mailmessagetype.h"
+
#include <string>
#include "localconsts.h"
@@ -41,9 +43,9 @@ struct MailMessage final
itemAmount(0),
itemId(0),
itemType(0),
+ type(MailMessageType::Text),
itemAttribute(0U),
itemRefine(0U),
- type(0U),
read(false),
itemIdentify(false)
{
@@ -65,9 +67,9 @@ struct MailMessage final
int itemAmount;
int itemId;
int itemType;
+ MailMessageType::Type type;
uint8_t itemAttribute;
uint8_t itemRefine;
- uint8_t type;
bool read;
bool itemIdentify;
};
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp
index ec107f3a6..647eb17f5 100644
--- a/src/gui/windows/mailwindow.cpp
+++ b/src/gui/windows/mailwindow.cpp
@@ -169,7 +169,7 @@ void MailWindow::clear()
mListBox->setSelected(-1);
}
-std::string MailWindow::getMailHeader(MailMessage *const message)
+std::string MailWindow::getMailHeader(MailMessage *const message) const
{
if (mUseMail2)
{
@@ -178,6 +178,16 @@ std::string MailWindow::getMailHeader(MailMessage *const message)
header.append(" ");
else
header.append("U");
+ const MailMessageType::Type type = message->type;
+ if ((type & MailMessageType::Money) != 0)
+ header.append("M");
+ else
+ header.append(" ");
+ if ((type & MailMessageType::Item) != 0)
+ header.append("I");
+ else
+ header.append(" ");
+ header.append(" ").append(message->title);
return STD_MOVE(header);
}
else
diff --git a/src/gui/windows/mailwindow.h b/src/gui/windows/mailwindow.h
index b356b0666..7c808379d 100644
--- a/src/gui/windows/mailwindow.h
+++ b/src/gui/windows/mailwindow.h
@@ -75,7 +75,8 @@ class MailWindow final : public Window,
private:
void refreshMails();
- std::string getMailHeader(MailMessage *const message) A_NONNULL(2);
+ std::string getMailHeader(MailMessage *const message) const
+ A_WARN_UNUSED A_NONNULL(2);
STD_VECTOR<MailMessage*> mMessages;
std::map<int, MailMessage*> mMessagesMap;