view gaim2blt.pl @ 2153:0befa2d2e540

[gaim-migrate @ 2163] moving mail notifications to the core. this makes things much easier on the protocols. next steps: make buddy right-click menu stuff generated by the core (based on information provided by the protocols, similar to the away menu stuff); make entry-widget protocol-specific user options generated by the core based on what the protocols tell it (in a similar way). committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 22 Aug 2001 21:11:58 +0000
parents 7506587a394d
children 7cd904828d3d
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 "    $args {\n";
        $in_group = 1;
    } elsif ($type eq 'b') {
        my ($buddy, $alias) = split /:/, $args;
        print qq(      "$buddy"\n);
    }
}

print <<"EOF";
    }
  }
}
EOF