taler-mailbox

Service for asynchronous wallet-to-wallet payment messages
Log | Files | Refs | Submodules | README | LICENSE

commit 605fbe46f447e2c12694cb0c230df704d88c36b4
parent 485861ffce6d8b1983e5573c0c60a43d7cbc0e07
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Tue, 19 Jul 2022 23:11:49 +0200

read flag

Diffstat:
Mpkg/rest/mailbox.go | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/pkg/rest/mailbox.go b/pkg/rest/mailbox.go @@ -111,6 +111,9 @@ type inboxEntry struct { // Order ID OrderID string + + // Read flag + Read bool } func (m *Mailbox) configResponse(w http.ResponseWriter, r *http.Request) { @@ -158,9 +161,11 @@ func (m *Mailbox) getMessagesResponse(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusInternalServerError) return } + entry.Read = true w.Write(eph) w.Write(body) } + m.Db.Save(&entries) w.WriteHeader(http.StatusOK) } @@ -191,6 +196,7 @@ func (m *Mailbox) sendMessageResponse(w http.ResponseWriter, r *http.Request) { entry.HMailbox = vars["h_mailbox"] entry.EphemeralKey = msg.EphemeralKey entry.Body = msg.Body + entry.Read = false } if len(entry.OrderID) == 0 { // Add new order for new entry