Permalink
Browse files

use submit reskey check for journal -> FH

  • Loading branch information...
1 parent a6bb56d commit 778aac3338216ebcad8f9c55fb917339a20446a9 @pudge pudge committed Oct 26, 2007
Showing with 19 additions and 11 deletions.
  1. +17 −9 plugins/Journal/Journal.pm
  2. +2 −2 sql/mysql/upgrades
@@ -61,10 +61,14 @@ sub set {
$self->sqlUpdate('journals', \%j1, "id=$id") if keys %j1;
$self->sqlUpdate('journals_text', \%j2, "id=$id") if $j2{article};
if ($constants->{plugin}{FireHose}) {
- my $journal_item = $self->get($id);
- my $firehose = getObject("Slash::FireHose");
- if ($journal_item->{promotetype} eq "publicize" || $journal_item->{promotetype} eq "publish") {
- $firehose->createUpdateItemFromJournal($id);
+ my $reskey = getObject('Slash::ResKey');
+ my $rkey = $reskey->key('submit', { nostate => 1 });
+ if ($rkey && $rkey->createuse) {
+ my $journal_item = $self->get($id);
+ my $firehose = getObject("Slash::FireHose");
+ if ($journal_item->{promotetype} eq "publicize" || $journal_item->{promotetype} eq "publish") {
+ $firehose->createUpdateItemFromJournal($id);
+ }
}
}
}
@@ -210,11 +214,15 @@ sub create {
my $slashdb = getCurrentDB();
$slashdb->setUser($uid, { journal_last_entry_date => $date });
if ($constants->{plugin}{FireHose}) {
- my $firehose = getObject("Slash::FireHose");
- my $journal = getObject("Slash::Journal");
- my $j = $journal->get($id);
- if ($j->{promotetype} eq "publicize" || $j->{promotetype} eq "publish") {
- $firehose->createItemFromJournal($id);
+ my $reskey = getObject('Slash::ResKey');
+ my $rkey = $reskey->key('submit', { nostate => 1 });
+ if ($rkey && $rkey->createuse) {
+ my $firehose = getObject("Slash::FireHose");
+ my $journal = getObject("Slash::Journal");
+ my $j = $journal->get($id);
+ if ($j->{promotetype} eq "publicize" || $j->{promotetype} eq "publish") {
+ $firehose->createItemFromJournal($id);
+ }
}
}
View
@@ -4941,8 +4941,6 @@ UPDATE vars SET value = 'T_2_5_0_180' WHERE name = 'cvs_tag_currentcode';
# SLASHDOT LAST UPDATED HERE
-# PUDGE LAST UPDATED HERE
-
INSERT INTO string_param (type, code, name) VALUES ('mediatypes','none','None');
INSERT INTO string_param (type, code, name) VALUES ('mediatypes','video','Video');
INSERT INTO string_param (type, code, name) VALUES ('mediatypes','image','Image');
@@ -4968,3 +4966,5 @@ UPDATE vars SET value = 'T_2_5_0_181' WHERE name = 'cvs_tag_currentcode';
# SLASHCODE/USEPERL LAST UPDATED HERE
+# PUDGE LAST UPDATED HERE
+

0 comments on commit 778aac3

Please sign in to comment.