You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

503 lines
15 KiB

Account domain blocks (#2381) * Add <ostatus:conversation /> tag to Atom input/output Only uses ref attribute (not href) because href would be the alternate link that's always included also. Creates new conversation for every non-reply status. Carries over conversation for every reply. Keeps remote URIs verbatim, generates local URIs on the fly like the rest of them. * Conversation muting - prevents notifications that reference a conversation (including replies, favourites, reblogs) from being created. API endpoints /api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute Currently no way to tell when a status/conversation is muted, so the web UI only has a "disable notifications" button, doesn't work as a toggle * Display "Dismiss notifications" on all statuses in notifications column, not just own * Add "muted" as a boolean attribute on statuses JSON For now always false on contained reblogs, since it's only relevant for statuses returned from the notifications endpoint, which are not nested Remove "Disable notifications" from detailed status view, since it's only relevant in the notifications column * Up max class length * Remove pending test for conversation mute * Add tests, clean up * Rename to "mute conversation" and "unmute conversation" * Raise validation error when trying to mute/unmute status without conversation * Adding account domain blocks that filter notifications and public timelines * Add tests for domain blocks in notifications, public timelines Filter reblogs of blocked domains from home * Add API for listing and creating account domain blocks * API for creating/deleting domain blocks, tests for Status#ancestors and Status#descendants, filter domain blocks from them * Filter domains in streaming API * Update account_domain_block_spec.rb
7 years ago
Fix Account model deprecation warnings (#3689) ``` DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:60) DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:60) DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:60) DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:61) DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:62) DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:63) ``` Here's PR describing changes to Dirty API https://github.com/rails/rails/pull/25337
7 years ago
Fix Account model deprecation warnings (#3689) ``` DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:60) DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:60) DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:60) DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:61) DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:62) DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in <class:Account> at /Users/rene/Workspace/personal/ruby/mastodon/app/models/account.rb:63) ``` Here's PR describing changes to Dirty API https://github.com/rails/rails/pull/25337
7 years ago
8 years ago
8 years ago
Account domain blocks (#2381) * Add <ostatus:conversation /> tag to Atom input/output Only uses ref attribute (not href) because href would be the alternate link that's always included also. Creates new conversation for every non-reply status. Carries over conversation for every reply. Keeps remote URIs verbatim, generates local URIs on the fly like the rest of them. * Conversation muting - prevents notifications that reference a conversation (including replies, favourites, reblogs) from being created. API endpoints /api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute Currently no way to tell when a status/conversation is muted, so the web UI only has a "disable notifications" button, doesn't work as a toggle * Display "Dismiss notifications" on all statuses in notifications column, not just own * Add "muted" as a boolean attribute on statuses JSON For now always false on contained reblogs, since it's only relevant for statuses returned from the notifications endpoint, which are not nested Remove "Disable notifications" from detailed status view, since it's only relevant in the notifications column * Up max class length * Remove pending test for conversation mute * Add tests, clean up * Rename to "mute conversation" and "unmute conversation" * Raise validation error when trying to mute/unmute status without conversation * Adding account domain blocks that filter notifications and public timelines * Add tests for domain blocks in notifications, public timelines Filter reblogs of blocked domains from home * Add API for listing and creating account domain blocks * API for creating/deleting domain blocks, tests for Status#ancestors and Status#descendants, filter domain blocks from them * Filter domains in streaming API * Update account_domain_block_spec.rb
7 years ago
8 years ago
  1. # frozen_string_literal: true
  2. # == Schema Information
  3. #
  4. # Table name: accounts
  5. #
  6. # id :bigint(8) not null, primary key
  7. # username :string default(""), not null
  8. # domain :string
  9. # secret :string default(""), not null
  10. # private_key :text
  11. # public_key :text default(""), not null
  12. # remote_url :string default(""), not null
  13. # salmon_url :string default(""), not null
  14. # hub_url :string default(""), not null
  15. # created_at :datetime not null
  16. # updated_at :datetime not null
  17. # note :text default(""), not null
  18. # display_name :string default(""), not null
  19. # uri :string default(""), not null
  20. # url :string
  21. # avatar_file_name :string
  22. # avatar_content_type :string
  23. # avatar_file_size :integer
  24. # avatar_updated_at :datetime
  25. # header_file_name :string
  26. # header_content_type :string
  27. # header_file_size :integer
  28. # header_updated_at :datetime
  29. # avatar_remote_url :string
  30. # subscription_expires_at :datetime
  31. # silenced :boolean default(FALSE), not null
  32. # suspended :boolean default(FALSE), not null
  33. # locked :boolean default(FALSE), not null
  34. # header_remote_url :string default(""), not null
  35. # last_webfingered_at :datetime
  36. # inbox_url :string default(""), not null
  37. # outbox_url :string default(""), not null
  38. # shared_inbox_url :string default(""), not null
  39. # followers_url :string default(""), not null
  40. # protocol :integer default("ostatus"), not null
  41. # memorial :boolean default(FALSE), not null
  42. # moved_to_account_id :bigint(8)
  43. # featured_collection_url :string
  44. # fields :jsonb
  45. # actor_type :string
  46. # discoverable :boolean
  47. #
  48. class Account < ApplicationRecord
  49. USERNAME_RE = /[a-z0-9_]+([a-z0-9_\.-]+[a-z0-9_]+)?/i
  50. MENTION_RE = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE})(?:@[a-z0-9\.\-]+[a-z0-9]+)?)/i
  51. MIN_FOLLOWERS_DISCOVERY = 10
  52. include AccountAssociations
  53. include AccountAvatar
  54. include AccountFinderConcern
  55. include AccountHeader
  56. include AccountInteractions
  57. include Attachmentable
  58. include Paginable
  59. include AccountCounters
  60. enum protocol: [:ostatus, :activitypub]
  61. validates :username, presence: true
  62. # Remote user validations
  63. validates :username, uniqueness: { scope: :domain, case_sensitive: true }, if: -> { !local? && will_save_change_to_username? }
  64. validates :username, format: { with: /\A#{USERNAME_RE}\z/i }, if: -> { !local? && will_save_change_to_username? }
  65. # Local user validations
  66. validates :username, format: { with: /\A[a-z0-9_]+\z/i }, length: { maximum: 30 }, if: -> { local? && will_save_change_to_username? }
  67. validates_with UniqueUsernameValidator, if: -> { local? && will_save_change_to_username? }
  68. validates_with UnreservedUsernameValidator, if: -> { local? && will_save_change_to_username? }
  69. validates :display_name, length: { maximum: 30 }, if: -> { local? && will_save_change_to_display_name? }
  70. validates :note, length: { maximum: 160 }, if: -> { local? && will_save_change_to_note? }
  71. validates :fields, length: { maximum: 4 }, if: -> { local? && will_save_change_to_fields? }
  72. scope :remote, -> { where.not(domain: nil) }
  73. scope :local, -> { where(domain: nil) }
  74. scope :expiring, ->(time) { remote.where.not(subscription_expires_at: nil).where('subscription_expires_at < ?', time) }
  75. scope :partitioned, -> { order(Arel.sql('row_number() over (partition by domain)')) }
  76. scope :silenced, -> { where(silenced: true) }
  77. scope :suspended, -> { where(suspended: true) }
  78. scope :without_suspended, -> { where(suspended: false) }
  79. scope :recent, -> { reorder(id: :desc) }
  80. scope :bots, -> { where(actor_type: %w(Application Service)) }
  81. scope :alphabetic, -> { order(domain: :asc, username: :asc) }
  82. scope :by_domain_accounts, -> { group(:domain).select(:domain, 'COUNT(*) AS accounts_count').order('accounts_count desc') }
  83. scope :matches_username, ->(value) { where(arel_table[:username].matches("#{value}%")) }
  84. scope :matches_display_name, ->(value) { where(arel_table[:display_name].matches("#{value}%")) }
  85. scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) }
  86. scope :searchable, -> { where(suspended: false).where(moved_to_account_id: nil) }
  87. scope :discoverable, -> { searchable.where(silenced: false).where(discoverable: true).joins(:account_stat).where(AccountStat.arel_table[:followers_count].gteq(MIN_FOLLOWERS_DISCOVERY)).by_recent_status }
  88. scope :tagged_with, ->(tag) { joins(:accounts_tags).where(accounts_tags: { tag_id: tag }) }
  89. scope :by_recent_status, -> { order(Arel.sql('(case when account_stats.last_status_at is null then 1 else 0 end) asc, account_stats.last_status_at desc')) }
  90. scope :popular, -> { order('account_stats.followers_count desc') }
  91. delegate :email,
  92. :unconfirmed_email,
  93. :current_sign_in_ip,
  94. :current_sign_in_at,
  95. :confirmed?,
  96. :admin?,
  97. :moderator?,
  98. :staff?,
  99. :locale,
  100. :hides_network?,
  101. to: :user,
  102. prefix: true,
  103. allow_nil: true
  104. delegate :chosen_languages, to: :user, prefix: false, allow_nil: true
  105. def local?
  106. domain.nil?
  107. end
  108. def moved?
  109. moved_to_account_id.present?
  110. end
  111. def bot?
  112. %w(Application Service).include? actor_type
  113. end
  114. alias bot bot?
  115. def bot=(val)
  116. self.actor_type = ActiveModel::Type::Boolean.new.cast(val) ? 'Service' : 'Person'
  117. end
  118. def acct
  119. local? ? username : "#{username}@#{domain}"
  120. end
  121. def local_username_and_domain
  122. "#{username}@#{Rails.configuration.x.local_domain}"
  123. end
  124. def to_webfinger_s
  125. "acct:#{local_username_and_domain}"
  126. end
  127. def subscribed?
  128. subscription_expires_at.present?
  129. end
  130. def possibly_stale?
  131. last_webfingered_at.nil? || last_webfingered_at <= 1.day.ago
  132. end
  133. def refresh!
  134. return if local?
  135. ResolveAccountService.new.call(acct)
  136. end
  137. def silence!
  138. update!(silenced: true)
  139. end
  140. def unsilence!
  141. update!(silenced: false)
  142. end
  143. def suspend!
  144. transaction do
  145. user&.disable! if local?
  146. update!(suspended: true)
  147. end
  148. end
  149. def unsuspend!
  150. transaction do
  151. user&.enable! if local?
  152. update!(suspended: false)
  153. end
  154. end
  155. def memorialize!
  156. transaction do
  157. user&.disable! if local?
  158. update!(memorial: true)
  159. end
  160. end
  161. def keypair
  162. @keypair ||= OpenSSL::PKey::RSA.new(private_key || public_key)
  163. end
  164. def tags_as_strings=(tag_names)
  165. tag_names.map! { |name| name.mb_chars.downcase.to_s }
  166. tag_names.uniq!
  167. # Existing hashtags
  168. hashtags_map = Tag.where(name: tag_names).each_with_object({}) { |tag, h| h[tag.name] = tag }
  169. # Initialize not yet existing hashtags
  170. tag_names.each do |name|
  171. next if hashtags_map.key?(name)
  172. hashtags_map[name] = Tag.new(name: name)
  173. end
  174. # Remove hashtags that are to be deleted
  175. tags.each do |tag|
  176. if hashtags_map.key?(tag.name)
  177. hashtags_map.delete(tag.name)
  178. else
  179. transaction do
  180. tags.delete(tag)
  181. tag.decrement_count!(:accounts_count)
  182. end
  183. end
  184. end
  185. # Add hashtags that were so far missing
  186. hashtags_map.each_value do |tag|
  187. transaction do
  188. tags << tag
  189. tag.increment_count!(:accounts_count)
  190. end
  191. end
  192. end
  193. def fields
  194. (self[:fields] || []).map { |f| Field.new(self, f) }
  195. end
  196. def fields_attributes=(attributes)
  197. fields = []
  198. old_fields = self[:fields] || []
  199. if attributes.is_a?(Hash)
  200. attributes.each_value do |attr|
  201. next if attr[:name].blank?
  202. previous = old_fields.find { |item| item['value'] == attr[:value] }
  203. if previous && previous['verified_at'].present?
  204. attr[:verified_at] = previous['verified_at']
  205. end
  206. fields << attr
  207. end
  208. end
  209. self[:fields] = fields
  210. end
  211. DEFAULT_FIELDS_SIZE = 4
  212. def build_fields
  213. return if fields.size >= DEFAULT_FIELDS_SIZE
  214. tmp = self[:fields] || []
  215. (DEFAULT_FIELDS_SIZE - tmp.size).times do
  216. tmp << { name: '', value: '' }
  217. end
  218. self.fields = tmp
  219. end
  220. def magic_key
  221. modulus, exponent = [keypair.public_key.n, keypair.public_key.e].map do |component|
  222. result = []
  223. until component.zero?
  224. result << [component % 256].pack('C')
  225. component >>= 8
  226. end
  227. result.reverse.join
  228. end
  229. (['RSA'] + [modulus, exponent].map { |n| Base64.urlsafe_encode64(n) }).join('.')
  230. end
  231. def subscription(webhook_url)
  232. @subscription ||= OStatus2::Subscription.new(remote_url, secret: secret, webhook: webhook_url, hub: hub_url)
  233. end
  234. def save_with_optional_media!
  235. save!
  236. rescue ActiveRecord::RecordInvalid
  237. self.avatar = nil
  238. self.header = nil
  239. self[:avatar_remote_url] = ''
  240. self[:header_remote_url] = ''
  241. save!
  242. end
  243. def object_type
  244. :person
  245. end
  246. def to_param
  247. username
  248. end
  249. def excluded_from_timeline_account_ids
  250. Rails.cache.fetch("exclude_account_ids_for:#{id}") { blocking.pluck(:target_account_id) + blocked_by.pluck(:account_id) + muting.pluck(:target_account_id) }
  251. end
  252. def excluded_from_timeline_domains
  253. Rails.cache.fetch("exclude_domains_for:#{id}") { domain_blocks.pluck(:domain) }
  254. end
  255. def preferred_inbox_url
  256. shared_inbox_url.presence || inbox_url
  257. end
  258. class Field < ActiveModelSerializers::Model
  259. attributes :name, :value, :verified_at, :account, :errors
  260. def initialize(account, attributes)
  261. @account = account
  262. @attributes = attributes
  263. @name = attributes['name'].strip[0, string_limit]
  264. @value = attributes['value'].strip[0, string_limit]
  265. @verified_at = attributes['verified_at']&.to_datetime
  266. @errors = {}
  267. end
  268. def verified?
  269. verified_at.present?
  270. end
  271. def value_for_verification
  272. @value_for_verification ||= begin
  273. if account.local?
  274. value
  275. else
  276. ActionController::Base.helpers.strip_tags(value)
  277. end
  278. end
  279. end
  280. def verifiable?
  281. value_for_verification.present? && value_for_verification.start_with?('http://', 'https://')
  282. end
  283. def mark_verified!
  284. @verified_at = Time.now.utc
  285. @attributes['verified_at'] = @verified_at
  286. end
  287. def to_h
  288. { name: @name, value: @value, verified_at: @verified_at }
  289. end
  290. private
  291. def string_limit
  292. if account.local?
  293. 255
  294. else
  295. 2047
  296. end
  297. end
  298. end
  299. class << self
  300. def readonly_attributes
  301. super - %w(statuses_count following_count followers_count)
  302. end
  303. def domains
  304. reorder(nil).pluck(Arel.sql('distinct accounts.domain'))
  305. end
  306. def inboxes
  307. urls = reorder(nil).where(protocol: :activitypub).pluck(Arel.sql("distinct coalesce(nullif(accounts.shared_inbox_url, ''), accounts.inbox_url)"))
  308. DeliveryFailureTracker.filter(urls)
  309. end
  310. def search_for(terms, limit = 10)
  311. textsearch, query = generate_query_for_search(terms)
  312. sql = <<-SQL.squish
  313. SELECT
  314. accounts.*,
  315. ts_rank_cd(#{textsearch}, #{query}, 32) AS rank
  316. FROM accounts
  317. WHERE #{query} @@ #{textsearch}
  318. AND accounts.suspended = false
  319. AND accounts.moved_to_account_id IS NULL
  320. ORDER BY rank DESC
  321. LIMIT ?
  322. SQL
  323. records = find_by_sql([sql, limit])
  324. ActiveRecord::Associations::Preloader.new.preload(records, :account_stat)
  325. records
  326. end
  327. def advanced_search_for(terms, account, limit = 10, following = false)
  328. textsearch, query = generate_query_for_search(terms)
  329. if following
  330. sql = <<-SQL.squish
  331. WITH first_degree AS (
  332. SELECT target_account_id
  333. FROM follows
  334. WHERE account_id = ?
  335. )
  336. SELECT
  337. accounts.*,
  338. (count(f.id) + 1) * ts_rank_cd(#{textsearch}, #{query}, 32) AS rank
  339. FROM accounts
  340. LEFT OUTER JOIN follows AS f ON (accounts.id = f.account_id AND f.target_account_id = ?) OR (accounts.id = f.target_account_id AND f.account_id = ?)
  341. WHERE accounts.id IN (SELECT * FROM first_degree)
  342. AND #{query} @@ #{textsearch}
  343. AND accounts.suspended = false
  344. AND accounts.moved_to_account_id IS NULL
  345. GROUP BY accounts.id
  346. ORDER BY rank DESC
  347. LIMIT ?
  348. SQL
  349. records = find_by_sql([sql, account.id, account.id, account.id, limit])
  350. else
  351. sql = <<-SQL.squish
  352. SELECT
  353. accounts.*,
  354. (count(f.id) + 1) * ts_rank_cd(#{textsearch}, #{query}, 32) AS rank
  355. FROM accounts
  356. LEFT OUTER JOIN follows AS f ON (accounts.id = f.account_id AND f.target_account_id = ?) OR (accounts.id = f.target_account_id AND f.account_id = ?)
  357. WHERE #{query} @@ #{textsearch}
  358. AND accounts.suspended = false
  359. AND accounts.moved_to_account_id IS NULL
  360. GROUP BY accounts.id
  361. ORDER BY rank DESC
  362. LIMIT ?
  363. SQL
  364. records = find_by_sql([sql, account.id, account.id, limit])
  365. end
  366. ActiveRecord::Associations::Preloader.new.preload(records, :account_stat)
  367. records
  368. end
  369. private
  370. def generate_query_for_search(terms)
  371. terms = Arel.sql(connection.quote(terms.gsub(/['?\\:]/, ' ')))
  372. textsearch = "(setweight(to_tsvector('simple', accounts.display_name), 'A') || setweight(to_tsvector('simple', accounts.username), 'B') || setweight(to_tsvector('simple', coalesce(accounts.domain, '')), 'C'))"
  373. query = "to_tsquery('simple', ''' ' || #{terms} || ' ''' || ':*')"
  374. [textsearch, query]
  375. end
  376. end
  377. def emojis
  378. @emojis ||= CustomEmoji.from_text(emojifiable_text, domain)
  379. end
  380. before_create :generate_keys
  381. before_validation :normalize_domain
  382. before_validation :prepare_contents, if: :local?
  383. before_destroy :clean_feed_manager
  384. private
  385. def prepare_contents
  386. display_name&.strip!
  387. note&.strip!
  388. end
  389. def generate_keys
  390. return unless local? && !Rails.env.test?
  391. keypair = OpenSSL::PKey::RSA.new(2048)
  392. self.private_key = keypair.to_pem
  393. self.public_key = keypair.public_key.to_pem
  394. end
  395. def normalize_domain
  396. return if local?
  397. self.domain = TagManager.instance.normalize_domain(domain)
  398. end
  399. def emojifiable_text
  400. [note, display_name, fields.map(&:value)].join(' ')
  401. end
  402. def clean_feed_manager
  403. reblog_key = FeedManager.instance.key(:home, id, 'reblogs')
  404. reblogged_id_set = Redis.current.zrange(reblog_key, 0, -1)
  405. Redis.current.pipelined do
  406. Redis.current.del(FeedManager.instance.key(:home, id))
  407. Redis.current.del(reblog_key)
  408. reblogged_id_set.each do |reblogged_id|
  409. reblog_set_key = FeedManager.instance.key(:home, id, "reblogs:#{reblogged_id}")
  410. Redis.current.del(reblog_set_key)
  411. end
  412. end
  413. end
  414. end