Change MarkedMessages to return uids
Especially if one tries to interact with all marked messages there could be the case that not all headers are fetched yet, hence the messageInfo is still nil. This segfaults a lot of commands which in principle only need the uid to complete. If we switch to uids, this issue can be alleviated for those commands.
This commit is contained in:
parent
381c1fc05f
commit
ea2646fc03
5 changed files with 30 additions and 14 deletions
|
@ -215,9 +215,9 @@ func (acct *AccountView) SelectedMessage() (*models.MessageInfo, error) {
|
|||
return msg, nil
|
||||
}
|
||||
|
||||
func (acct *AccountView) MarkedMessages() ([]*models.MessageInfo, error) {
|
||||
func (acct *AccountView) MarkedMessages() ([]uint32, error) {
|
||||
store := acct.Store()
|
||||
return msgInfoFromUids(store, store.Marked())
|
||||
return store.Marked(), nil
|
||||
}
|
||||
|
||||
func (acct *AccountView) SelectedMessagePart() *PartInfo {
|
||||
|
|
|
@ -262,9 +262,9 @@ func (mv *MessageViewer) SelectedMessage() (*models.MessageInfo, error) {
|
|||
return mv.msg.MessageInfo(), nil
|
||||
}
|
||||
|
||||
func (mv *MessageViewer) MarkedMessages() ([]*models.MessageInfo, error) {
|
||||
func (mv *MessageViewer) MarkedMessages() ([]uint32, error) {
|
||||
store := mv.Store()
|
||||
return msgInfoFromUids(store, store.Marked())
|
||||
return store.Marked(), nil
|
||||
}
|
||||
|
||||
func (mv *MessageViewer) ToggleHeaders() {
|
||||
|
|
|
@ -25,5 +25,5 @@ type ProvidesMessages interface {
|
|||
Store() *lib.MessageStore
|
||||
SelectedAccount() *AccountView
|
||||
SelectedMessage() (*models.MessageInfo, error)
|
||||
MarkedMessages() ([]*models.MessageInfo, error)
|
||||
MarkedMessages() ([]uint32, error)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue