From 05abd977c1ace4931ea679059cd600ed41337a1c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 20 Jan 2017 18:31:49 +0100 Subject: [PATCH] Fix preview cards layout, do preview card crawling for remote statuses --- .../features/status/components/card.jsx | 16 ++++++++++------ app/services/process_feed_service.rb | 3 ++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/components/features/status/components/card.jsx b/app/assets/javascripts/components/features/status/components/card.jsx index 7161de3645b..ccb06dfd582 100644 --- a/app/assets/javascripts/components/features/status/components/card.jsx +++ b/app/assets/javascripts/components/features/status/components/card.jsx @@ -14,16 +14,20 @@ const outerStyle = { }; const contentStyle = { - flex: '2', + flex: '1 1 auto', padding: '8px', - paddingLeft: '14px' + paddingLeft: '14px', + overflow: 'hidden' }; const titleStyle = { display: 'block', fontWeight: '500', marginBottom: '5px', - color: '#d9e1e8' + color: '#d9e1e8', + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap' }; const descriptionStyle = { @@ -31,7 +35,7 @@ const descriptionStyle = { }; const imageOuterStyle = { - flex: '1', + flex: '0 0 100px', background: '#373b4a' }; @@ -84,8 +88,8 @@ const Card = React.createClass({ {image}
- {card.get('title')} -

{card.get('description')}

+ {card.get('title')} +

{card.get('description').substring(0, 50)}

{getHostname(card.get('url'))}
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb index cc35e65b8a1..4466abda3d2 100644 --- a/app/services/process_feed_service.rb +++ b/app/services/process_feed_service.rb @@ -45,7 +45,7 @@ class ProcessFeedService < BaseService status = status_from_xml(@xml) return if status.nil? - + if verb == :share original_status = status_from_xml(@xml.at_xpath('.//activity:object', activity: TagManager::AS_XMLNS)) status.reblog = original_status @@ -61,6 +61,7 @@ class ProcessFeedService < BaseService status.save! NotifyService.new.call(status.reblog.account, status) if status.reblog? && status.reblog.account.local? + LinkCrawlWorker.perform_async(status.reblog? ? status.reblog_of_id : status.id) Rails.logger.debug "Queuing remote status #{status.id} (#{id}) for distribution" DistributionWorker.perform_async(status.id) status