aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2023-04-16 09:53:42 -0500
committerRobin Jarry <robin@jarry.cc>2023-04-22 22:40:12 +0200
commit2438d3b74ff9faf598e67f4b6da9324aa98b8b86 (patch)
tree6eadb0bbe3b4ae4cfc4a9ae2ae6fb2773cb4da23 /widgets
parent2ed7a741ff9eca1dd3fe9e94cdcfe4f365b74ff2 (diff)
downloadaerc-2438d3b74ff9faf598e67f4b6da9324aa98b8b86.tar.gz
dirstore: store directory model in dirstore
Use the dirstore to store models.Directory data structures. This will be used in subsequent commits for accessing directory data. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r--widgets/account.go2
-rw-r--r--widgets/dirlist.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/widgets/account.go b/widgets/account.go
index ad9d200a..6449aeba 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -308,7 +308,7 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) {
acct.updateSplitView,
)
store.SetMarker(marker.New(store))
- acct.dirlist.SetMsgStore(msg.Dir.Name, store)
+ acct.dirlist.SetMsgStore(msg.Dir, store)
case *types.DirectoryInfo:
if store, ok := acct.dirlist.MsgStore(msg.Info.Name); ok {
store.Update(msg)
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index a548b7b7..85cf4112 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -39,7 +39,7 @@ type DirectoryLister interface {
SelectedMsgStore() (*lib.MessageStore, bool)
MsgStore(string) (*lib.MessageStore, bool)
- SetMsgStore(string, *lib.MessageStore)
+ SetMsgStore(*models.Directory, *lib.MessageStore)
FilterDirs([]string, []string, bool) []string
GetRUECount(string) (int, int, int)
@@ -478,8 +478,8 @@ func (dirlist *DirectoryList) MsgStore(name string) (*lib.MessageStore, bool) {
return dirlist.store.MessageStore(name)
}
-func (dirlist *DirectoryList) SetMsgStore(name string, msgStore *lib.MessageStore) {
- dirlist.store.SetMessageStore(name, msgStore)
+func (dirlist *DirectoryList) SetMsgStore(dir *models.Directory, msgStore *lib.MessageStore) {
+ dirlist.store.SetMessageStore(dir, msgStore)
msgStore.OnUpdateDirs(func() {
dirlist.Invalidate()
})