about summary refs log blame commit diff stats
path: root/worker/notmuch/eventhandlers.go
blob: 976cbfd448f2ed1f9a1ec315ff94691b092a1be5 (plain) (tree)
1
2
3
4
5
6
7
8
9

                



                                                         

                                                  
                


                                     











                                                                                      
//+build notmuch

package notmuch

func (w *worker) handleNotmuchEvent(et eventType) error {
	switch ev := et.(type) {
	case *updateDirCounts:
		return w.handleUpdateDirCounts(ev)
	default:
		return errUnsupported
	}
}

func (w *worker) handleUpdateDirCounts(ev eventType) error {
	for name, query := range w.nameQueryMap {
		info, err := w.gatherDirectoryInfo(name, query)
		if err != nil {
			w.w.Logger.Printf("could not gather DirectoryInfo: %v\n", err)
			continue
		}
		w.w.PostMessage(info, nil)
	}
	return nil
}