view gaim2blt.pl @ 6840:b67670ac5584

[gaim-migrate @ 7385] Tim Ringenbach (marv_sf) writes: " This fixes the following bugs: Deleting a buddy didn't make the prpl realize he was no longer on the server list (until signoff/signon), so adding his back yet failing didn't seem to fail. Adding a buddy that was offline showed him as not on server list until signoff/signon or he came online. Adding a buddy to a 2nd group actually added him a 2nd time to his first group on the server list (which isn't allowed, so generated an error) This also adds an error when adding to the server list fails for any reason except already being on the list. This also makes the error when a buddy rejects us a little nicer looking." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 14 Sep 2003 21:21:32 +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