view gaim2blt.pl @ 7469:603a58cd23dc

[gaim-migrate @ 8082] This should fix the problem where some MSN users in the buddy list were showing the offline emblem, indicating that gaim and the server disagree as to whether or not the buddy should be there. That icon was for testing purposes, and should never have been seen by a user. The problem was that in the code, we were looking for a list of all buddies, and would add new ones if not found. The problem was that we'd get duplicates, as some would be in foo@bar.com form, and some in FOO@bar.com form, or mixed-case, or whatever. Now, our msn_normalize() converts a string to lowercase first. We'll see how well this works, but it fixed the problem here. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 10 Nov 2003 22:13:18 +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