summaryrefslogtreecommitdiff
path: root/pkg/rest/mailbox.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/rest/mailbox.go')
-rw-r--r--pkg/rest/mailbox.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/rest/mailbox.go b/pkg/rest/mailbox.go
index eb47b89..7526e4b 100644
--- 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