From d515ef44285757ba95d61c4ca298139ef7f2ff34 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Mon, 15 Jul 2019 10:21:54 -0700 Subject: [PATCH] Add announcements work --- apps/chat/src/js/components/new.js | 2 +- apps/chat/src/js/components/root.js | 7 +-- apps/chat/urbit/app/chat.hoon | 38 +++++++++++++++- apps/chat/urbit/app/chat/js/index.js | 65 +++++++++++++--------------- 4 files changed, 68 insertions(+), 44 deletions(-) diff --git a/apps/chat/src/js/components/new.js b/apps/chat/src/js/components/new.js index 5a873abccc..3822896cfb 100644 --- a/apps/chat/src/js/components/new.js +++ b/apps/chat/src/js/components/new.js @@ -50,7 +50,7 @@ export class NewScreen extends Component { create: { nom: state.idName, des: "chatroom", - sec: "journal" + sec: "village" } }, { diff --git a/apps/chat/src/js/components/root.js b/apps/chat/src/js/components/root.js index ed9f5bf331..739909db10 100644 --- a/apps/chat/src/js/components/root.js +++ b/apps/chat/src/js/components/root.js @@ -36,11 +36,7 @@ export class Root extends Component { let configs = !!state.configs ? state.configs : {}; let circles = Object.keys(configs).filter((conf) => { - if (!configs[conf]) { - return false; - } - let cap = configs[conf].cap; - return cap === 'dm' || cap === 'chatroom'; + return !!configs[conf] && conf.split('/')[1] !== 'i'; }); let messages = _.get(state, 'messages', {}); @@ -112,7 +108,6 @@ export class Root extends Component {
-

Cmd + N to start a new chat

diff --git a/apps/chat/urbit/app/chat.hoon b/apps/chat/urbit/app/chat.hoon index 76eebb4fc7..e9d4250734 100644 --- a/apps/chat/urbit/app/chat.hoon +++ b/apps/chat/urbit/app/chat.hoon @@ -58,14 +58,48 @@ =/ inboxwir /circle/[(scot %p our.bol)]/inbox/config/group =/ inboxi/poke :- %hall-action - [%source %inbox %.y (silt [[our.bol %i] ~]~)] - :_ this + [%source %inbox %.y (silt [[our.bol %i] ~]~)] + =/ fakeannounce=poke + :- %hall-action + [%create %hall-internal-announcements '' %village] + =/ announce=poke + :- %hall-action + [%create %announcements 'Announcements from Tlon' %journal] + =/ help=poke + :- %hall-action + [%create %urbit-help 'Get help about Urbit' %channel] + =/ dev=poke + :- %hall-action + [%create %urbit-dev 'Chat about developing on Urbit' %channel] + =/ sourcefakeannounce/poke + :- %hall-action + [%source %inbox %.y (silt [[our.bol %hall-internal-announcements] ~]~)] + =/ sourceannounce/poke + :- %hall-action + [%source %inbox %.y (silt [[~marzod %announcements] ~]~)] + =/ hallactions=(list move) + ?: =((clan:title our.bol) %czar) + ~ + ?: =(our.bol ~marzod) + ~& %marzod-chat + :- [ost.bol %poke /announce [our.bol %hall] announce] + [ost.bol %poke /announce [our.bol %hall] sourceannounce]~ + ?: =(our.bol ~dopzod) + ~& %dopzod-chat + :- [ost.bol %poke /announce [our.bol %hall] dev] + [ost.bol %poke /announce [our.bol %hall] help]~ + :- [ost.bol %poke /announce [our.bol %hall] fakeannounce] + :- [ost.bol %poke /announce [our.bol %hall] sourcefakeannounce] + [ost.bol %poke /announce [our.bol %hall] sourceannounce]~ + =/ moves=(list move) :~ [ost.bol %peer inboxwir [our.bol %hall] inboxpat] [ost.bol %peer circlespat [our.bol %hall] circlespat] [ost.bol %connect / [~ /'~chat'] %chat] [ost.bol %poke /chat [our.bol %hall] inboxi] [ost.bol %poke /chat [our.bol %launch] launcha] == + :_ this + %+ weld moves hallactions :- [ost.bol %poke /chat [our.bol %launch] launcha]~ this(sta u.old) :: diff --git a/apps/chat/urbit/app/chat/js/index.js b/apps/chat/urbit/app/chat/js/index.js index 2c02b0b536..4cdb8687ab 100644 --- a/apps/chat/urbit/app/chat/js/index.js +++ b/apps/chat/urbit/app/chat/js/index.js @@ -57734,7 +57734,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\ create: { nom: state.idName, des: "chatroom", - sec: "journal" + sec: "village" } }, { @@ -57897,11 +57897,7 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\ let configs = !!state.configs ? state.configs : {}; let circles = Object.keys(configs).filter((conf) => { - if (!configs[conf]) { - return false; - } - let cap = configs[conf].cap; - return cap === 'dm' || cap === 'chatroom'; + return !!configs[conf] && conf.split('/')[1] !== 'i'; }); let messages = lodash.get(state, 'messages', {}); @@ -57953,8 +57949,8 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\ } return ( - react.createElement(BrowserRouter, {__self: this, __source: {fileName: _jsxFileName$j, lineNumber: 95}} - , react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$j, lineNumber: 96}} + react.createElement(BrowserRouter, {__self: this, __source: {fileName: _jsxFileName$j, lineNumber: 91}} + , react.createElement('div', {__self: this, __source: {fileName: _jsxFileName$j, lineNumber: 92}} , react.createElement(Route, { exact: true, path: "/~chat", render: (props) => { return ( @@ -57967,19 +57963,18 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\ unreads: unreads, api: api, inviteConfig: inviteConfig, - ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 102}} + ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 98}} ) - , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 100}} - , react.createElement('div', { className: "w-100 h-100 fr" , style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 112}} - , react.createElement('div', { className: "dt w-100 h-100" , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 113}} - , react.createElement('div', { className: "dtc center v-mid w-100 h-100 bg-white" , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 114}} - , react.createElement('p', { className: "tc", __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 115}}, "Cmd + N to start a new chat" ) + , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 96}} + , react.createElement('div', { className: "w-100 h-100 fr" , style: { flexGrow: 1 }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 108}} + , react.createElement('div', { className: "dt w-100 h-100" , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 109}} + , react.createElement('div', { className: "dtc center v-mid w-100 h-100 bg-white" , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 110}} ) ) ) ) ); - }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 97}} ) + }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 93}} ) , react.createElement(Route, { exact: true, path: "/~chat/new", render: (props) => { return ( @@ -57993,18 +57988,18 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\ unreads: unreads, api: api, inviteConfig: inviteConfig, - ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 128}} + ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 123}} ) - , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 125}} + , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 120}} , react.createElement(NewScreen, { setSpinner: this.setSpinner, api: api, circles: circles, - ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 138}} + ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 133}} ) ) ); - }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 122}} ) + }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 117}} ) , react.createElement(Route, { exact: true, path: "/~chat/join/:ship/:station", render: (props) => { return ( @@ -58017,17 +58012,17 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\ unreads: unreads, api: api, inviteConfig: inviteConfig, - ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 152}} + ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 147}} ) - , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 150}} + , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 145}} , react.createElement(LandingScreen, { api: api, configs: configs, - ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 162}} + ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 157}} ) ) ); - }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 147}} ) + }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 142}} ) , react.createElement(Route, { exact: true, path: "/~chat/:ship/:station", render: (props) => { let station = @@ -58045,20 +58040,20 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\ unreads: unreads, api: api, inviteConfig: inviteConfig, - ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 180}} + ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 175}} ) - , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 178}} + , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 173}} , react.createElement(ChatScreen, { api: api, configs: configs, messages: messages, peers: state.peers, subscription: subscription, - ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 190}} + ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 185}} ) ) ); - }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 170}} ) + }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 165}} ) , react.createElement(Route, { exact: true, path: "/~chat/:ship/:station/members", render: (props) => { return ( @@ -58071,17 +58066,17 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\ unreads: unreads, api: api, inviteConfig: inviteConfig, - ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 206}} + ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 201}} ) - , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 204}} + , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 199}} , react.createElement(MemberScreen, { ...props, api: api, - peers: state.peers, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 216}} + peers: state.peers, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 211}} ) ) ); - }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 201}} ) + }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 196}} ) , react.createElement(Route, { exact: true, path: "/~chat/:ship/:station/settings", render: (props) => { return ( @@ -58095,19 +58090,19 @@ lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes\ unreads: unreads, api: api, inviteConfig: inviteConfig, - ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 230}} + ...props, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 225}} ) - , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 227}} + , __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 222}} , react.createElement(SettingsScreen, { ...props, setSpinner: this.setSpinner, api: api, peers: state.peers, - circles: state.circles, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 240}} + circles: state.circles, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 235}} ) ) ); - }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 224}} ) + }, __self: this, __source: {fileName: _jsxFileName$j, lineNumber: 219}} ) ) ) )