Sash XB for Linux
Home |  Documentation  ... Contact

Using the SashXB Jabber Extension

The Jabber extension is used to send Jabber instant messages. The checkers weblication uses it to send player moves back and forth over the network in a two player game.

A Session is necessary for sending and receiving Messages and Presences (which are user status updates).

1. Sash.Jabber

Constants
readonly short MESSAGE_NORMAL

readonly short MESSAGE_ERROR
readonly short MESSAGE_CHAT
readonly short MESSAGE_GROUPCHAT
readonly short MESSAGE_HEADLINE
readonly short STATUS_UNKNOWN

readonly short STATUS_OFFLINE
readonly short STATUS_ONLINE
readonly short STATUS_CHAT
readonly short STATUS_AWAY
readonly short STATUS_XA
readonly short STATUS_DND
readonly short PRESENCE_SUBSCRIBED

readonly short PRESENCE_UNSUBSCRIBED
readonly short PRESENCE_AVAILABLE
readonly short PRESENCE_UNAVAILABLE
Constructors
Session
Creates a Jabber session.
Message
Creates a Jabber message.
Presence
Creates a Jabber presence.
RosterItem
Creates a Jabber roster item.
Properties
sashIJabberJID JID
Access the JID.
sashIJabberPresenceInfo PresenceInfo
Access the current status.

2. Sash.Jabber.Session

Event
Receiver prototype
Description
OnConnected
handler(sashIJabberSession session)
Fired when the session is connected.
OnDisconnected
handler(sashIJabberSession session)
Fired when the session is discconnected.
OnMessage
handler(sashIJabberSession session, sashIJabberMessage message)
Fired when a message is received in a session.
OnPresence
handler(sashIJabberSession session, sashIJabberPresence presence)
Fired when a presence is received in a session.

Properties
string Username
Username for a session.
string Password
Password for a session.
string Resource

readonly string JID
Jabber ID for a session.
Methods
void Connect()

void Disconnect()

void SetPresence(short status, string message)
Sets a user's presence to some status with a message.
void SendMessage(sashIJabberMessage message)
Sends a Jabber message.
void SendPresence(sashIJabberPresence presence)
Sends a Jabber presence.
void SendXML(string xml)
Sends a string.

3. Sash.Jabber.Presence

Properties
string ID

string To

string From

short Status

string StatusMsg

string Priority

short Type

Methods
void AddExtension(string xmlns string xmlelement string xml)

void GetExtension(string xmlns string xmlelement)

4. Sash.Jabber.PresenceInfo

Properties
short Status

string StatusMsg

5. Sash.Jabber.Message

Properties
string ID

string To

string From

string Subject

string Body

string Thread

short Type

Methods
void AddExtension(string xmlns string xmlelement string xml)

void GetExtension(string xmlns string xmlelement)

6. Sash.Jabber.RosterItem

Properties
string JID

string Nickname

array Groups

sashIJabberPresenceInfo Presence

array Resources

7. Sash.Jabber.JID

Methods
string GetResource(string jid)

string GetUserHost(string jid)

string GetHost(string jid)

string GetUser(string jid)


Wing Yung
Last modified: Thu Mar 21 14:53:10 EST 2002

  
© Copyright 2002, All Rights Reserved. Contact