view gaim2blt.pl @ 9927:fb08a0973b3e

[gaim-migrate @ 10819] " Currently, the "loggedin" parameter of serv_got_update() is of type int and used as a boolean. I updated it and all references to be gboolean. I also noticed that "presence" in gaim_blist_update_buddy_presence() is also a really boolean. of whether or not the buddy is currently online. There seemed to be some confusion, particularly in the silc plugin which tried to use a GaimBuddyPresenceState (coincidentally (or perhaps not) GAIM_BUDDY_OFFLINE and GAIM_BUDDY_ONLINE work as FALSE and TRUE respectively). The value passed to gaim_blist_update_buddy_presence() doesn't directly become the buddy presence state and this patch helps avoid confusion in this respect." --Daniel Atallah committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 01 Sep 2004 01:07:42 +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