The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::PSYC::Client

DESCRIPTION

Net::PSYC::Client offers an easy-to-implement interface to build chat clients using the PSYC protocol.

SYNOPSIS

    use Net::PSYC::Client;
    

PERL API

psycLink( $uni )

Tries to link to (login to) the given $unl. A password if necessary has to be returned by main::getPassword().

psycUnlink()

Performs a log-out of the PSYC server.

register_new( $sub )

Vielleicht register_person( $class ) und register_room( $class ) ...

register_context( $uni, $obj )

Register an object to get all conference with the given UNI. Depending on whether UNI represents a person or a chatroom the object has to implement different interfaces:

CLIENT INTERFACE

In order to make it easy to implement chat-clients based on the PSYC protocol there are only a few requirements to be met by the actual user interface.

Default functions (both Person and Chatoom conference)

$obj->notice( $text )

Different notices and status information that simply needs to be printed to the user.

Chatroom

In addition to notice every object representing a chatroom has to have the following methods

$room->message( $nick, $text, $speakaction )

A public message from $nick in the current chatroom. If $text is an empty string the message is just an action. (For instance Jimmy likes blueberry muffins. would be $room->message("Jimmy", "", "likes blueberry muffins.") )

$room->Members( \%members )

\%members is a reference to a hash containing nicknames and psyc addresses of all users currently in the room represented by $room. The structure of the hash is { nickname => psyc address }.

$room->topic( $topic, $nick )

Whenever the topic in this chatroom is changed this method is called with the new $topic and the $nick who changed it if available.

$room->history( $timestamp, $text )

Messages that have not been said recently but should be considered historical. $timestamp represents this time in the past in seconds since epoch. Of course this depends on the time the PSYC server considers to be epoch.

Person

In addtion to notice every object representing a private chat has to have following methods

$person->message( $nick, $text, $speakaction )

A private message coming from the user represented by $person. As for message in room context $text being an empty string means that the message is an action.

SEE ALSO

Net::PSYC, Net::PSYC::Event, http://psyc.pages.de/

AUTHORS

Arne Gödeke <el@goodadvice.pages.de>

COPYRIGHT

Copyright (c) 2004 Arne Gödeke. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.