about summary refs log tree commit diff
path: root/app/services/update_remote_profile_service.rb
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-04-22 03:33:24 +0200
committerGitHub <noreply@github.com>2017-04-22 03:33:24 +0200
commit9d3be5579a07bbff182b40cf15c04f762f155e51 (patch)
tree36bce1bb5c16c800814afe3730e9134828d7596c /app/services/update_remote_profile_service.rb
parent05ac28f3e451c9239093f55a32e9f1eda770f8fa (diff)
Improve bio compatibility (#2278)
* Fix #1057 (close #1819) - Move HTML-formatted bio from <poco:note /> to <summary type="html" />

* Ensure <poco:note /> is plaintext for remote accounts, also, by stripping out HTML
Diffstat (limited to 'app/services/update_remote_profile_service.rb')
-rw-r--r--app/services/update_remote_profile_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/update_remote_profile_service.rb b/app/services/update_remote_profile_service.rb
index 8f0d5d4b3..31f4af2c1 100644
--- a/app/services/update_remote_profile_service.rb
+++ b/app/services/update_remote_profile_service.rb
@@ -13,8 +13,8 @@ class UpdateRemoteProfileService < BaseService
     hub_link   = xml.at_xpath('./xmlns:link[@rel="hub"]', xmlns: TagManager::XMLNS)
 
     unless author_xml.nil?
-      account.display_name = author_xml.at_xpath('./poco:displayName', poco: TagManager::POCO_XMLNS).content unless author_xml.at_xpath('./poco:displayName', poco: TagManager::POCO_XMLNS).nil?
-      account.note         = author_xml.at_xpath('./poco:note', poco: TagManager::POCO_XMLNS).content unless author_xml.at_xpath('./poco:note', poco: TagManager::POCO_XMLNS).nil?
+      account.display_name = author_xml.at_xpath('./poco:displayName', poco: TagManager::POCO_XMLNS)&.content || ''
+      account.note         = author_xml.at_xpath('./xmlns:summary', xmlns: TagManager::XMLNS)&.content || author_xml.at_xpath('./poco:note', poco: TagManager::POCO_XMLNS)&.content || ''
       account.locked       = author_xml.at_xpath('./mastodon:scope', mastodon: TagManager::MTDN_XMLNS)&.content == 'private'
 
       if !account.suspended? && !DomainBlock.find_by(domain: account.domain)&.reject_media?