mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 13:44:41 +08:00
6315bc9d80
Summary: - Rewrites composer extension adpater to support all versions of the ComposerExtension API we've ever declared. This will allow old plugins (or plugins that haven't been reinstalled after update) to keep functioning without breaking N1 - Adds specs Test Plan: - Unit tests Reviewers: evan, bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D2399
11 lines
427 B
CoffeeScript
11 lines
427 B
CoffeeScript
AutoloadImagesStore = require './autoload-images-store'
|
|
{MessageViewExtension} = require 'nylas-exports'
|
|
|
|
class AutoloadImagesExtension extends MessageViewExtension
|
|
|
|
@formatMessageBody: ({message}) ->
|
|
if AutoloadImagesStore.shouldBlockImagesIn(message)
|
|
message.body = message.body.replace AutoloadImagesStore.ImagesRegexp, (match, prefix, imageUrl) ->
|
|
"#{prefix}#"
|
|
|
|
module.exports = AutoloadImagesExtension
|