imap: fix no-envelope-for-message error
Fix the "no envelope available for this message" error that can occur when using the same imap mailbox in another mailclient (e.g. through a webmail interface) at the same time. Complements the fixes in commit7fe7fe4
("ui: fix panic in header formatter") and commit074b0a1
("view,list: fix crash when viewing incomplete imap messages"). The error is caused when a message attribute update is received by the message store before the message list had a chance to fetch the proper header first. In this case, an (incomplete) message info is stored in the message store and the message list will never fetch the correct header. To prevent this, add only messages to the store with a non-nil envelope but make sure that message attribute updates are properly merged. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
parent
e810ae12d7
commit
f6e34e4cf1
1 changed files with 3 additions and 1 deletions
|
@ -225,8 +225,10 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
|
||||||
if existing, ok := store.Messages[msg.Info.Uid]; ok && existing != nil {
|
if existing, ok := store.Messages[msg.Info.Uid]; ok && existing != nil {
|
||||||
merge(existing, msg.Info)
|
merge(existing, msg.Info)
|
||||||
} else {
|
} else {
|
||||||
|
if msg.Info.Envelope != nil {
|
||||||
store.Messages[msg.Info.Uid] = msg.Info
|
store.Messages[msg.Info.Uid] = msg.Info
|
||||||
}
|
}
|
||||||
|
}
|
||||||
seen := false
|
seen := false
|
||||||
recent := false
|
recent := false
|
||||||
for _, flag := range msg.Info.Flags {
|
for _, flag := range msg.Info.Flags {
|
||||||
|
|
Loading…
Reference in a new issue