Previous Up Next

Chapter 6  MLChat

6.1  Introduction

MLChat is a simple chat application. It does not use any server, like usual chat applications, making it possible to use on a local network. It supports a conference mode to have a discussion with more than one person. The communication protocol is a text one, so you can communicate with MLChat from applications not written in OCaml.

At last, MLChat comes with a library which can be used to add chat in other OCaml applications. The chat plug-in for Cameleon (see ??) uses this library.

6.2  Configuration

By default, MLChat uses the file ~/.mlchatrc, but you can specify a different configuration file to use with the -c option of the mlchat command.

The configuration window of MLChat is accessed through the File/Options menu. You can specify your id, the port to listen to, the colors, the people you know about, ...

Some of these options can be changed on the command line. Try mlchat -h to get a list of the available options.

6.3  Using MLChat

You launch MLChat with the following command:
mlchat
The main window appears, displaying the list of people you know about. The first time you launch MLChat (or you specify a new configuration file), this list is empty.

You should first set some options, using File/Options. Set your id and some other options. You can add people to your list in the ``People'' tab or with the File/Add people menu.

Some people can connect to you if they know your host and port. If these people are already in your list, they will appear as connected. If they don't they'll appear in your list as connected but also as temporary people, i.e. people which will disappear next time you launch MLChat. To add these people permanently to your list, use the File/Toggle temp flag for selected people menu. You can also change a permanent friend to a temporary friend with this command.

You can remove people (temporary or not) from your list with File/Remove selected people.

To discuss with one person of your list, select the person and use the File/Open dialog menu. You can also double-click on a person. A chat window appears. You type your message in the text widget at the bottom. Hitting the Enter key sends your message. The text widget at the top of the window shows the messages sent and received. The title of the window indicates the person you're chatting with.

To create a chat room, just select various people in the list and use the File/Open dialog menu. You're prompted for a chat room name, then the chat window appears, with an additionnal button to see who's in the room. The messages you send in this window are sent to all the people in the room.

You can quickly close a dialog window with the CTRL-C shortcut.

When someone sends you a message and your dialog window for this person is closed, the window is automatically open. Meanwhile, if the person sending the message is not in your list of permanent people, the window will pop up only if you set the ``popup all'' option to true in the configuration window.

People are identified by their hostname and port. So you may have two people in your list referencing to the same person, if you have two different host names for this person.

6.4  The mlchat_say utility

MLChat comes with mlchat_say, a command line utility which can be used to send messages to a MLChat application. Usage:
mlchat_say [-h <host>] [-p <port>] [-i <id>] <message>. You can use it to be warned about events, for example when you receive an e-mail.

6.5  The Mlchat library

Here is the interface of the Mlchat library.
Previous Up Next