diff --git a/Changelog.md b/Changelog.md index d52222e0..5ba5cc0e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/) ### Added * IMAP extension MOVE with UIDPLUS support +* IMAP mailbox info update when new mailbox is created * IMAP extension Unselect * More logs about event loop activity diff --git a/internal/store/address_mailbox.go b/internal/store/address_mailbox.go index eae9ab5c..dfa4a78e 100644 --- a/internal/store/address_mailbox.go +++ b/internal/store/address_mailbox.go @@ -78,6 +78,7 @@ func (storeAddress *Address) createOrUpdateMailboxEvent(label *pmapi.Label) erro return err } storeAddress.mailboxes[label.ID] = mailbox + mailbox.store.imapMailboxCreated(storeAddress.address, mailbox.labelName) } else { mailbox.labelName = prefix + label.Name mailbox.color = label.Color diff --git a/internal/store/change.go b/internal/store/change.go index 88d69f78..2d3f6d2d 100644 --- a/internal/store/change.go +++ b/internal/store/change.go @@ -76,6 +76,20 @@ func (store *Store) imapDeleteMessage(address, mailboxName string, sequenceNumbe store.imapSendUpdate(update) } +func (store *Store) imapMailboxCreated(address, mailboxName string) { + store.log.WithFields(logrus.Fields{ + "address": address, + }).Trace("IDLE mailbox info") + update := new(imapBackend.MailboxInfoUpdate) + update.Update = imapBackend.NewUpdate(address, "") + update.MailboxInfo = &imap.MailboxInfo{ + Attributes: []string{imap.NoInferiorsAttr}, + Delimiter: PathDelimiter, + Name: mailboxName, + } + store.imapSendUpdate(update) +} + func (store *Store) imapMailboxStatus(address, mailboxName string, total, unread, unreadSeqNum uint) { store.log.WithFields(logrus.Fields{ "address": address,