Rename Session.Do to Session.DoIMAP
This commit is contained in:
parent
e93346ffa9
commit
d01c85616a
2 changed files with 6 additions and 6 deletions
|
@ -43,7 +43,7 @@ func handleGetMailbox(ectx echo.Context) error {
|
||||||
var mailboxes []*imap.MailboxInfo
|
var mailboxes []*imap.MailboxInfo
|
||||||
var msgs []imapMessage
|
var msgs []imapMessage
|
||||||
var mbox *imap.MailboxStatus
|
var mbox *imap.MailboxStatus
|
||||||
err = ctx.Session.Do(func(c *imapclient.Client) error {
|
err = ctx.Session.DoIMAP(func(c *imapclient.Client) error {
|
||||||
var err error
|
var err error
|
||||||
if mailboxes, err = listMailboxes(c); err != nil {
|
if mailboxes, err = listMailboxes(c); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -128,7 +128,7 @@ func handleGetPart(ctx *koushin.Context, raw bool) error {
|
||||||
var msg *imapMessage
|
var msg *imapMessage
|
||||||
var part *message.Entity
|
var part *message.Entity
|
||||||
var mbox *imap.MailboxStatus
|
var mbox *imap.MailboxStatus
|
||||||
err = ctx.Session.Do(func(c *imapclient.Client) error {
|
err = ctx.Session.DoIMAP(func(c *imapclient.Client) error {
|
||||||
var err error
|
var err error
|
||||||
msg, part, err = getMessagePart(c, mboxName, uid, partPath)
|
msg, part, err = getMessagePart(c, mboxName, uid, partPath)
|
||||||
mbox = c.Mailbox()
|
mbox = c.Mailbox()
|
||||||
|
@ -208,7 +208,7 @@ func handleCompose(ectx echo.Context) error {
|
||||||
|
|
||||||
var inReplyTo *imapMessage
|
var inReplyTo *imapMessage
|
||||||
var part *message.Entity
|
var part *message.Entity
|
||||||
err = ctx.Session.Do(func(c *imapclient.Client) error {
|
err = ctx.Session.DoIMAP(func(c *imapclient.Client) error {
|
||||||
var err error
|
var err error
|
||||||
inReplyTo, part, err = getMessagePart(c, mboxName, uid, partPath)
|
inReplyTo, part, err = getMessagePart(c, mboxName, uid, partPath)
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -58,9 +58,9 @@ func (s *Session) Username() string {
|
||||||
return s.username
|
return s.username
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes an IMAP operation on this session. The IMAP client can only be
|
// DoIMAP executes an IMAP operation on this session. The IMAP client can only
|
||||||
// used from inside f.
|
// be used from inside f.
|
||||||
func (s *Session) Do(f func(*imapclient.Client) error) error {
|
func (s *Session) DoIMAP(f func(*imapclient.Client) error) error {
|
||||||
s.locker.Lock()
|
s.locker.Lock()
|
||||||
defer s.locker.Unlock()
|
defer s.locker.Unlock()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue