Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Fix imap #50

Merged
merged 5 commits into from
Jan 7, 2018
Merged

Fix imap #50

merged 5 commits into from
Jan 7, 2018

Conversation

galaxor
Copy link
Contributor

@galaxor galaxor commented Jan 7, 2018

These changes make it so that neutron compiles, at least, fixing #49
I'm not entirely sure I dealt with MailboxUpdate correctly, though. I haven't been able to test yet, due to possibly-unrelated reasons. But I wanted to make these changes at least available to review while I fixed my other problems.

@@ -53,7 +53,12 @@ func (b *Messages) ReadAttachment(user, id string) (att *backend.Attachment, out
return
}

att, r := parseAttachment(data.GetBody("BODY["+partId+"]"))
var bodySectionName *imap.BodySectionName
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use tabs for indentation! (you can go fmt your source code to fix it btw)

@@ -53,7 +53,12 @@ func (b *Messages) ReadAttachment(user, id string) (att *backend.Attachment, out
return
}

att, r := parseAttachment(data.GetBody("BODY["+partId+"]"))
var bodySectionName *imap.BodySectionName
bodySectionName, err = imap.ParseBodySectionName(imap.FetchItem("BODY"+partId+"]"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a [ here

@@ -151,7 +151,7 @@ func (b *conns) idle(clt *client) error {
c := clt.conn

mailbox := "INBOX"
if c.Mailbox != nil && c.Mailbox.Name != mailbox {
if c.Mailbox != nil && c.Mailbox().Name != mailbox {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c.Mailbox is never nil because it's a function. You want to check if c.Mailbox() is nil instead.

@@ -283,7 +291,7 @@ func (b *conns) selectMailbox(user, mailbox string) (err error) {
}
defer unlock()

if c.Mailbox == nil || c.Mailbox.Name != mailbox {
if c.Mailbox == nil || c.Mailbox().Name != mailbox {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, c.Mailbox() == nil.

Copy link
Owner

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

The mailbox update changes seem fine, but all of that needs testing.

@galaxor
Copy link
Contributor Author

galaxor commented Jan 7, 2018

Okay, I added some commits to address these issues and pushed them up. Do I need to do anything on github, like make a new pull request, or move some sort of pointer on this PR? Or does the pull request track the branch and I'm all set?

@emersion emersion merged commit 321511a into emersion:master Jan 7, 2018
@emersion
Copy link
Owner

emersion commented Jan 7, 2018

Thanks!

This was referenced Jan 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants