about summary refs log tree commit diff stats
path: root/worker
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-31 12:17:57 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-31 12:19:30 -0400
commit95875b13f829919b3453763628d1dda97371fab0 (patch)
treed8d9c12680259b4d321165a32c9d7e0dc4b430fc /worker
parent27b25174e2f0249a6a1d4ba45b70f8504b63ffb1 (diff)
downloadaerc-95875b13f829919b3453763628d1dda97371fab0.tar.gz
Rename FetchMessageBodies to FetchFullMessages
Diffstat (limited to 'worker')
-rw-r--r--worker/imap/fetch.go20
-rw-r--r--worker/imap/worker.go4
-rw-r--r--worker/types/messages.go4
3 files changed, 14 insertions, 14 deletions
diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go
index feae462..89c0d99 100644
--- a/worker/imap/fetch.go
+++ b/worker/imap/fetch.go
@@ -21,15 +21,6 @@ func (imapw *IMAPWorker) handleFetchMessageHeaders(
 	imapw.handleFetchMessages(msg, &msg.Uids, items)
 }
 
-func (imapw *IMAPWorker) handleFetchMessageBodies(
-	msg *types.FetchMessageBodies) {
-
-	imapw.worker.Logger.Printf("Fetching message bodies")
-	section := &imap.BodySectionName{}
-	items := []imap.FetchItem{section.FetchItem()}
-	imapw.handleFetchMessages(msg, &msg.Uids, items)
-}
-
 func (imapw *IMAPWorker) handleFetchMessageBodyPart(
 	msg *types.FetchMessageBodyPart) {
 
@@ -42,6 +33,15 @@ func (imapw *IMAPWorker) handleFetchMessageBodyPart(
 	imapw.handleFetchMessages(msg, &uids, items)
 }
 
+func (imapw *IMAPWorker) handleFetchFullMessages(
+	msg *types.FetchFullMessages) {
+
+	imapw.worker.Logger.Printf("Fetching full messages")
+	section := &imap.BodySectionName{}
+	items := []imap.FetchItem{section.FetchItem()}
+	imapw.handleFetchMessages(msg, &msg.Uids, items)
+}
+
 func (imapw *IMAPWorker) handleFetchMessages(
 	msg types.WorkerMessage, uids *imap.SeqSet, items []imap.FetchItem) {
 
@@ -64,7 +64,7 @@ func (imapw *IMAPWorker) handleFetchMessages(
 						InternalDate:  _msg.InternalDate,
 						Uid:           _msg.Uid,
 					}, nil)
-				case *types.FetchMessageBodies:
+				case *types.FetchFullMessages:
 					reader := _msg.GetBody(section)
 					imapw.worker.PostMessage(&types.MessageBody{
 						Reader: reader,
diff --git a/worker/imap/worker.go b/worker/imap/worker.go
index a11d82b..4354ab9 100644
--- a/worker/imap/worker.go
+++ b/worker/imap/worker.go
@@ -158,10 +158,10 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error {
 		w.handleFetchDirectoryContents(msg)
 	case *types.FetchMessageHeaders:
 		w.handleFetchMessageHeaders(msg)
-	case *types.FetchMessageBodies:
-		w.handleFetchMessageBodies(msg)
 	case *types.FetchMessageBodyPart:
 		w.handleFetchMessageBodyPart(msg)
+	case *types.FetchFullMessages:
+		w.handleFetchFullMessages(msg)
 	case *types.DeleteMessages:
 		w.handleDeleteMessages(msg)
 	default:
diff --git a/worker/types/messages.go b/worker/types/messages.go
index 803bb98..b17d53d 100644
--- a/worker/types/messages.go
+++ b/worker/types/messages.go
@@ -81,7 +81,7 @@ type FetchMessageHeaders struct {
 	Uids imap.SeqSet
 }
 
-type FetchMessageBodies struct {
+type FetchFullMessages struct {
 	Message
 	Uids imap.SeqSet
 }
@@ -134,7 +134,7 @@ type MessageInfo struct {
 	Uid           uint32
 }
 
-type MessageBody struct {
+type FullMessage struct {
 	Message
 	Reader io.Reader
 	Uid    uint32