mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 12:40:08 +08:00
f152cca4d6
Summary: This diff implements Gmails "load images, always load images from bengotow@gmail.com" option. Someone asked for it late last night and I figured it'd be fun to add. We also needed to refactor the MessageItem to allow for a GPG plugin - MessageItems now subscribe to the body of the message from the messageBodyProcessor, so in the event that processing rules change, someone can invalidate the processor cache by calling `resetCache()`, and then it recomputes bodies and triggers a refresh of each message body. Test Plan: Updated existing tests, no new tests for this plugin just yet. Reviewers: evan, juan Reviewed By: evan Differential Revision: https://phab.nylas.com/D2235
20 lines
785 B
CoffeeScript
20 lines
785 B
CoffeeScript
React = require 'react'
|
|
AutoloadImagesStore = require './autoload-images-store'
|
|
Actions = require './autoload-images-actions'
|
|
|
|
class AutoloadImagesHeader extends React.Component
|
|
@displayName: 'AutoloadImagesHeader'
|
|
|
|
constructor: (@props) ->
|
|
|
|
render: =>
|
|
if AutoloadImagesStore.shouldBlockImagesIn(@props.message)
|
|
<div className="autoload-images-header">
|
|
<a className="option" onClick={ => Actions.temporarilyEnableImages(@props.message) }>Show Images</a>
|
|
<span style={paddingLeft: 10, paddingRight: 10}>|</span>
|
|
<a className="option" onClick={ => Actions.permanentlyEnableImages(@props.message) }>Always show images from {@props.message.fromContact().toString()}</a>
|
|
</div>
|
|
else
|
|
<div></div>
|
|
|
|
module.exports = AutoloadImagesHeader
|