mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
45 lines
1.9 KiB
HTML
45 lines
1.9 KiB
HTML
---
|
|
layout: docs
|
|
title: MessageStoreExtension
|
|
edit_url: "https://github.com/nylas/N1/blob/master/src/flux/stores/message-store-extension.coffee"
|
|
---
|
|
|
|
<h2>Summary</h2>
|
|
|
|
<div class="markdown-from-sourecode">
|
|
<p><p>MessageStoreExtension is an abstract base class. To create MessageStoreExtension
|
|
that customize message viewing, you should subclass <a href='messagestoreextension.html'>MessageStoreExtension</a> and
|
|
implement the class methods your plugin needs.</p>
|
|
<p>To register your extension with the MessageStore, call <a href='MessageStore.html#registerExtension'>MessageStore::registerExtension</a>.
|
|
When your package is being unloaded, you <em>must</em> call the corresponding
|
|
<a href='MessageStore.html#unregisterExtension'>MessageStore::unregisterExtension</a> to unhook your extension.</p>
|
|
<pre><code class="lang-coffee">activate: ->
|
|
MessageStore.<span class="hljs-function"><span class="hljs-title">registerExtension</span><span class="hljs-params">(MyExtension)</span></span>
|
|
|
|
...
|
|
|
|
deactivate: ->
|
|
MessageStore.<span class="hljs-function"><span class="hljs-title">unregisterExtension</span><span class="hljs-params">(MyExtension)</span></span>
|
|
</code></pre>
|
|
<p>The MessageStoreExtension API does not currently expose any asynchronous or <a href='https://github.com/petkaantonov/bluebird/blob/master/API.md'>Promise</a>-based APIs.
|
|
This will likely change in the future. If you have a use-case for a Message Store extension that
|
|
is not possible with the current API, please let us know.</p>
|
|
</p>
|
|
</div>
|
|
|
|
<ul>
|
|
</ul>
|
|
|
|
|
|
|
|
<h3>Class Methods</h3>
|
|
|
|
<h4 id=formatMessageBody class="function-name">
|
|
formatMessageBody(<span class="args"></span>) <a href="#formatMessageBody" class="link"></a>
|
|
</h4>
|
|
|
|
<div class="function-description markdown-from-sourecode">
|
|
<p><p>Transform the message body HTML provided in <code>body</code> and return HTML
|
|
that should be displayed for the message.</p>
|
|
</p>
|
|
</div>
|