diff --git a/ape/talk.hoon b/ape/talk.hoon index 7bdbfa43c..72946b620 100644 --- a/ape/talk.hoon +++ b/ape/talk.hoon @@ -1376,6 +1376,8 @@ ~& [%bad-subscribe-story-c i.t.pax] (ra-evil %talk-no-story) =+ soy=~(. pa i.t.pax u.pur) + ?. (pa-visible:soy her) + (ra-evil %talk-no-story) =^ who +>.$ (ra-human her) =. soy ?.((~(has in vab) %a) soy (pa-watch-group:soy her)) =. soy ?.((~(has in vab) %v) soy (pa-watch-glyph:soy her)) @@ -1466,6 +1468,16 @@ ::== & :: + ++ pa-visible :: display to + |= her=ship + ^- ? + ?- p.cordon.shape + %black & + %green & + %brown =(her our.hid) + %white (~(has in q.cordon.shape) her) + == + :: ++ pa-report :: update |= [wac=(set bone) caw=report] :: ~& [%pa-report man -.caw] diff --git a/pub/talk/hymn.hook b/pub/talk/hymn.hook index a8abed343..16184e286 100644 --- a/pub/talk/hymn.hook +++ b/pub/talk/hymn.hook @@ -2,6 +2,16 @@ :: :::: /hook/hymn/fab/talk/pub/ :: +/+ talk +/= gas /$ fuel :: get request info +=+ aut=?=(~ but.gas) +=+ ^- man=span + ~| bad-path/but.gas + %- need + ?+ but.gas ~ + [@ ~] ((sand %ta) i.but.gas) + ~ (some (main:talk (slav %p -:%))) + == |% ++ cdnj |= a=wall ^- marl @@ -21,8 +31,7 @@ "lodash.js/2.4.1/lodash.min.js" "react/0.13.1/react.js" == - :: remove /~~ for anon - ;script(type "text/javascript", src "/~~/~/at/home/lib/urb.js"); + ;script(type "text/javascript", src "{?:(aut "/~~" "")}/~/at/home/lib/urb.js"); ;meta(name "viewport", content "width=device-width, height=device-height, ". "initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"); ;link(type "text/css", rel "stylesheet", href "/home/pub/talk/src/css/main.css"); @@ -35,6 +44,7 @@ ;div#writing-container; ;div#scrolling: BOTTOM == + ;script: window.talk = {(pojo (joba 'mainStation' s/man))} ;script(type "text/javascript", src "/home/pub/talk/src/js/main.js"); == == diff --git a/pub/talk/src/js/components/MessagesComponent.coffee b/pub/talk/src/js/components/MessagesComponent.coffee index f775649ce..c337106b2 100644 --- a/pub/talk/src/js/components/MessagesComponent.coffee +++ b/pub/talk/src/js/components/MessagesComponent.coffee @@ -90,7 +90,7 @@ module.exports = recl last:MessageStore.getLast() fetching:MessageStore.getFetching() listening:MessageStore.getListening() - station:window.util.mainStation() + station:window.talk.mainStation stations:StationStore.getStations() configs:StationStore.getConfigs() typing:MessageStore.getTyping() diff --git a/pub/talk/src/js/components/StationComponent.coffee b/pub/talk/src/js/components/StationComponent.coffee index f6973e028..7cd76078b 100644 --- a/pub/talk/src/js/components/StationComponent.coffee +++ b/pub/talk/src/js/components/StationComponent.coffee @@ -10,7 +10,7 @@ module.exports = recl stateFromStore: -> { audi:StationStore.getAudience() members:StationStore.getMembers() - station:window.util.mainStation() + station:window.talk.mainStation stations:StationStore.getStations() configs:StationStore.getConfigs() typing:StationStore.getTyping() @@ -73,6 +73,9 @@ module.exports = recl StationActions.setSources @state.station,_sources render: -> + if window.urb.user isnt window.urb.ship #foreign + return div {id:"station"} + parts = [] members = [] diff --git a/pub/talk/src/js/components/WritingComponent.coffee b/pub/talk/src/js/components/WritingComponent.coffee index fd8bf36bf..795df136f 100644 --- a/pub/talk/src/js/components/WritingComponent.coffee +++ b/pub/talk/src/js/components/WritingComponent.coffee @@ -108,7 +108,9 @@ module.exports = recl @cursorAtEnd addCC: (audi) -> - listening = @state.config[window.util.mainStation(window.urb.user)].sources + if window.urb.user isnt window.urb.ship #foreign + return audi + listening = @state.config[window.util.mainStation(window.urb.user)]?.sources ? [] cc = false for s in audi if listening.indexOf(s) is -1 @@ -251,6 +253,9 @@ module.exports = recl _onChangeStore: -> @setState @stateFromStore() render: -> + # if window.urb.user isnt window.urb.ship #foreign + # return div {className:"writing"} + user = "~"+window.urb.user iden = StationStore.getMember(user) ship = if iden then iden.ship else user @@ -262,7 +267,7 @@ module.exports = recl audi[k] = v.slice(1) k = "writing" - + div {className:k}, [ (div {className:"attr"}, [ (React.createElement Member, iden) diff --git a/pub/talk/src/js/main.coffee b/pub/talk/src/js/main.coffee index 2ac64c711..a3ea6156d 100644 --- a/pub/talk/src/js/main.coffee +++ b/pub/talk/src/js/main.coffee @@ -3,7 +3,6 @@ $(() -> rend = React.render - window.talk = {} window.talk.online = yes setInterval (-> diff --git a/pub/talk/src/js/main.js b/pub/talk/src/js/main.js index 3c5d2a4fd..e522a1722 100644 --- a/pub/talk/src/js/main.js +++ b/pub/talk/src/js/main.js @@ -403,7 +403,7 @@ module.exports = recl({ last: MessageStore.getLast(), fetching: MessageStore.getFetching(), listening: MessageStore.getListening(), - station: window.util.mainStation(), + station: window.talk.mainStation, stations: StationStore.getStations(), configs: StationStore.getConfigs(), typing: MessageStore.getTyping(), @@ -573,7 +573,7 @@ module.exports = recl({ return { audi: StationStore.getAudience(), members: StationStore.getMembers(), - station: window.util.mainStation(), + station: window.talk.mainStation, stations: StationStore.getStations(), configs: StationStore.getConfigs(), typing: StationStore.getTyping(), @@ -648,6 +648,11 @@ module.exports = recl({ }, render: function() { var _remove, _sources, members, parts, sourceCtrl, sourceInput, sources; + if (window.urb.user !== window.urb.ship) { + return div({ + id: "station" + }); + } parts = []; members = []; if (this.state.station && this.state.members) { @@ -825,8 +830,11 @@ module.exports = recl({ return this.cursorAtEnd; }, addCC: function(audi) { - var cc, i, len, listening, s; - listening = this.state.config[window.util.mainStation(window.urb.user)].sources; + var cc, i, len, listening, ref1, ref2, s; + if (window.urb.user !== window.urb.ship) { + return audi; + } + listening = (ref1 = (ref2 = this.state.config[window.util.mainStation(window.urb.user)]) != null ? ref2.sources : void 0) != null ? ref1 : []; cc = false; for (i = 0, len = audi.length; i < len; i++) { s = audi[i]; @@ -1057,7 +1065,6 @@ $(function() { var $c, MessagesComponent, StationActions, StationComponent, WritingComponent, rend; StationActions = require('./actions/StationActions.coffee'); rend = React.render; - window.talk = {}; window.talk.online = true; setInterval((function() { window.talk.online = window.urb.poll.dely < 500; @@ -6719,7 +6726,7 @@ _.merge(window.util, { }, mainStation: function(user) { if (user == null) { - user = window.urb.user; + user = window.urb.ship; } switch (user.length) { case 3: diff --git a/pub/talk/src/js/util.coffee b/pub/talk/src/js/util.coffee index 7841ab2fd..19ec81eb8 100644 --- a/pub/talk/src/js/util.coffee +++ b/pub/talk/src/js/util.coffee @@ -5,7 +5,7 @@ _.merge window.util, mainStationPath: (user = window.urb.user) -> "~#{user}/#{window.util.mainStation(user)}" - mainStation: (user = window.urb.user) -> + mainStation: (user = window.urb.ship) -> switch user.length when 3 return "court"