IRC and chat with Gtalk (irssi, bitlbee)

For this part we will see how to communicate with the rest of the world. We will use jabber protocol to connect to Gtalk (but several others are available, see at the end).

First, we need an application for chatting. Irssi will be our weapon of choice. At first it was aimed towards IRC users but some applications provide a tunnel to. In most Linux and BSD distribution you can find one of these : it is called bitlebee. The latest versions support now MSN.

See the xchat theme for an overview of the final result.

Setting it up

After the installation of bitlbee, a local server should have been start (otherwise, just start it with /etc/init.d/bitlbee start).

Then launch irssi. The first time, it will not connect to any server nor join any channel though. So we will connect manually to your local bitlbee :

/connect localhost 

This will display some funny message from the developper. Now register an account (for the bitlbee server) :

register yourpassword 

Connecting with OAuth

Then you can add an Gtalk account:

account add jabber youraddress@gmail.com

You can try OAuth identification with

acc gtalk set oauth on
acc gtalk on

You should have received a private message by now. Follow the link and get the confirmation code. Paste it in the window and it should connect automatically.

Connecting without OAuth

For other protocols :

account add jabber youraddress@hotmail.com msnpassword 

register bitlbeepassword
save

Configuration files

If everything is allright, your contact list should be displayed. However we want to avoid to type anything. In fact, the connection should be automatic. For that purpose, edit your configuration file in /.irssi/config. First we connect automatically to the local bitlbee server. Add some line in the server list. It should look like this :

servers = (
{ address = "eu.irc6.net"; chatnet = "IRCnet"; port = "6667"; },
{
chatnet = "Bitlbee";
port = "6667";
autoconnect = "yes";
}
); 

Then the connection to the bitlbee account (and thus to your MSN account) should be automatic. Edit the chatnet part :

chatnets = {
IRCnet = {
type = "IRC";
max_kicks = "4";
max_msgs = "5";
max_whois = "4";
max_query_chans = "5";
};
Bitlbee = {
type = "IRC";
autosendcmd   = "/^msg -bitlbee &bitlbee identify bitlbeepassword; \
wait -bitlbee 2000";
}

Beware, it’s your bitlbee passowrd so set the permissions accordingly. Restart irssi and you should be all set ! You can message your friends with

/msg apseudonym.

/ignore &bitlbee MODES
account gtalk set nick_format %full_name