view gaim2blt.pl @ 3452:12202a328adf

[gaim-migrate @ 3497] FROM JONAS BIRME: * IRC: /W implemented the WHO * command * IRC: /VERSION implemented * IRC: Display all error messages received from server. * IRC: Handle channel mode and added support for changing mode, /MODE * IRC: Implements /QUIT [<Quit message>] 4.1.6 in the RFC. Quits the entire application. * IRC: Use gc->user->alias as real name. Also includes yesterdays patch: * Add nickname to buddy list by right clicking on nickname in chat room. * IRC: Parsed the idle and signon time on WHOIS-answer. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 27 Aug 2002 17:16:28 +0000
parents 7cd904828d3d
children 66bf7ecefedd
line wrap: on
line source

#!/usr/bin/perl -w
# Original by Andy Harrison,
# Rewrite by Decklin Foster,
# Available under the GPL.

package Gaim2Blt;
use strict;
use Getopt::Std;
use vars qw(%opts $in_group);

getopts('s:', \%opts);
die "usage: $0 -s 'screen name' gaim.buddy\n" unless $opts{s};

print <<"EOF";
Config {
  version 1
}
User {
  screenname "$opts{s}"
}
Buddy {
  list {
EOF

while (<>) {
    chomp;
    my ($type, $args) = split ' ', $_, 2;
    next unless $type;

    if ($type eq 'g') {
        print "    }\n" if ($in_group);
        print qq(    "$args" {\n)";
        $in_group = 1;
    } elsif ($type eq 'b') {
        my ($buddy, $alias) = split /:/, $args;
        print qq(      "$buddy"\n);
    }
}

print <<"EOF";
    }
  }
}
EOF