Open nilclass opened 11 years ago
Ideally some sort of persistence mechanism should be added. The in-memory caching should be extracted into a separate file and made pluggable (eg. see Junction-caps implementation: https://github.com/Daniel15/junction-caps/blob/master/lib/cache/memory.js and https://github.com/Daniel15/junction-caps/blob/master/lib/middleware/capabilities.js) so that an alternative caching implementation could be plugged in.
I guess apps built on top of this library would have some storage mechanism anyway, so maybe the caching shouldn't happen here at all. We don't cache the roster either, so it seems a bit inconsistent.
Right now whenever you connect and receive a bunch of stanzas, that triggers a disco#info query for each that carries a caps node ( ). There is no way to deactivate that behavior.
I think there should be two things:
1) An option for "connect" to deactivate capability checks
2) A method to explicitly query capabilities for a given buddy.
The way it is implemented now, there is also no way to cache the 's "ver" attribute, which would allow re-querying capabilities only when they have changed.
@Daniel15, cc @silverbucket