Sluift

This document describes the API of the sluift module.

The entry points of Sluift are in the sluift module, described below.

sluift module

This module provides methods for XMPP communication.

The main entry point of this module is the new_client method, which creates a new client for communicating with an XMPP server.

Fields

Methods

copy

Perform a shallow copy of object.

Parameters

from_xml

Convert a raw XML string into a structured representation.

Parameters

get_help

Retrieves the help information from target.

Returns a table with the following fields:

Parameters

help

Prints the help of target.

target can be any object. When target is a string, prints the help of the class with the given name.

Parameters

hexify

Convert binary data into hexadecimal format.

Parameters

new_client

Creates a new client.

Returns a Client object.

Parameters

new_uuid

Generates a new UUID

sha1

Compute the SHA–1 hash of given data

Parameters

sleep

Sleeps for the given time.

Parameters

to_xml

Convert a structured element into XML.

Parameters

tprint

Pretty-print a table

Parameters

unhexify

Convert hexadecimal data into binary data.

Parameters

Client class

Client interface

Methods

add_contact

Add a contact to the contact list.

Parameters

Options

async_connect

Connect to the server asynchronously.

This method immediately returns.

Parameters

Options

cancel_subscription

Cancel the subscription of a contact.

Parameters

confirm_subscription

Confirm subscription of a contact.

Parameters

connect

Connect to the server.

This method blocks until the connection has been established.

Parameters

Options

disconnect

Disconnect from the server

Parameters

events

Returns an iterator over all events.

This function blocks until timeout is reached (or blocks forever if it is omitted).

Parameters

Options

for_each_event

Calls f for each event.

Parameters

Options

for_each_message

Call f for all events of type message.

Parameters

Options

for_each_presence

Call f for all events of type presence.

Parameters

Options

for_each_pubsub_event

Call f for all events of type pubsub.

Parameters

Options

get

Sends a get query.

Parameters

Options

get_contacts

Returns a table of all the contacts in the contact list.

Parameters

get_disco_items

Sends a get query of type disco_items. Apart from the options below, all top level elements of disco_items can be passed.

Parameters

Options

get_dom

Sends a get query of type dom. Apart from the options below, all top level elements of dom can be passed.

Parameters

Options

get_next_event

Returns the next event.

Parameters

Options

get_next_message

Get the next event of type message.

Parameters

Options

get_next_presence

Get the next event of type presence.

Parameters

Options

get_next_pubsub_event

Get the next event of type pubsub.

Parameters

Options

get_software_version

Sends a get query of type software_version. Apart from the options below, all top level elements of software_version can be passed.

Parameters

Options

get_vcard

Sends a get query of type vcard. Apart from the options below, all top level elements of vcard can be passed.

Parameters

Options

get_xml

Sends a get query of type xml. Apart from the options below, all top level elements of xml can be passed.

Parameters

Options

is_connected

Checks whether this client is still connected.

Returns a boolean.

Parameters

jid

Returns the JID of this client

Parameters

messages

Returns an iterator over all events of type message.

Parameters

Options

process_events

Process all pending events

Parameters

pubsub

Returns a PubSub object for communicating with the PubSub service at jid.

Parameters

pubsub_events

Returns an iterator over all events of type pubsub.

Parameters

Options

query_pubsub

remove_contact

Remove a contact from the contact list.

Parameters

send

Sends a raw string

Parameters

send_message

Send a message.

Parameters

Options

send_presence

Send presence.

Parameters

Options

set

Sends a set query.

Parameters

Options

set_caps_node

Sets the caps node of this client

Parameters

set_command

Sends a set query of type command. Apart from the options below, all top level elements of command can be passed.

Parameters

Options

set_disco_info

Sets the service discovery information for this client

Parameters

set_options

Sets the connection options of this client.

Parameters

Options

set_version

Sets the published version of this client.

Parameters

Options

wait_connected

Block until the client is connected.

This is useful after an async_connect.

Parameters

PubSub class

Interface to communicate with a PubSub service

Methods

events

for_each_event

get_affiliations

get_default_configuration

get_default_subscription_options

get_next_event

get_subscriptions

list_nodes

node

PubSubNode class

Interface to communicate with a PubSub node on a service

Methods

create

delete

events

for_each_event

get_affiliations

get_configuration

get_default_subscription_options

get_item

get_items

get_next_event

get_owner_affiliations

get_owner_subscriptions

get_subscription_options

get_subscriptions

list_items

publish

purge

retract

set_configuration

set_owner_affiliations

subscribe

unsubscribe

PubSubRetract class

This table has the following fields:

PubSubAffiliations class

This table has the following fields:

PubSubPublish class

This table has the following fields:

PubSubItems class

This table has the following fields:

PubSubOwnerRedirect class

This table has the following fields:

PubSubEventRedirect class

This table has the following fields:

PubSubConfigure class

This table has the following fields:

PubSubEventDisassociate class

This table has the following fields:

PubSubOwnerAffiliations class

This table has the following fields:

PubSubOwnerConfigure class

This table has the following fields:

UserLocation class

This table has the following fields:

PubSubSubscribeOptions class

This table has the following fields:

PubSubOwnerSubscriptions class

This table has the following fields:

PubSubDefault class

This table has the following fields:

PubSubEventCollection class

This table has the following fields:

PubSubEventSubscription class

This table has the following fields:

PubSubEventRetract class

This table has the following fields:

PubSubItem class

This table has the following fields:

PubSubUnsubscribe class

This table has the following fields:

PubSubEventDelete class

This table has the following fields:

PubSubCreate class

This table has the following fields:

PubSubOwnerPurge class

This table has the following fields:

PubSubEventItems class

This table has the following fields:

PubSubOptions class

This table has the following fields:

PubSubEventItem class

This table has the following fields:

PubSubOwnerSubscription class

This table has the following fields:

PubSubOwnerAffiliation class

This table has the following fields:

PubSubEventPurge class

This table has the following fields:

PubSubAffiliation class

This table has the following fields:

PubSubSubscribe class

This table has the following fields:

PubSubOwnerDelete class

This table has the following fields:

PubSubOwnerDefault class

This table has the following fields:

PubSubSubscriptions class

This table has the following fields:

PubSubEventAssociate class

This table has the following fields:

PubSubSubscription class

This table has the following fields:

PubSubEventConfiguration class

This table has the following fields:

DiscoInfo class

Represents disco#info service discovery data.

This table has the following structure: