Changeset 973

Show
Ignore:
Timestamp:
08/20/08 08:45:00 (3 months ago)
Author:
arvind
Message:

Removed CrossPoster::Cache in favour of a crossposter_cache vblob meta column

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CrossPoster/plugins/CrossPoster/config.yaml

    r965 r973  
    1212    crossposter_account: CrossPoster::Account 
    1313    crossposter_cache: CrossPoster::Cache 
     14    entry: 
     15        crossposter_cache: vblob meta 
    1416     
    1517crossposter_connectors: 
  • trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/App/CMS.pm

    r966 r973  
    121121     
    122122    my $blog_id = $app->param('blog_id'); 
     123    my $entry; 
     124    if(my $id = $app->param('id')) { 
     125        require MT::Entry; 
     126        $entry = MT::Entry->load($id); 
     127    } 
    123128     
    124129    # First populate all the accounts we have 
     
    135140        next if !$connector;         
    136141         
    137         if(my $id = $app->param('id')) { 
    138             require CrossPoster::Cache; 
    139             my $cache = CrossPoster::Cache->load({ account_id => $account->id, entry_id => $id, blog_id => $blog_id }); 
    140             $row->{is_selected} = $cache ? 1 : 0; 
     142        if($entry) { 
     143            my $cache = $entry->crossposter_cache || {}; 
     144            $row->{is_selected} = $cache->{$account->id} ? 1 : 0; 
    141145        } 
    142146         
     
    205209    $crossposter_field->innerHTML($innerHTML); 
    206210    $tmpl->insertAfter($crossposter_field, $basename_field); 
    207      
    208  
    209  
    210211} 
    211212 
     
    217218    foreach (@param) { 
    218219        if (m/^crosspost_acct_(\d+)$/) { 
    219             _cross_post($plugin, $cb, $app, $entry, $1); 
     220            _cross_post($cb, $app, $entry, $1); 
    220221            # my $res = MT::Util::start_background_task(sub { 
    221222            #       _cross_post($plugin, @_, $1); 
  • trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/Connector/LiveJournal.pm

    r938 r973  
    77sub edit_uri {  
    88        my $self = shift; 
    9         my ($app, $account, $entry) = @_; 
     9        my ($account, $entry) = @_; 
    1010         
    11         require CrossPoster::Cache; 
    12         my $cache = CrossPoster::Cache->load({ entry_id => $entry->id, blog_id => $entry->blog_id, account_id => $account->id }); 
     11        my $cache = $entry->crossposter_cache || {}; 
    1312         
    14         return '' if !$cache; 
    15          
    16         return $cache->response;         
    17 }  
     13        return $cache->{$account->id};   
     14
    1815 
    1916sub post_uri { 
  • trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/Connector/MovableType.pm

    r966 r973  
    77sub edit_uri {  
    88        my $self = shift; 
    9         my ($app, $account, $entry) = @_; 
     9        my ($account, $entry) = @_; 
    1010         
    11         require CrossPoster::Cache; 
    12         my $cache = CrossPoster::Cache->load({ entry_id => $entry->id, blog_id => $entry->blog_id, account_id => $account->id }); 
     11        my $cache = $entry->crossposter_cache || {}; 
    1312         
    14         return '' if !$cache; 
    15          
    16         return $cache->response;         
     13        return $cache->{$account->id};   
    1714}  
    1815 
  • trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/Connector/TypePad.pm

    r966 r973  
    99sub edit_uri {  
    1010        my $self = shift; 
    11         my ($app, $account, $entry) = @_; 
     11        my ($account, $entry) = @_; 
    1212         
    13         require CrossPoster::Cache; 
    14         my $cache = CrossPoster::Cache->load({ entry_id => $entry->id, blog_id => $entry->blog_id, account_id => $account->id }); 
     13        my $cache = $entry->crossposter_cache || {}; 
    1514         
    16         return '' if !$cache; 
    17          
    18         return $cache->response;         
    19 }  
     15        return $cache->{$account->id};   
     16
    2017 
    2118sub post_uri {