lib/cosgrove/upvote_job.rb in cosgrove-0.0.1rc6 vs lib/cosgrove/upvote_job.rb in cosgrove-0.0.1rc7
- old
+ new
@@ -47,10 +47,11 @@
return
end
created ||= post.created
cashout_time ||= post.cashout_time
+ root_post = post.parent_author == ''
nope = if created > 1.minute.ago
"Give it a second! It's going to SPACE! Can you give it a second to come back from space?"
elsif created > 20.minutes.ago
"Unable to vote. Please wait 20 minutes before voting."
@@ -68,9 +69,12 @@
elsif (rep = to_rep(post.author_reputation).to_f) < 25.0
puts "Won't vote because rep too low: #{rep}"
'Unable to vote on that.'
elsif muted.include? author_name
puts "Won't vote because author muted."
+ 'Unable to vote.'
+ elsif !root_post && channel_disable_comment_voting(event.channel.id)
+ puts "Won't vote because comment voting is disabled."
'Unable to vote.'
elsif !registered
'Unable to vote. Feature resticted to registered users.'
elsif cb_account.novote?
'Unable to vote. Your account has been resticted.'