view gaim2blt.pl @ 4594:a2c95c0d7333

[gaim-migrate @ 4879] I need the ack thing so Gaim will be able to exchange files with MacAIM clizients. I think. The other changes makes gaim call gaim_xfer_end after reading in the # of bytes in the file. Previously it only called gaim_xfer_end when the other end closed the socket. I could write an oscar_xfer_read function that does this, but I would basically be duplicating all of gaim_xfer_read, and I thought this was a little clean. Chipster can lay the smack down on me if this is too ugly. I figured some of this will have to change if multiple files per transfer is ever supported. Gaim doesn't provide support for that [insert "support" related joke here]. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 20 Feb 2003 21:08:46 +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