view gaim2blt.pl @ 8312:ba12d8b12ab0

[gaim-migrate @ 9036] I think this is preliminary jabber file sending support. I can't test it because the new network listening stuff is broken if you run both IPv4 and IPv6. If someone with a more "normal" setup can let me know if this works, I'd appreciate it. Note that it's not completely implemented yet, so sending via a proxy server doesn't work, cancelling transfers doesn't work, error handling isn't there, and it probably leaks memory. A sane person might even wonder why I'm committing this. Oh well. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 21 Feb 2004 23:59:49 +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