- Description
a client for the Jabber protocol
- Import
-
Variable ssl_ctx
object(SSL.context) Public.Protocols.Jabber.client()->ssl_ctx
- Description
Context for SSL connections
-
Method set_client_name
void Public.Protocols.Jabber.client()->set_client_name(string c)
- Description
sets the client name to be used in the connection to the Jabber server.
defaults to "PikeJabber".
-
Method get_client_name
string Public.Protocols.Jabber.client()->get_client_name()
- Description
returns the client name in use.
-
Method set_disconnect_callback
void Public.Protocols.Jabber.client()->set_disconnect_callback(function f)
- Description
sets the function to be called when a session is disconnected.
the callback function does not receive any arguments.
-
Method set_presence_callback
void Public.Protocols.Jabber.client()->set_presence_callback(function f)
- Description
sets the function to be called when a user's precence info changes.
the callback function will receive a mapping containing the
contents of the presnece update
-
Method set_roster_callback
void Public.Protocols.Jabber.client()->set_roster_callback(function f)
- Description
sets the function to be called when the roster changes.
the callback function will receive a mapping containing the
contents of the roster change
-
Method set_message_callback
void Public.Protocols.Jabber.client()->set_message_callback(function f)
- Description
sets the function to be called when a message is received.
the callback function will receive a mapping containing the
contents of the message along with header information
-
Method set_subscribe_callback
void Public.Protocols.Jabber.client()->set_subscribe_callback(function f)
- Description
sets the function to be called when a subscribe request is received.
the callback function will receive a string containing the
Jabber ID making the request. the function should return a boolean
indicating whether the request should be accepted (true=accept)
-
Method set_unsubscribe_callback
void Public.Protocols.Jabber.client()->set_unsubscribe_callback(function f)
- Description
sets the function to be called when an unsubscribe request is received.
the callback function will receive a string containing the
Jabber ID making the request. the function should return a boolean
indicating whether the request should be accepted (true=accept)
-
Method set_subscribed_callback
void Public.Protocols.Jabber.client()->set_subscribed_callback(function f)
- Description
sets the function to be called when a subscribed notification is received.
the callback function will receive a string containing the
Jabber ID making the request.
-
Method set_unsubscribed_callback
void Public.Protocols.Jabber.client()->set_unsubscribed_callback(function f)
- Description
sets the function to be called when a unsubscribed notification is received.
the callback function will receive a string containing the
Jabber ID making the request.
-
Method clear_disconnect_callback
void Public.Protocols.Jabber.client()->clear_disconnect_callback()
- Description
clears any disconnect callback
-
Method clear_presence_callback
void Public.Protocols.Jabber.client()->clear_presence_callback()
- Description
clears any presence callback
-
Method clear_roster_callback
void Public.Protocols.Jabber.client()->clear_roster_callback()
- Description
clears any roster callback
-
Method clear_message_callback
void Public.Protocols.Jabber.client()->clear_message_callback()
- Description
clears any message callback
-
Method clear_subscribe_callback
void Public.Protocols.Jabber.client()->clear_subscribe_callback()
- Description
clears any subscribe callback
-
Method clear_unsubscribe_callback
void Public.Protocols.Jabber.client()->clear_unsubscribe_callback()
- Description
clears any unsubscribe callback
-
Method clear_subscribed_callback
void Public.Protocols.Jabber.client()->clear_subscribed_callback()
- Description
clears any subscribed notification callback
-
Method clear_unsubscribed_callback
void Public.Protocols.Jabber.client()->clear_unsubscribed_callback()
- Description
clears any unsubscribed notification callback
-
Method get_messages
array Public.Protocols.Jabber.client()->get_messages()
- Description
returns an array of messages waiting to be received.
if a message callback is being used, delivery to the incoming message
queue is disabled, though any unreceived messages will be stored
for pickup later.
-
Method create
void Public.Protocols.Jabber.client()->create(string url, void|object(SSL.context) ctx)
- Description
create a new client connection to server url, using a jabber url
- Parameter ctx
an optional context for an SSL connection to the Jabber server.
- Example
jabber://user:pass@jabberserver.fqdn
-
Method send_message
int Public.Protocols.Jabber.client()->send_message(string m, string s, string u)
- Description
send message m with subject s to user u
-
Method respond_subscribed
int Public.Protocols.Jabber.client()->respond_subscribed(string who)
-
Method respond_unsubscribed
int Public.Protocols.Jabber.client()->respond_unsubscribed(string who)
-
Method request_roster
int Public.Protocols.Jabber.client()->request_roster()
-
Method request_remove
int Public.Protocols.Jabber.client()->request_remove(string who)
-
Method request_subscribe
int Public.Protocols.Jabber.client()->request_subscribe(string who, string nick, string roster)
-
Method set_presence
int Public.Protocols.Jabber.client()->set_presence(int show, string|void status, int|void priority)
- Description
set presence of the logged in user
- Parameter show
should be one of PRESENCE_AWAY,
PRESENCE_CHAT, PRESENCE_DND or PRESENCE_XA.
- Parameter status
an optional string containing a status message
- Parameter priority
an optional priority setting (see Jabber spec for details)
- Note
we don't use the cdata in the text because some clients
don't know what to do with that. we should probably complain,
as it's perfectly valid xml.
-
Method authenticate
void Public.Protocols.Jabber.client()->authenticate(string|void u, string|void p)
- Description
right now we only do plaintext authentication.
will use user/password information gleaned from the jabber url if
authentication information is not provided.
-
Method disconnect
void Public.Protocols.Jabber.client()->disconnect()
-
Method get_new_session
void Public.Protocols.Jabber.client()->get_new_session()
-
Method set_background_mode
void Public.Protocols.Jabber.client()->set_background_mode(int i)
|