thunderbird / thunderbird-android

K-9 Mail – Open Source Email App for Android
https://k9mail.app/
Apache License 2.0
9.47k stars 2.42k forks source link

IMAP: Remove unnecessary calls to `RealImapFolder.open()` #7793

Closed cketti closed 1 week ago

cketti commented 2 weeks ago

Change methods in RealImapFolder that perform a remote operation to never call open() themselves. It's up to the caller to make sure those methods are called on an open folder.

This doesn't significantly change the behavior of the app. In some cases we now avoid calling open() on an already open RealImapFolder, which triggered sending a NOOP command. So it removes a tiny bit of unnecessary network I/O, but not a lot.

cketti commented 1 week ago

I'll change it to requireOpen in a follow-up PR were the method also checks the required open mode. Some methods only require read access, others read-write access.