Skip to content

Commit

Permalink
✨ Cache server capabilities; add #capable?(name)
Browse files Browse the repository at this point in the history
Updated methods:
* `#initialize` - save capabilities in `OK` or `PREAUTH` greeting
* `#capability` - always update saved capabilities
* `#starttls` - always clear capabilities after tagged OK response
* `#authenticate` - clear capabilities or update from tagged OK response
* `#login` - clear capabilities or update from tagged OK response

New methods:
* `#capable?(name)` - the primary API for discovering capabilities
* `#auth_capable?(name)` - returns whether a SASL mechanism is supported
* `#capabilities` - calls `capability` when needed
* `#capabilities_cached?` - whether capabilities are cached
* `#clear_cached_capabilities` - clears the cache

Fixes #31
  • Loading branch information
nevans committed Jul 21, 2023
1 parent e9031e1 commit d611853
Show file tree
Hide file tree
Showing 2 changed files with 428 additions and 99 deletions.
Loading

0 comments on commit d611853

Please sign in to comment.