nsjabber procedure documentation

Index of all the tcl functions related to the Jabber Client for the AOLServer

All functions return 0 if the client is connected to the Jabber server,
and -1 if the client is not connected to the Jabber Server.
In the second case no action at all takes places.

Index

jb_getconnstate

jb_addbuddy

jb_addtransbuddy

jb_chat

jb_message

jb_login

jb_logout

jb_remove

jb_removebuddy

jb_removetransbuddy

jb_sendxml

jb_invite

jb_activeroommembers

jb_activeconferencerooms

jb_delconferenceroom

jb_createconferenceroom

jb_new_subject

jb_append_subject

jb_spellcheck

jb_get_transport_url_from_id




jb_getconnstate

Overview

Check if the Aolserver is online at the Jabber Server

Syntax

jb_addbuddy

Description

jb_getconnstate Takes no parameters, returns 0 if the Aolserver is online or -1 if not.




jb_addbuddy

Overview

Adding buddy('s) to a user roster.

Syntax

[1] jb_addbuddy screenname screenname ...

Description

[1]jb_addbuddy This function is not limited to the amount of parameters,each parameter must be a valid sreenname (a screenname is a jid with out the Server portion). The first parameter has to be the screenname of the user who wants to add someones jid to his roster (e.g. the one who is triggering this function), all other parameters are the screennames to be added to the firsts roster. If a screenname contains invalid charakters this function returns an error, if a screenname is spelled corectly but is not valid the function will not return an error and no action to this specific screenname takes place, but it will still apear in all valid screennames rosters.

Syntax

[2]jb_addbuddy list1 list2 .... listn

Description

[2]jb_addbuddy works like [1]jb_addbuddy except that it gets past lists instaed of simple variables. A list consists of :

IndexValueDescription
1screenThe screenname of a user
2groupThe (roster)group the jid should be added to.Defaults to "acs"
3nameThe name to be displayed in the roster/chat.Defaults to screen.Requiers a group specified in index 2.





jb_addtransbuddy

Overview

Adding buddy from other IM Systems to the Roster of the Web Server Client to track their presence.

Syntax

[1] jb_addtransbuddy screenname group Transport id

Description

[1]jb_addtransbuddy This function takes three parameters the first is a Screenname from any IM System that is available, the second is the ID of the IM System (transport) to wich the screenname belongs.You can find out wich ID a transport uses by calling the function jb_get_transport_id_from_symbol $symbol, where symbol is used in the db to identify a service (or transport in jabber terms) (aim ,msn , jabber , etc.)).





jb_chat

Overview

Start a chat between two users.

Syntax

jb_chat screenname screenname

Description

jb_chat This function takes two parameters, both are screennames (a screenname is a jid with out the Server portion) , it will start a chat between the specified users. Even if both are offline they recive at least a "Hello" and all masseges send, when they go online the next time.If a screenname contains invalid charakters this function returns an error.

NOTE

Nothing





jb_login

Overview

Log the AOLServer Client into the Jabber IM Server

Syntax

success jb_login void

Description

jb_loginThis function takes no parameters, it logs the community client into the Jabber Server. A call to this function should be done on AOLServer startup, or after a restart of the Jabber Server. It returns (success) 0 on a successfull login and -1 otherwise.

NOTE

A automatic login on AOLServer startup is in work but not implemented yet





jb_logout

Overview

Log the AOLServer Client out of the Jabber IM Server

Syntax

jb_logout void

Description

jb_logout This function takes no parameters, it logs the community client out of the Jabber Server.

NOTE

This function is not password protected any tcl programmer can call it.





jb_message

Overview

Sending a message.

Syntax

jb_message jid message

Description

jb_message This funktion takes two parameters, the first is a full jid (of any valid Jabber Server including its transports) , the second is the message String. This function dosen't return any errors yet.





jb_remove

Overview

Unregistering a user at the Jabber Server.

Syntax

jb_remove screenname

Description

jb_remove This function takes one parameter, the srcreenname of the user to be unregistered.If a screenname contains invalid charakters this function returns an error. The screenname and all information related to it, will be removed from the community db backend , as well as the Jabber acount relaeted to the screenname. The user will be imidiatly disconected from the Jabber server.

NOTE

We work on a version of this function that returns a un-/successfull unregistration information.





jb_removebuddy

Overview

Removing buddy('s) from a user roster.

Syntax

[1] jb_removebuddy screenname screenname ...

Description

[1] jb_removebudy This function is not limited to the amount of parameters,each parameter must be a valid sreenname (a screenname is a jid with out the Server portion). The first parameter has to be the screenname of the user who wants to remove someones jid from his roster (e.g. the one who is triggering this function), all other parameters are the screennames to be removed from the firsts roster. If a screenname contains invalid charakters this function returns an error, if a screenname is spelled corectly but is not valid the function will not return an error and no action to this specific screenname takes place. The roster held in the users prefered Jabber Client (if the user is online) will not change till the user does a relogin.

Syntax

[2] jb_removebuddy list1 list2 .... listn

Description

[2]jb_removebuddy works like [1]jb_removebuddy exept that it gets past lists instaed of simple variables. A list consists of :

IndexValueDescription
1screenThe screenname of a user
2groupThe (roster)group the jid should be removed from .Defaults to "acs"





jb_removetransbuddy

Overview

Removing a buddy from other IM Systems, from the Roster of the Web Server Client to stop tracking their presence.

Syntax

jb_removetransbuddy screenname Transport_ID

Description

jb_removetransbuddy This function takes two parameters the first is a Screenname from any IM System that is available, the second is the Transport ID of the IM System (transport) to wich the screenname belongs.





jb_sendxml

Overview

Sending raw XML.For developers to test new XML.

Syntax

jb_sendxml XML

Description

jb_sendxml This function takes one parameter that consists of serialised XML (Serialised XML is a string of XML - Tag's). It is used by developers only to test new XML , the XML will be directly send to the Jabber server without any tests. If the Jabber server does not accept the XML as valid Jabber XML it will disconect the client.

NOTE

This function is not password protected any tcl programmer can call it. It is also possible that the Jabber server disconnects the client, if bad XML is passed.





jb_get_transport_url_from_id

Overview

Retrieving the URL of a transport from the local Jabber Server

Syntax

URL jb_get_transport_url_from_id ID

Description

jb_get_transport_url_from_id This function takes one parameter, the ID of a transport. It returns the URL this Transport uses.It is manly used to form JID's . Example:

db_select get_jabber_information "SELECT screen , service FROM jb_screens WHERE user_id = :user_id"

set users_jid "$screen@[jb_get_transport_url_from_id [jb_get_transport_id_from_symbol $service]]"

jb_message $users_jid "This is your jid $users_jid"

This view lines of code retrieve the abstract stored user information from the db. The screen name from one IM System and a Identifier for the service the screen name belongs to. The ns_jabber module stores all URL's of the local Jabber Server in an array (not tcl array) , it needs a correct id to identify the correct transport. The function jb_get_transport_id_from_symbol is written in tcl , it converts the symbol (easy to read) used to identify a service (transport in jabber terms) in your System into the correct transport id.





jb_spellcheck

Overview

Tests if a screen name is spelled corectly

Syntax

int jb_spellcheck screen

Description

jb_spellcheck This function takes one parameter, a screen that should be checked for illigal Charackters. It returns 0 if no illigal charackters are used, and -1 if the screen contains illigal charackters.





jb_createconferenceroom

Overview

Start recording a chat from the local Jabber Server Conference service.

Syntax

int jb_createconferenceroom RoomName user_id Threadname creator_jid short description

Description

jb_createconferenceroom This function takes a RoomName the user_id of the creator , a topic name Threadname (which will only be used in case it is the first time this room is recorded), the creator_jid and a short description as parameters. This function will start to record the chat in the conference Room RoomName , if this Room hasn't been opened when it is called , it opens up this Room at the local Jabber Conference Service.
If it is the first time a Chat in this Room is Recorded , it will also create a new entry in the table jb_conference_rooms (or an abstraction) and a new entry in the table jb_conference_room_threads (or an abstraction) . In case a Chat from this Room has been recorded before , it will create a new entry in the table jb_conference_room_threads (or an abstraction) only. In case of an error it returns -1 and 0 otherwise.





jb_delconferenceroom

Overview

Stop recording a chat from the local Jabber Server Conference service.

Syntax

int jb_delconferenceroom RoomName

Description

jb_delconferenceroom This function takes a RoomName as parameter, a call to this function will stop the recording of the Chat in the Room RoomName. The recording of this Room can be restarted by a call to jb_createconferenceroom. This function returns -1 on an error and 0 otherwise.





jb_new_subject

Overview

Sending a new subject (Topic) to a Room at the Jabber Server Conference service.

Syntax

int jb_new_subject RoomName New_Thread_name explaination_of_Thread_Name [optional existing thread_id]

Description

jb_new_subject This function takes a RoomName New_Thread_name explaination_of_Thread_Name and optional an existing thread_idas parameter, a call to this function will stop the recording of the current subject in the Room RoomName. The recording of this Room will go on, but every thing will eather be stored with the passed in thread_id (to append the discussion of an old subject) in this case New_Thread_name and explaination_of_Thread_Name will NOT overwrite the old values, or with a internaly new created thread_id if none is passed in. In the second case New_Thread_name and explaination_of_Thread_Name will be written into the db. (See SQL doc,check table jb_conference_room_threads for details). This function returns -1 on an error and 0 otherwise.





jb_new_subject

Overview

Sending a old subject (Topic) to a Room at the Jabber Server Conference service to append the recordings of this subject, incase the Room is not active it will be restarted automaticly.

Syntax

int jb_new_subject RoomName New_Thread_name explaination_of_Thread_Name existing_thread_id

Description

jb_new_subject This function takes a RoomName New_Thread_name explaination_of_Thread_Name and an existing thread_id as parameter, a call to this function will stop the recording of the current subject in the Room RoomName. The recording of this Room will go on, but every thing will eather be stored with the passed in thread_id (to append the discussion of an old subject) in this case New_Thread_name and explaination_of_Thread_Name will NOT overwrite the old values, in case the Room is not active at the moment it will be restated. This function returns -1 on an error and 0 otherwise.





jb_activeconferencerooms

Overview

Returns a ns_set with all Conference Rooms that get recorded at the moment.

Syntax

ns_set id jb_delconferenceroom

Description

jb_activeconferencerooms This function is called with no parameters , it returns a ns_set . This ns_set has the names of the active Rooms as its keys , and ns_set's as values. The ns_set's store more detailed information about the room .
Example:

set active_rooms [jb_activeconferencerooms]

if {$active_rooms != -1} { set room_count [ns_set size $active_rooms] }

set html "<TABLE> <tr> <th> Room Name </th> <th> Current Topic </th></tr>"

for {set i 0} {i < $row_count} {incr i}{

append html "<tr><td>[ns_set key $active_rooms $i] </td><td>[ns_set value [ns_set value $active_rooms $i ] 1]</td></tr>"

}

append html "</table>"

This example calls jb_activeconferencerooms and stores the ns_set ID in the variable active_rooms, it checks if the function hasent returned -1 (no error). Then it reads the size of the ns_set into the variable row_count . Then in a for loop , it loops through the returned ns_set putting it's keys in the first column of the table , and in the second column it first reads the ns_set ID from the keys (roomNames) value pair , and then from this ns_set it reads the value from position 1 (wich holds the topic of this room).

Structur of the ns_set returned by jb_activeconferencerooms
KeyValue
Room Ans_set_id A
Room Bns_set_id B

Structure of the ns_set from a value of a returned ns_set:
Key Value Position
name Room Name0
subject Current Topic 1
roomid Room Id which identifies the Room in the db. 2
threadid Thread Id which identifies the current Topic in the db 3





jb_activeroommembers

Overview

Returns a ns_set with all Members from a Conference Room that gets recorded at the moment.

Syntax

ns_set id jb_activeroommembers RoomName

Description

jb_activroommembers This function is called with a RoomName as parameter, it returns a ns_set . This ns_set has the current nicks (nick inside a Room) of the Members who are inside this Room as its keys , and ns_set's as values. The ns_set's store more detailed information about the Member .

Structur of the ns_set returned by jb_activeroommembers:
KeyValue
NickName1 ns_set_id 1
NickName2ns_set_id 2

Structure of the ns_set from a value of a returned ns_set:
Key Value Position
nick AnyNickName0
jidThe jid of this Member 1
statusThe status of this Member (online,away,etc.)2
user_idThe acs user_id. (if available)3





jb_invite

Overview

Sends a Invite to a Conference Room , to a user.

Syntax

int jb_invite Jid RoomName Topic A_short_message Type

Description

jb_invite This function is called with a Jid to send the invite to, the RoomName to which the recipient should be invited to, the Topic that will be discused in the room, a A short message that lets the recipient know why he got invited , and the Type of the invite. The type can be 1 or 2 , standing for the versions v.1 and v.2. Right know v.1 is the prefered way to invite some one to a Conference Room, most Jabber Clients support this version , the Room RoomName doesn't needs to be recorded to send an invite to this Room. While v.2 is more power full but not all Jabber Clients support this version jet, the Room RoomName has to be recorded to send an invite to this Room.





jb_new_subject

Overview

Sends a new subject (Topic) to a Conference Room .

Syntax

int jb_new_subject RoomName TopicName Description_of_the_new_Topic

Description

jb_new_subject This function is called with a RoomName to send the subject change to, the TopicName to change to and a Discription of the new topic. This function worcks only on Rooms that get recorded at the moment.




Back to design page


Author: Bjoern Kiesbye

Last modified: January 10 2003

Copyright Sussdorff & Roy 2001