Remove participants limit for conversations

The limit was added in 2012 to prevent spam, but since the participants
need to be a mutual contact with the author nowadays, I don't think it's
a spam problem anymore.
This commit is contained in:
Benjamin Neff 2018-01-27 02:34:25 +01:00 committed by Dennis Schubert
parent 80bfc3fcfd
commit 815cf121ab
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E

View file

@ -9,13 +9,8 @@ class Conversation < ApplicationRecord
has_many :participants, class_name: "Person", through: :conversation_visibilities, source: :person
has_many :messages, -> { order("created_at ASC") }, inverse_of: :conversation
validate :max_participants
validate :local_recipients
def max_participants
errors.add(:max_participants, "too many participants") if participants.count > 20
end
def local_recipients
recipients.each do |recipient|
if recipient.local?