forked from cory/tildefriends
All of the changes that have been sitting on tildepi for ages. For posterity.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3530 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
15
packages/cory/messages/messages.js
Normal file
15
packages/cory/messages/messages.js
Normal file
@ -0,0 +1,15 @@
|
||||
if (imports.terminal) {
|
||||
core.register("onMessage", function(sender, message) {
|
||||
terminal.print(JSON.stringify(core.user.index), " ", message);
|
||||
});
|
||||
|
||||
core.register("onInput", function(input) {
|
||||
core.getService("global").then(function(service) {
|
||||
service.postMessage(input);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
core.register("onMessage", function(sender, message) {
|
||||
core.broadcast(message);
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user