annotate licq2gaim.pl @ 9969:cc2e6dd43613

[gaim-migrate @ 10879] (21:35:19) nosnilmot: LSchiere: gaim_blist_add_group() should not really be #if 0'd out... does that need a patch? (21:35:38) LSchiere: why is it #if 0'ed? (21:35:50) nosnilmot: merging error afaict (21:35:52) interalia: datallah: talking to yourself is OK. it's when you answer that it becomes a problem... (21:35:54) LSchiere: i'm assuming it was done for a reason, temporary as that reason might be (21:36:04) nosnilmot: it's not #if 0'd in chip's svn tree (21:36:08) LSchiere: oddness (21:36:16) interalia: cvs annotate to the rescue! (21:36:23) LSchiere: was that part of datallah's patch failure handle patch? (21:36:49) datallah: yeah... i'm confused as to how it happened, but the first part happened during the plain merge and the #endif i added during the .rej cleanup iirc (21:37:31) nosnilmot: yup, datallah's right :) I suspect the #if 0 came in because "patch" was trying to "help" (21:37:47) LSchiere: okay, let's see what happens without that (21:38:11) nosnilmot: "it works a lot better and doesn't eat as many buddy lists for breakfast" (21:38:12) datallah: it definitely needs to not be commented out it compiles uncommented, so we'll go with their opinion committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 08 Sep 2004 01:38:38 +0000
parents e967c0d93930
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2803
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 #!/usr/bin/perl -w
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 # licq2gaim.pl
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 #
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 # Arturo Cisneros, Jr <acjr@hal-pc.org>
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 # GPL'd
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 use strict;
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 my $DIR = "$ENV{HOME}/.licq";
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 my $GAIM = "$ENV{HOME}/.gaim";
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 my (@UINS, %USERS) = ();
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 my $OWNER = "";
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 get_uins();
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 foreach my $uin (@UINS) {
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18 $USERS{$uin} = get_alias($uin);
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19 }
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 get_owner();
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 write_list();
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 sub get_uins {
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 opendir(DIR, "$DIR/users") or die "Couldn't open dir $DIR/users/: $!";
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 @UINS = grep !/^\./, readdir DIR;
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 closedir(DIR);
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 }
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32 sub get_owner {
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34 my @foo = ();
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36 open(FILE, "<$DIR/owner.uin") or die "Couldn't open file $DIR/owner.uin $!";
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 while(<FILE>) {
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 next unless /^Uin/;
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 @foo = split;
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40 last;
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 }
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 close(FILE);
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 $OWNER = $foo[2];
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 }
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 sub get_alias {
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 my @foo = ();
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 open(FILE, "<$DIR/users/$_[0]") or die "Couldn't open $DIR/users/$_[0]: $!";
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 while(<FILE>) {
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53 next unless /^Alias/;
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
54 @foo = split / /, $_, 3;
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55 last;
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 }
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 close(FILE);
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59 return $foo[2];
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 }
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
61
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 sub write_list {
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64 # Backup Original
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65 if( -e "$GAIM/$OWNER.3.blist") {
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 rename("$GAIM/$OWNER.3.blist","$GAIM/$OWNER.3.bak");
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 }
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69 # Write new file
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 open(FILE, ">$GAIM/$OWNER.3.blist") or die "Couldn't open file for writing: $!";
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71 print FILE "m 1\n";
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72 print FILE "g ICQBuddies\n";
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
73 while(my($key, $value) = each %USERS) {
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 $key =~ s/\.uin$//;
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75 print FILE "b $key:$value";
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76 }
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 close(FILE);
e967c0d93930 [gaim-migrate @ 2816]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78 }