mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-20 07:16:08 +08:00
Add thread-sharing plugin
Summary: Add thread-sharing plugin: - Add popover to enable sharing - Register custom nylas:// protocol to open a thread via protocol is thread exists Test Plan: Manual Reviewers: jackie, bengotow Reviewed By: jackie, bengotow Subscribers: jackie, halla Differential Revision: https://phab.nylas.com/D3265
This commit is contained in:
parent
0d67a593b4
commit
677a83b8f5
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -36,3 +36,4 @@ internal_packages/composer-scheduler
|
|||
internal_packages/link-tracking
|
||||
internal_packages/open-tracking
|
||||
internal_packages/send-later
|
||||
internal_packages/thread-sharing
|
||||
|
|
|
@ -45,10 +45,10 @@
|
|||
<dict>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>edgehill</string>
|
||||
<string>nylas</string>
|
||||
</array>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>Nylas Shared Session Protocol</string>
|
||||
<string>Nylas Protocol</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
ExtensionRegistry,
|
||||
WorkspaceStore} = require 'nylas-exports'
|
||||
|
||||
MessageList = require "./message-list"
|
||||
MessageList = require("./message-list")
|
||||
MessageListHiddenMessagesToggle = require('./message-list-hidden-messages-toggle').default
|
||||
|
||||
SidebarPluginContainer = require "./sidebar-plugin-container"
|
||||
|
|
0
internal_packages/message-list/lib/message-list.cjsx
Executable file → Normal file
0
internal_packages/message-list/lib/message-list.cjsx
Executable file → Normal file
|
@ -9,6 +9,7 @@ import PerformanceMonitor from './performance-monitor'
|
|||
import NylasProtocolHandler from './nylas-protocol-handler';
|
||||
import PackageMigrationManager from './package-migration-manager';
|
||||
import ConfigPersistenceManager from './config-persistence-manager';
|
||||
import LaunchServices from '../launch-services';
|
||||
|
||||
import {BrowserWindow, Menu, app, ipcMain, dialog} from 'electron';
|
||||
|
||||
|
@ -70,6 +71,13 @@ export default class Application extends EventEmitter {
|
|||
this.setupJavaScriptArguments();
|
||||
this.handleEvents();
|
||||
this.handleLaunchOptions(options);
|
||||
|
||||
if (process.platform === 'linux') {
|
||||
const services = new LaunchServices();
|
||||
services.registerForURLScheme('nylas');
|
||||
} else {
|
||||
app.setAsDefaultProtocolClient('nylas')
|
||||
}
|
||||
}
|
||||
|
||||
getMainWindow() {
|
||||
|
@ -671,6 +679,9 @@ export default class Application extends EventEmitter {
|
|||
if (protocol === 'mailto:') {
|
||||
const main = this.windowManager.get(WindowManager.MAIN_WINDOW);
|
||||
if (main) { main.sendMessage('mailto', urlToOpen) }
|
||||
} else if (protocol === 'nylas:') {
|
||||
const main = this.windowManager.get(WindowManager.MAIN_WINDOW);
|
||||
if (main) { main.sendMessage('openExternalThread', urlToOpen) }
|
||||
} else {
|
||||
console.log(`Ignoring unknown URL type: ${urlToOpen}`);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ const parseCommandLine = (argv) => {
|
|||
// On Windows and Linux, mailto and file opens are passed as the last argv
|
||||
if (argv.length > 1 && !argv.join(' ').includes('--squirrel')) {
|
||||
const lastArg = argv[argv.length - 1];
|
||||
if (lastArg.startsWith('mailto:')) {
|
||||
if (lastArg.startsWith('mailto:') || lastArg.startsWith('nylas:')) {
|
||||
urlsToOpen.push(lastArg);
|
||||
} else if ((lastArg[0] !== '-') && (/[\/|\\]/.test(lastArg))) {
|
||||
pathsToOpen.push(lastArg);
|
||||
|
|
|
@ -9,7 +9,7 @@ import React from 'react';
|
|||
*/
|
||||
|
||||
const Switch = (props) => {
|
||||
let classnames = "slide-switch";
|
||||
let classnames = `${props.className} slide-switch`;
|
||||
if (props.checked) {
|
||||
classnames += " active";
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ const Switch = (props) => {
|
|||
Switch.propTypes = {
|
||||
checked: React.PropTypes.bool,
|
||||
onChange: React.PropTypes.func.isRequired,
|
||||
className: React.PropTypes.string,
|
||||
};
|
||||
|
||||
export default Switch;
|
||||
|
|
2
src/pro
2
src/pro
|
@ -1 +1 @@
|
|||
Subproject commit b47405f99f77fe3149ddb55453013ab1058031a8
|
||||
Subproject commit 008319a8290e5eeaffbf763ba0f596195eec51d4
|
Loading…
Reference in a new issue