[dw-free] remove HostedComments
[commit: http://hg.dwscoalition.org/dw-free/rev/65fdc23958c7]
http://bugs.dwscoalition.org/show_bug.cgi?id=1548
More removal of unused code.
Patch by
denise.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1548
More removal of unused code.
Patch by
![[staff profile]](https://www.dreamwidth.org/img/silk/identity/user_staff.png)
Files modified:
- cgi-bin/LJ/Customize.pm
- cgi-bin/LJ/HostedComments.pm
-------------------------------------------------------------------------------- diff -r 8efdb762d3f7 -r 65fdc23958c7 cgi-bin/LJ/Customize.pm --- a/cgi-bin/LJ/Customize.pm Tue Aug 04 20:32:43 2009 -0500 +++ b/cgi-bin/LJ/Customize.pm Tue Aug 04 20:40:23 2009 -0500 @@ -252,7 +252,6 @@ sub get_layouts_for_dropdown { $tmp =~ /^\d+$/ && $pub->{$tmp}->{'type'} eq "layout" && $pub->{$tmp}->{'uniq'} ne "s1shortcomings/layout" && - $pub->{$tmp}->{'uniq'} ne "hostedcomments/layout" && (!defined $is_active || $is_active) && ($_ = $tmp) } keys %$pub; diff -r 8efdb762d3f7 -r 65fdc23958c7 cgi-bin/LJ/HostedComments.pm --- a/cgi-bin/LJ/HostedComments.pm Tue Aug 04 20:32:43 2009 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -package LJ::HostedComments; -use strict; -use URI; - -# given a URL of a news article off-site, returns the local $u object -# for the journal that's mirroring the content (or excerts) of each -# article for holding comments. -sub journal_of_url { - my ($class, $url) = @_; - - my $uo = URI->new($url); - my $host = $uo->host or return undef; - - my $user = $LJ::HOSTED_COMMENTS_JOURNAL_OF_HOST{lc $host} or return undef; - return LJ::load_user($user); -} - -sub entry_of_url { - my ($class, $url) = @_; - my $u = $class->journal_of_url($url) or return undef; - - # case where we've already added URL parameters to it for replying - # or thread view or whatnot... - if ($url =~ /\blj_ditemid=(\d+)/) { - return LJ::Entry->new($u, ditemid => $1); - } - - my $prop = LJ::get_prop("log", "syn_link") or die "no syn_link prop"; - - my $jitemid = LJ::MemCache::get_or_set("jit_of_url:$url", sub { - $u->selectrow_array("SELECT jitemid FROM logprop2 ". - "WHERE journalid=? AND propid=? AND value=?", - undef, $u->id, $prop->{id}, $url); - }); - return undef unless $jitemid; - return LJ::Entry->new($u, jitemid => $jitemid); -} - - -1; --------------------------------------------------------------------------------