aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-07-04 22:34:20 -0400
committerBen Burwell <ben@benburwell.com>2019-07-04 22:36:33 -0400
commit6574dedd8a4afdaedd3677283955a866214bd99a (patch)
treef5339b492ec7cfcbdefd4be96cea1bd177bfabea
parentdccdea1e026edc2bc9c5dc27604e85ce333d65bc (diff)
Remove unused fields from Directory and DirectoryInfo
As it turns out, the only fields of these messages that the UI cares about (right now) is the name.
-rw-r--r--worker/imap/list.go5
-rw-r--r--worker/imap/worker.go8
-rw-r--r--worker/types/messages.go9
3 files changed, 5 insertions, 17 deletions
diff --git a/worker/imap/list.go b/worker/imap/list.go
index 708e70f..4077e79 100644
--- a/worker/imap/list.go
+++ b/worker/imap/list.go
@@ -18,9 +18,8 @@ func (imapw *IMAPWorker) handleListDirectories(msg *types.ListDirectories) {
continue
}
imapw.worker.PostMessage(&types.Directory{
- Message: types.RespondTo(msg),
- Name: mbox.Name,
- Attributes: mbox.Attributes,
+ Message: types.RespondTo(msg),
+ Name: mbox.Name,
}, nil)
}
done <- nil
diff --git a/worker/imap/worker.go b/worker/imap/worker.go
index ff02a78..78e5537 100644
--- a/worker/imap/worker.go
+++ b/worker/imap/worker.go
@@ -170,13 +170,7 @@ func (w *IMAPWorker) handleImapUpdate(update client.Update) {
w.selected = *status
}
w.worker.PostMessage(&types.DirectoryInfo{
- Flags: status.Flags,
- Name: status.Name,
- ReadOnly: status.ReadOnly,
-
- Exists: int(status.Messages),
- Recent: int(status.Recent),
- Unseen: int(status.Unseen),
+ Name: status.Name,
}, nil)
case *client.MessageUpdate:
msg := update.Message
diff --git a/worker/types/messages.go b/worker/types/messages.go
index 3d2bd05..761290f 100644
--- a/worker/types/messages.go
+++ b/worker/types/messages.go
@@ -139,17 +139,12 @@ type AppendMessage struct {
type Directory struct {
Message
- Attributes []string
- Name string
+ Name string
}
type DirectoryInfo struct {
Message
- Flags []string
- Name string
- ReadOnly bool
-
- Exists, Recent, Unseen int
+ Name string
}
type DirectoryContents struct {