- @message = Message.where("to_user_id = ? OR from_user_id = ?", @user.id, @user.id).find(params[:message_id])
- @message.from_user_visible = false if @message.sender == @user
- @message.to_user_visible = false if @message.recipient == @user
+ @message = Message.where("to_user_id = ? OR from_user_id = ?", current_user.id, current_user.id).find(params[:message_id])
+ @message.from_user_visible = false if @message.sender == current_user
+ @message.to_user_visible = false if @message.recipient == current_user