forked from cybrespace/mastodon
		
	Fix preview cards layout, do preview card crawling for remote statuses
This commit is contained in:
		
							parent
							
								
									f4e28785f1
								
							
						
					
					
						commit
						05abd977c1
					
				
					 2 changed files with 12 additions and 7 deletions
				
			
		| 
						 | 
					@ -14,16 +14,20 @@ const outerStyle = {
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const contentStyle = {
 | 
					const contentStyle = {
 | 
				
			||||||
  flex: '2',
 | 
					  flex: '1 1 auto',
 | 
				
			||||||
  padding: '8px',
 | 
					  padding: '8px',
 | 
				
			||||||
  paddingLeft: '14px'
 | 
					  paddingLeft: '14px',
 | 
				
			||||||
 | 
					  overflow: 'hidden'
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const titleStyle = {
 | 
					const titleStyle = {
 | 
				
			||||||
  display: 'block',
 | 
					  display: 'block',
 | 
				
			||||||
  fontWeight: '500',
 | 
					  fontWeight: '500',
 | 
				
			||||||
  marginBottom: '5px',
 | 
					  marginBottom: '5px',
 | 
				
			||||||
  color: '#d9e1e8'
 | 
					  color: '#d9e1e8',
 | 
				
			||||||
 | 
					  overflow: 'hidden',
 | 
				
			||||||
 | 
					  textOverflow: 'ellipsis',
 | 
				
			||||||
 | 
					  whiteSpace: 'nowrap'
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const descriptionStyle = {
 | 
					const descriptionStyle = {
 | 
				
			||||||
| 
						 | 
					@ -31,7 +35,7 @@ const descriptionStyle = {
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const imageOuterStyle = {
 | 
					const imageOuterStyle = {
 | 
				
			||||||
  flex: '1',
 | 
					  flex: '0 0 100px',
 | 
				
			||||||
  background: '#373b4a'
 | 
					  background: '#373b4a'
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -84,8 +88,8 @@ const Card = React.createClass({
 | 
				
			||||||
        {image}
 | 
					        {image}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <div style={contentStyle}>
 | 
					        <div style={contentStyle}>
 | 
				
			||||||
          <strong style={titleStyle}>{card.get('title')}</strong>
 | 
					          <strong style={titleStyle} title={card.get('title')}>{card.get('title')}</strong>
 | 
				
			||||||
          <p style={descriptionStyle}>{card.get('description')}</p>
 | 
					          <p style={descriptionStyle}>{card.get('description').substring(0, 50)}</p>
 | 
				
			||||||
          <span style={hostStyle}>{getHostname(card.get('url'))}</span>
 | 
					          <span style={hostStyle}>{getHostname(card.get('url'))}</span>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
      </a>
 | 
					      </a>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,7 @@ class ProcessFeedService < BaseService
 | 
				
			||||||
      status = status_from_xml(@xml)
 | 
					      status = status_from_xml(@xml)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      return if status.nil?
 | 
					      return if status.nil?
 | 
				
			||||||
      
 | 
					
 | 
				
			||||||
      if verb == :share
 | 
					      if verb == :share
 | 
				
			||||||
        original_status = status_from_xml(@xml.at_xpath('.//activity:object', activity: TagManager::AS_XMLNS))
 | 
					        original_status = status_from_xml(@xml.at_xpath('.//activity:object', activity: TagManager::AS_XMLNS))
 | 
				
			||||||
        status.reblog   = original_status
 | 
					        status.reblog   = original_status
 | 
				
			||||||
| 
						 | 
					@ -61,6 +61,7 @@ class ProcessFeedService < BaseService
 | 
				
			||||||
      status.save!
 | 
					      status.save!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      NotifyService.new.call(status.reblog.account, status) if status.reblog? && status.reblog.account.local?
 | 
					      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"
 | 
					      Rails.logger.debug "Queuing remote status #{status.id} (#{id}) for distribution"
 | 
				
			||||||
      DistributionWorker.perform_async(status.id)
 | 
					      DistributionWorker.perform_async(status.id)
 | 
				
			||||||
      status
 | 
					      status
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue