Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]

Modules

ADT
Database
GTK2
GUI
IP
PiJAX
Public
Sql
Stdio
Subversion
System
Tools
Xosd
lua
v4l2
wx

Recent Changes

Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0

Popular Downloads

Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48


Pike Module Reference:

module version 1.2, prepared

  MODULE Public
Modules
Protocols

  MODULE Public.Protocols
Modules
Jabber

  MODULE Public.Protocols.Jabber
Classes
client

Description

A module for communicating using the Jabber Protocol


Constants

constant Public.Protocols.Jabber.__version
constant Public.Protocols.Jabber.__author


Constant PRESENCE_AWAY

constant Public.Protocols.Jabber.PRESENCE_AWAY


Constant PRESENCE_CHAT

constant Public.Protocols.Jabber.PRESENCE_CHAT


Constant PRESENCE_DND

constant Public.Protocols.Jabber.PRESENCE_DND


Constant PRESENCE_XA

constant Public.Protocols.Jabber.PRESENCE_XA


Constant PRESENCE_UNAVAILABLE

constant Public.Protocols.Jabber.PRESENCE_UNAVAILABLE

  CLASS Public.Protocols.Jabber.client
Methods
authenticate()
clear_disconnect_callback()
clear_message_callback()
clear_presence_callback()
clear_roster_callback()
clear_subscribe_callback()
clear_subscribed_callback()
clear_unsubscribe_callback()
clear_unsubscribed_callback()
create()
disconnect()
get_client_name()
get_messages()
get_new_session()
request_remove()
request_roster()
request_subscribe()
respond_subscribed()
respond_unsubscribed()
send_message()
set_background_mode()
set_client_name()
set_disconnect_callback()
set_message_callback()
set_presence()
set_presence_callback()
set_roster_callback()
set_subscribe_callback()
set_subscribed_callback()
set_unsubscribe_callback()
set_unsubscribed_callback()
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)

gotpike.org | Copyright © 2004 - 2019 | Pike is a trademark of Department of Computer and Information Science, Linköping University