diff options
Diffstat (limited to 'src/imap/flow.rs')
-rw-r--r-- | src/imap/flow.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/imap/flow.rs b/src/imap/flow.rs index 303b498..0adf1f0 100644 --- a/src/imap/flow.rs +++ b/src/imap/flow.rs @@ -41,8 +41,14 @@ impl State { match (self, tr) { (s, Transition::None) => Ok(s), (State::NotAuthenticated, Transition::Authenticate(u)) => Ok(State::Authenticated(u)), - (State::Authenticated(u), Transition::Select(m)) => Ok(State::Selected(u, m)), - (State::Authenticated(u), Transition::Examine(m)) => Ok(State::Examined(u, m)), + ( + State::Authenticated(u) | State::Selected(u, _) | State::Examined(u, _), + Transition::Select(m), + ) => Ok(State::Selected(u, m)), + ( + State::Authenticated(u) | State::Selected(u, _) | State::Examined(u, _), + Transition::Examine(m), + ) => Ok(State::Examined(u, m)), (State::Selected(u, _), Transition::Unselect) => Ok(State::Authenticated(u)), (State::Examined(u, _), Transition::Unselect) => Ok(State::Authenticated(u)), (_, Transition::Logout) => Ok(State::Logout), |