cmd/hydroxide: remove unused receiveEvents
This commit is contained in:
parent
2a1811205f
commit
6d69d5ef72
|
@ -8,7 +8,6 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
imapmove "github.com/emersion/go-imap-move"
|
||||
imapspacialuse "github.com/emersion/go-imap-specialuse"
|
||||
|
@ -35,27 +34,6 @@ func newClient() *protonmail.Client {
|
|||
}
|
||||
}
|
||||
|
||||
func receiveEvents(c *protonmail.Client, ch chan<- *protonmail.Event) {
|
||||
t := time.NewTicker(time.Minute)
|
||||
defer t.Stop()
|
||||
|
||||
var last string
|
||||
for range t.C {
|
||||
event, err := c.GetEvent(last)
|
||||
if err != nil {
|
||||
log.Println("Cannot receive event:", err)
|
||||
continue
|
||||
}
|
||||
|
||||
if event.ID == last {
|
||||
continue
|
||||
}
|
||||
last = event.ID
|
||||
|
||||
ch <- event
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
|
|
Loading…
Reference in New Issue