From 0c02b4a0b1b4adf4be530f6d81a2c5f2ea667ff0 Mon Sep 17 00:00:00 2001 From: Fang Date: Sat, 16 Dec 2017 16:26:55 +0100 Subject: [PATCH 1/2] Add json conversions to &hall-command. --- mar/hall/command.hoon | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/mar/hall/command.hoon b/mar/hall/command.hoon index 3e7106db8..1df81ddba 100644 --- a/mar/hall/command.hoon +++ b/mar/hall/command.hoon @@ -11,5 +11,30 @@ ++ grab :: convert from |% ++ noun command :: from %noun + ++ json :: from %json + => [. dejs:hall-json] ::TODO =, + =, dejs-soft:format + |= a/json + ^- command:hall + =- (need ((of -) a)) + :~ publish+(ar thot) + present+(ot nos+(as so) dif+disa ~) + :: bearing not needed + == + -- +:: +++ grow :: convert to + |% + ++ json :: to %json + => [. enjs:hall-json] ::TODO =, + =, enjs:format + %+ frond -.cod + :: only %publish has just a single piece of data. + ?: ?=($publish -.cod) a+(turn tos.cod thot) + %- pairs + ?+ -.cod !! + $present ~[nos+(sa nos.cod cord:enjs:hall-json) dif+(disa dif.cod)] + :: bearing nto needed + == -- -- From e5ed1662d640f04a2c9d9a3f444f27fced8bef8a Mon Sep 17 00:00:00 2001 From: Fang Date: Sat, 16 Dec 2017 16:37:49 +0100 Subject: [PATCH 2/2] Include urbit/talk#41 --- web/talk/main.js | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/web/talk/main.js b/web/talk/main.js index f1a451d04..38bde4875 100644 --- a/web/talk/main.js +++ b/web/talk/main.js @@ -1212,7 +1212,7 @@ module.exports = recl({ return; } if (this.props['audience-lock'] != null) { - audi = _.union(audi, ["~" + window.urb.ship + "/" + this.props.station]); + audi = ["~" + window.urb.ship + "/" + this.props.station]; } audi = this.addCC(audi); txt = this.$message.text().trim().replace(/\xa0/g, ' '); @@ -1542,18 +1542,12 @@ TreeActions.registerComponent("talk-station", StationComponent); },{"./actions/StationActions.coffee":2,"./components/MessageListComponent.coffee":6,"./components/StationComponent.coffee":7,"./components/WritingComponent.coffee":8,"./util.coffee":15}],11:[function(require,module,exports){ -var send, util; +var util; util = require('../util.coffee'); window.urb.appl = "hall"; -send = function(data, cb) { - return window.urb.send(data, { - mark: "hall-action" - }, cb); -}; - module.exports = function(arg) { var MessageActions; MessageActions = arg.MessageActions; @@ -1624,15 +1618,31 @@ module.exports = function(arg) { }); }, sendMessage: function(message, cb) { - return send({ - convey: [message] - }, function(err, res) { - console.log('sent'); - console.log(arguments); - if (cb) { - return cb(err, res); - } - }); + if (window.urb.user === window.urb.ship) { + return window.urb.send({ + convey: [message] + }, { + mark: "hall-action" + }, function(err, res) { + console.log('sent local'); + console.log(arguments); + if (cb) { + return cb(err, res); + } + }); + } else { + return window.urb.send({ + publish: [message] + }, { + mark: "hall-command" + }, function(err, res) { + console.log('sent remote'); + console.log(arguments); + if (cb) { + return cb(err, res); + } + }); + } } }; };