view gaim2blt.pl @ 3493:4b204c262376

[gaim-migrate @ 3553] Rob committed some bug fixes to gtk1-stable, but not to HEAD. now his computer is acting up again, so i'm making the corresponding commits to HEAD. this should help with yahoo i18n, segfaults on jabber, a problem in gaimrc, and word wrapping on new mail notification. Modified Files: ChangeLog src/gaim.h src/gaimrc.c src/prpl.c src/protocols/msn/msn.c src/protocols/yahoo/yahoo.c ---------------------------------------------------------------------- committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 10 Sep 2002 15:31:34 +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