To contents Next section

14.26.1 Protocols.LysKOM.Session

CLASS
Protocols.LysKOM.Session

DESCRIPTION
variable user This variable contains the person that are logged in.

METHOD
Protocols.LysKOM.Session.create

SYNTAX
void create(string server)
void create(string server, mapping options)

DESCRIPTION
Initializes the session object, and opens a connection to that server.

options is a mapping of options,

([
   "login" : int|string    login as this person number
                         (get number from name)
   "create" : string       
                         create a new person and login with it
   "password" : string     send this login password
   "invisible" : int(0..1) if set, login invisible
   advanced
   "port" : int(0..65535)  server port (default is 4894)
   "whoami" : string       present as this user
                         (default is from uid/getpwent and hostname)
])

SEE ALSO
Connection

METHOD
Protocols.LysKOM.Session.create_person

SYNTAX
object create_person(string name, string password)

DESCRIPTION
Create a person, which will be logged in.

RETURNS
the new person object

METHOD
Protocols.LysKOM.Session.create_text

SYNTAX
object create_text(string subject, string body, mapping options)
object create_text(string subject, string body, mapping options, function callback, mixed ...extra)

DESCRIPTION
Creates a new text.

if "callback" are given, this function will be called when the text is created, with the text as first argument. Otherwise, the new text is returned.

options is a mapping that may contain:

([
   "recpt" : Conference|array(Conference) 
        recipient conferences
   "cc" : Conference|array(Conference)    
        cc-recipient conferences
   "bcc" : Conference|array(Conference)   
        bcc-recipient conferences *
   
   "comm_to" : Text|array(Text)           
        what text(s) is commented
   "foot_to" : Text|array(Text)           
        what text(s) is footnoted
   
   "anonymous" : int(0..1)                
        send text anonymously
])

NOTE
The above marked with a '*' is only available on a protocol 10 server. A LysKOM error will be thrown if the call fails.

SEE ALSO
Conference.create_text, Text.comment and Text.footnote

METHOD
Protocols.LysKOM.Session.login

SYNTAX
object login(int user_no, string password)
object login(int user_no, string password, int invisible)

DESCRIPTION
Performs a login. Returns 1 on success or throws a lyskom error.

RETURNS
the called object

METHOD
Protocols.LysKOM.Session.logout

SYNTAX
object logout()

DESCRIPTION
Logouts from the server.

RETURNS
the called object

METHOD
Protocols.LysKOM.Session.send_message

SYNTAX
object send_message(string message,  mapping options)

DESCRIPTION
Sends a message.

options is a mapping that may contain:

([
   "recpt" : Conference recipient conference
])

METHOD
Protocols.LysKOM.Session.try_complete_person

SYNTAX
array(object) try_complete_person(string orig)

DESCRIPTION
Runs a LysKOM completion on the given string, returning an array of confzinfos of the match.

To contents Next section