don't interact with inactive users

This commit is contained in:
joshua stein 2014-01-13 10:21:49 -06:00
parent 6d091ef204
commit 3241f34f75
3 changed files with 5 additions and 3 deletions

View file

@ -9,7 +9,8 @@
<% end %>
<%= @showing_user.username %>
</span>
<% if @user %>
<% if @user && @showing_user.is_active? %>
(<a href="/messages?to=<%= @showing_user.username %>">Send a Message</a>)
<% end %>
</div>

View file

@ -44,7 +44,8 @@ EMAIL_WIDTH = 72
LAST_STORY_KEY = "mailing:last_story_id"
LAST_COMMENT_KEY = "mailing:last_comment_id"
mailing_list_users = User.where(:mailing_list_enabled => true)
mailing_list_users = User.where(:mailing_list_enabled => true).select{|u|
u.is_active? }
last_story_id = (Keystore.value_for(LAST_STORY_KEY) || Story.last.id).to_i

View file

@ -45,7 +45,7 @@ end
sending_user = User.where(:mailing_list_enabled => true,
:mailing_list_token => user_token).first
if !sending_user
if !sending_user || !sending_user.is_active?
STDERR.puts "no user with mailing list token #{user_token}"
# if this looks like a user token but invalid, generate a bounce to be