view gaim2blt.pl @ 5939:3014de25a8a4

[gaim-migrate @ 6379] Tim Ringenbach writes: "Here's a one liner to make gaim process YAHOO_SERVICE_CHATMSG packets, which are the same as normal YAHOO_SERVICE_MESSAGE packets, although they seem less featureful. The java client at chat.yahoo.com sends these. It receives the normal ones that gaim sends back fine however. Without this patch, IMs from the java yahoo chat client (possibly others?) just get ignored, which is probably a BadThing(TM)." I tend to agree that missing messages is a Bad Thing, and i know sean won't look at this patch. He'll probly just reverse it because he probly won't like it, but hopefully this way he might at least give some feedback, and maybe it will even stay in and do gaim some good. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 21 Jun 2003 13:35:23 +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