flow: fixes

This commit is contained in:
cha0s 2020-12-11 04:10:31 -06:00
parent 3b62c3fcc6
commit fffec4b8d4
8 changed files with 27 additions and 30 deletions

View File

@ -76,18 +76,13 @@ const About = () => (
is that space. If you think that anonymous people on the Internet saying is that space. If you think that anonymous people on the Internet saying
stupid/offensive/ignorant/inflammatory things sucks, then I urge you to stay out. There be stupid/offensive/ignorant/inflammatory things sucks, then I urge you to stay out. There be
dragons. You have been warned. You can go yell at them in there about it if you dragons. You have been warned. You can go yell at them in there about it if you
like.<br /><strong>That's the point!</strong> like.
<br />
<strong>Try it!</strong>
</p> </p>
<br /> <br />
<p className="about__caveat"> <p className="about__caveat">
Also keep in mind that <strong>but ye if you do anything actually illegal then you&apos;re on your own</strong>
{' '}
<strong>I can always see your IP address</strong>
,
{' '}
and
{' '}
<strong>if you do anything actually illegal, I won&apos;t cover for you.</strong>
</p> </p>
<h2>Bonus</h2> <h2>Bonus</h2>
<p>Let me tell you some facts about this site.</p> <p>Let me tell you some facts about this site.</p>

View File

@ -83,17 +83,11 @@ export default function Chat() {
} }
return ( return (
<ul className="activity"> <ul className="activity">
{Object.entries(activity).map(([chat, users]) => ( {Object.entries(activity).map(([chat]) => (
<li key={chat} className="activity__chat"> <li key={chat} className="activity__chat">
<Link className="activity__link" to={`/chat${chat}`}> <Link className="activity__link" to={`/chat${chat}`}>
<div className="activity__name">{chat}</div> <div className="activity__name">{chat}</div>
<div className="activity__stats"> <div className="activity__stats" />
<span className="activity__users">
{users.length}
{' '}
users
</span>
</div>
</Link> </Link>
</li> </li>
))} ))}

View File

@ -27,15 +27,20 @@
} }
.activity__link { .activity__link {
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.15);
color: #fff; color: #fff;
display: block; display: block;
font-family: var(--thick-title-font-family); font-family: var(--thick-title-font-family);
border: 0.1em solid rgba(0, 0, 0, 0.2);
border-radius: 1em;
padding: 2em; padding: 2em;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
width: 100%; width: 100%;
height: 100%; height: 100%;
&:hover {
background-color: rgba(0, 0, 0, 0.3);
}
} }
.activity__stats { .activity__stats {

View File

@ -65,7 +65,7 @@ export default function Header(props) {
<span className="tiny"> <span className="tiny">
{channel && `chatting ${'r' === channel.type ? 'in' : 'with'}`} {channel && `chatting ${'r' === channel.type ? 'in' : 'with'}`}
</span> </span>
<span>{!channel ? 'Touch a chat below!' : renderChannel(channel)}</span> <span>{!channel ? 'Pick a chat \\o/' : renderChannel(channel)}</span>
</Route> </Route>
</Switch> </Switch>
</div> </div>

View File

@ -47,7 +47,7 @@ export default function ChatRight() {
<div className="right__links"> <div className="right__links">
<Link className="right__link dismiss-side" to="/about">About</Link> <Link className="right__link dismiss-side" to="/about">About</Link>
<span className="right__linksBullet"></span> <span className="right__linksBullet"></span>
<a href="/auth/logout">Log out</a> <a className="right__link" href="/auth/logout">Log out</a>
</div> </div>
{0 === activeIndex && channelUsers.length > 0 && <Users />} {0 === activeIndex && channelUsers.length > 0 && <Users />}
{1 === activeIndex && blockedIds.length > 0 && <Blocked ids={blockedIds} />} {1 === activeIndex && blockedIds.length > 0 && <Blocked ids={blockedIds} />}

View File

@ -924,9 +924,10 @@
"@latus/governor@^1.0.0": "@latus/governor@^1.0.0":
version "1.0.0" version "1.0.0"
resolved "https://npm.i12e.cha0s.io/@latus%2fgovernor/-/governor-1.0.0.tgz#938731882b0c44c0c022edfe5c15364a5073a45b" resolved "https://npm.i12e.cha0s.io/@latus%2fgovernor/-/governor-1.0.0.tgz#e0f1ab9f4a287f09822b84a258f0b36d7ff1f25e"
integrity sha512-yU9gqx8B6lfinVAxjphTK/e1KCs3CSu4naolW0vzROA0IAlxfmLTjGtg3+tiowP8X9LBly0/xAsOEYGyn85cdw== integrity sha512-LDcZJGnIzL9mmP6+VRzvNK4LpxL3VI2z+/oDOZSwYoT7n+raxili8G8WRLQa9IiFSsDuClDnODY7JsisoBKtig==
dependencies: dependencies:
"@latus/db" "^1.0.0"
"@latus/redis" "^1.0.0" "@latus/redis" "^1.0.0"
"@latus/socket" "^1.0.0" "@latus/socket" "^1.0.0"
debug "4.3.1" debug "4.3.1"
@ -934,8 +935,8 @@
"@latus/http@^1.0.0": "@latus/http@^1.0.0":
version "1.0.0" version "1.0.0"
resolved "https://npm.i12e.cha0s.io/@latus%2fhttp/-/http-1.0.0.tgz#3bf1ed26bcdf113036560960fccc3bcf7f064a5d" resolved "https://npm.i12e.cha0s.io/@latus%2fhttp/-/http-1.0.0.tgz#bd1738418b392a340b1d42698005920ca05096c3"
integrity sha512-/WF9+z1Bv1MvnDHXfOwoWAmU8bF3OrB+UWmYBuBDEo5epdvcxLnWl3mQ6JjIucmyep5Q/nmdtqr3K36JehQUlw== integrity sha512-I3BWZ4nnwCq/SrqhQuTd7GP/8FdoZ++JdL3+IIBjzvvl4ayAZLNGHJ/90aw1RqxEeeIXbbGli976Sj84okCHCA==
dependencies: dependencies:
"@latus/core" "1.0.0" "@latus/core" "1.0.0"
"@neutrinojs/web" "^9.1.0" "@neutrinojs/web" "^9.1.0"
@ -984,8 +985,8 @@
"@latus/socket@^1.0.0": "@latus/socket@^1.0.0":
version "1.0.0" version "1.0.0"
resolved "https://npm.i12e.cha0s.io/@latus%2fsocket/-/socket-1.0.0.tgz#ff9dbcb38e3347ae8e7ccaba078ac9de8547d17c" resolved "https://npm.i12e.cha0s.io/@latus%2fsocket/-/socket-1.0.0.tgz#ac7cd764b30d9a7b4634d8cd93a356e4946cd1d4"
integrity sha512-O9bJ1j5hsg7LXzNV2eVpTNeORgus+TEo+eOsAKA9gxpq3yuQFfVZCUH3GITEKUljp1ejs9G0SZVKg7fC2bAibQ== integrity sha512-dzuC/ImZwfrSgL2hheqxsREsUUI/smWncSa1O5D47B1HUrToN4Jkomh0j6XfG4NLMw1O9dGT9BF3XYacZVylZg==
dependencies: dependencies:
"@latus/core" "^1.0.0" "@latus/core" "^1.0.0"
"@latus/http" "^1.0.0" "@latus/http" "^1.0.0"
@ -1177,8 +1178,8 @@
"@reddichat/chat@^1.0.0": "@reddichat/chat@^1.0.0":
version "1.0.0" version "1.0.0"
resolved "https://npm.i12e.cha0s.io/@reddichat%2fchat/-/chat-1.0.0.tgz#cd292e5573ae63c4c9ef65d3953bf3eae1dc890d" resolved "https://npm.i12e.cha0s.io/@reddichat%2fchat/-/chat-1.0.0.tgz#239d39dfb95e389d3a0ca0e7f9be1a44fe9bd7f0"
integrity sha512-SlTt4VkxpwYoNm7h4aQafgJBh57uU83+oErRDQgUIkl6AP46Ys9IFngajggImZfufoBCxQLXWBkVMeDNI/xqWg== integrity sha512-f0FuntN0X6avb7ZcJYnQR6Jewsme1DfXE5MxEIYgXnLlPaYYVaWr5uV3TUmLGeCNghfW6t1+cLkFYPEW2RADhw==
dependencies: dependencies:
"@latus/core" "^1.0.0" "@latus/core" "^1.0.0"
"@latus/db" "^1.0.0" "@latus/db" "^1.0.0"

View File

@ -10,8 +10,9 @@ export default (latus) => class ActivityServer extends Activity(latus) {
static async respond(packet, {req}) { static async respond(packet, {req}) {
const {config: {'%redisAdapter': adapter}} = latus; const {config: {'%redisAdapter': adapter}} = latus;
const rooms = promisify(adapter.allRooms.bind(adapter)); const rooms = promisify(adapter.allRooms.bind(adapter));
const chats = (await rooms()) const chats = Array.from(new Set((await rooms())
.filter((room) => room.match(/^\/r\//)); .concat(['/r/reddichat', '/r/anonymous'])
.filter((room) => room.match(/^\/r\//))).values());
const activity = Object.fromEntries(await Promise.all(chats.map(async (chat) => [ const activity = Object.fromEntries(await Promise.all(chats.map(async (chat) => [
chat, chat,
Object.keys(await channelUserCounts(req, parseChannel(chat))), Object.keys(await channelUserCounts(req, parseChannel(chat))),

View File

@ -71,6 +71,7 @@ export default (latus) => class MessageServer extends Message(latus) {
pubClient pubClient
.multi() .multi()
.set(key, JSON.stringify({ .set(key, JSON.stringify({
ip: req.ip,
message, message,
owner, owner,
socket: socket.id, socket: socket.id,