diaspora/lib/publisher.rb
cmrd Senya ab718dbbc6
A minor refactor of the Publisher
There was a minor copy-paste issue with publisher_public and
publisher_explain methods. Fix it and do a little refactoring
of the publisher's code.
2016-04-28 21:45:49 +03:00

19 lines
460 B
Ruby

class Publisher
attr_accessor :user, :open, :prefill, :public, :explain
def initialize(user, opts={})
self.user = user
self.open = opts[:open]
self.prefill = opts[:prefill]
self.public = opts[:public]
self.explain = opts[:explain]
end
def text
return unless prefill.present?
Diaspora::MessageRenderer.new(
prefill,
mentioned_people: Diaspora::Mentionable.people_from_string(prefill)
).plain_text
end
end