From 45f0136ceb89ce92f55f388a8e5f594bcd3e2076 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 24 Apr 2016 12:33:00 +0000 Subject: [PATCH] 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 --- core/core.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/core.js b/core/core.js index e8873da9..34b34ea9 100644 --- a/core/core.js +++ b/core/core.js @@ -150,9 +150,10 @@ function postMessageInternal(from, to, message) { return invoke(to.eventHandlers['onMessage'], [getUser(from, from), message]); } -function getService(service) { - var process = this; - var serviceProcess = getServiceProcess(process.packageOwner, process.packageName, service); +function getService(service, packageName) { + let process = this; + let serviceName = process.packageName + '_' + service; + let serviceProcess = getServiceProcess(process.packageOwner, packageName || process.packageName, serviceName); return serviceProcess.ready.then(function() { return { postMessage: postMessageInternal.bind(process, process, serviceProcess),