diff options
author | Fedja Beader <fedja@protonmail.ch> | 2024-08-27 23:17:45 +0000 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2024-08-27 23:17:45 +0000 |
commit | df7344aa9c44e8a2736df02b8569cf32b41cb03a (patch) | |
tree | 0bd8cbd6466ce957d103503a4a28a4efa22697ee /src | |
parent | b2f7e73bc1b7abff4b5aee4f0f569a4a723dc6e9 (diff) | |
download | plus-df7344aa9c44e8a2736df02b8569cf32b41cb03a.tar.gz plus-df7344aa9c44e8a2736df02b8569cf32b41cb03a.tar.bz2 plus-df7344aa9c44e8a2736df02b8569cf32b41cb03a.tar.xz plus-df7344aa9c44e8a2736df02b8569cf32b41cb03a.zip |
Show mail expiry time
Server does not communicate sent time.. or it did, until 2017 ??
See src/map/clif.c #if PACKETVER >= 20170419
The RODEX_EXPIRY constant seems not to be communicated either,
preventing us from deducing send time from expiry time.
****
mana/plus!90
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/windows/mailviewwindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/windows/mailviewwindow.h | 1 | ||||
-rw-r--r-- | src/utils/stringutils.cpp | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp index d0d42f168..df2fe1eec 100644 --- a/src/gui/windows/mailviewwindow.cpp +++ b/src/gui/windows/mailviewwindow.cpp @@ -69,6 +69,9 @@ MailViewWindow::MailViewWindow(MailMessage *const message, // TRANSLATORS: mail view window label mTimeLabel(new Label(this, strprintf("%s %s", _("Time:"), message->strTime.c_str()))), + // TRANSLATORS: mail view window label - mail expiry time + mExpireTimeLabel(new Label(this, strprintf("%s %s", _("Expires at:"), + timeToStr(message->expireTime).c_str()))), mMoneyLabel(nullptr), // TRANSLATORS: mail view window label mFromLabel(new Label(this, strprintf("%s %s", _("From:"), @@ -107,6 +110,7 @@ MailViewWindow::MailViewWindow(MailMessage *const message, int n = 0; placer(0, n++, mTimeLabel, 1, 1); + placer(0, n++, mExpireTimeLabel, 1, 1); placer(0, n++, mFromLabel, 1, 1); placer(0, n++, mSubjectLabel, 1, 1); if (message->money != 0) diff --git a/src/gui/windows/mailviewwindow.h b/src/gui/windows/mailviewwindow.h index 201fea426..6a5da1157 100644 --- a/src/gui/windows/mailviewwindow.h +++ b/src/gui/windows/mailviewwindow.h @@ -66,6 +66,7 @@ class MailViewWindow final : public Window, Button *mNextButton; Button *mReplyButton; Label *mTimeLabel; + Label *mExpireTimeLabel; Label *mMoneyLabel; Label *mFromLabel; Label *mSubjectLabel; diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 8daaf3be2..cd2a87ab2 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -947,7 +947,8 @@ std::string timeToStr(const uint32_t time) char buf[101]; const time_t tempTime = time; tm *const timeInfo = localtime(&tempTime); - if (strftime(&buf[0], 100, "%Y-%m-%d_%H-%M-%S", timeInfo) != 0U) + // %c is locale-defined format + if (strftime(&buf[0], 100, "%c", timeInfo) != 0U) return std::string(buf); return "unknown"; } |