Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

API: Cache

bard edited this page Sep 13, 2010 · 2 revisions

XMPP.cache.fetch

Deprecated, will be replaced by XMPP.cache.all.


    XMPP.cache.fetch(pattern);

Grabs all items from the cache matching the pattern argument.

XMPP.cache.find

Deprecated, will be replaced by XMPP.cache.first.


    XMPP.cache.find(pattern);

Operates the same as XMPP.cache.fetch() except that it grabs only the first wrapped object of the array returned by that method.

XMPP.cache.first


    XMPP.cache.first(query);

Returns an object containing the following properties:

  • stanza : A single cached stanza as E4X XML, found by the xpath query expression
  • direction : Indicates whether the stanza was being sent ‘in’ or ‘out’ (relative to the client)
  • account : Indicates the user’s JID
  • [DEPRECATED] a session property with a name subproperty. Use account instead.

query can be the XPath expression as a string or a “Query” object (instantiable by XMPP.q()).

XMPP.cache.all


    XMPP.cache.all(query);

XMPP.cache.all() functions the same as XMPP.cache.first() except that instead of returning a single wrapped object representing one cached stanza, all() will return an array including wrapped objects for each stanza returned by the query.