Let processes post messages to other packages with the same owner.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3216 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2016-04-24 12:33:00 +00:00
parent b265d65e11
commit 45f0136ceb

View File

@ -150,9 +150,10 @@ function postMessageInternal(from, to, message) {
return invoke(to.eventHandlers['onMessage'], [getUser(from, from), message]); return invoke(to.eventHandlers['onMessage'], [getUser(from, from), message]);
} }
function getService(service) { function getService(service, packageName) {
var process = this; let process = this;
var serviceProcess = getServiceProcess(process.packageOwner, process.packageName, service); let serviceName = process.packageName + '_' + service;
let serviceProcess = getServiceProcess(process.packageOwner, packageName || process.packageName, serviceName);
return serviceProcess.ready.then(function() { return serviceProcess.ready.then(function() {
return { return {
postMessage: postMessageInternal.bind(process, process, serviceProcess), postMessage: postMessageInternal.bind(process, process, serviceProcess),