Converse converse.js

Class: Handler

Handler()

PrivateConstructor: Strophe.Handler Create and initialize a new Strophe.Handler.

Parameters: (Function) handler - A function to be executed when the handler is run. (String) ns - The namespace to match. (String) name - The element name to match. (String) type - The element type to match. (String) id - The element id attribute to match. (String) from - The element from attribute to match. (Object) options - Handler options

Returns: A new Strophe.Handler object.

Constructor

new Handler()

Source:

Methods

getNamespace()

PrivateFunction: getNamespace Returns the XML namespace attribute on an element. If ignoreNamespaceFragment was passed in for this handler, then the URL fragment will be stripped.

Parameters: (XMLElement) elem - The XML element with the namespace.

Returns: The namespace, with optionally the fragment stripped.

Source:

isMatch()

PrivateFunction: isMatch Tests if a stanza matches the Strophe.Handler.

Parameters: (XMLElement) elem - The XML element to test.

Returns: true if the stanza matches and false otherwise.

Source:

namespaceMatch()

PrivateFunction: namespaceMatch Tests if a stanza matches the namespace set for this Strophe.Handler.

Parameters: (XMLElement) elem - The XML element to test.

Returns: true if the stanza matches and false otherwise.

Source:

run()

PrivateFunction: run Run the callback on a matching stanza.

Parameters: (XMLElement) elem - The DOM element that triggered the Strophe.Handler.

Returns: A boolean indicating if the handler should remain active.

Source:

toString()

PrivateFunction: toString Get a String representation of the Strophe.Handler object.

Returns: A String.

Source: