Translate hyphens to underscores in usernames to avoid reimporting
crossposts.
Patch by exor674.
diffs (30 lines):
diff -r 62bfce9c7c3e -r d28482a64ca2
cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm
--- a/cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm Mon Oct 05 15:48:52
2009 -0500
+++ b/cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm Mon Oct 05 17:25:03
2009 -0500
@@ -307,15 +307,22 @@ sub find_matching_acct {
my @accts = DW::External::Account->get_external_accounts($u);
- my $dh = $data->{hostname};
+ my $dh = lc( $data->{hostname} );
$dh =~ s/^www\.//;
+ my $duser = lc( $data->{username} );
+ $duser =~ s/-/_/g;
+
+
foreach my $acct (@accts) {
- my $sh = $acct->serverhost;
+ my $sh = lc( $acct->serverhost );
$sh =~ s/^www\.//;
- next unless lc( $sh ) eq lc( $dh );
- next unless lc( $acct->username ) eq lc( $data->{username} );
+ my $suser = lc( $acct->username );
+ $suser =~ s/-/_/g;
+
+ next unless $sh eq $dh;
+ next unless $suser eq $duser;
return $acct;
}
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog