view gaim2blt.pl @ 5132:494b6b6a6ffa

[gaim-migrate @ 5495] I changed some zephyr stuff. I think it's funny. I made the get info box not show "Alias: (null)" for people without aliases, which I guess will fix a crash bug with zephyr on solaris, maybe. And I also gettexticised some strings. I thought I'd mention this in the change log because it's funny (that zephyr still exists). And to anyone who's wondering, NC State does have a zephyr realm set up, but not many people use it. I also mentioned the ICQ authorization thing. I figure some peeps might care. I bet the Care Bears care. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 14 Apr 2003 19:42:29 +0000
parents 66bf7ecefedd
children
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