コミットグラフ

91 コミット

作成者 SHA1 メッセージ 日付
n9k 0352358611 Compress some responses
Adds dependency `quart-compress`
2022-06-09 01:34:59 +00:00
n9k 73824f70d7 Lock js chat scroll when not at bottom 2022-06-09 01:34:59 +00:00
n9k dab389abcc More precise debug messages when segment generator exits 2022-06-09 01:34:45 +00:00
n9k 4eaf9b56f7 Try to ensure websocket is closed when forgetting about it
Might not be necessary, but if it is then it prevents a sitation where a
websocket is still open but we've forgotten about it, so we will never
broadcast any new messages to it and the client will be practically frozen in
time until they disconnect and open a new websocket.

Also update the user's last_seen when the websocket is closed. This prevents a
user with js enabled who's actually idle being considered absent and being
rotated when their websocket accidentally closes for a few seconds.
2022-03-10 07:47:57 +13:00
n9k 88fc9493cf v1.0.1 2022-03-10 07:47:46 +13:00
n9k e36bf78a18 Merge branch 'dev' 2022-03-10 07:47:01 +13:00
n9k ca669833e3 CSS: add `white-space: pre-wrap;` to chat messages 2022-03-10 07:46:53 +13:00
n9k e14cd4c09c Merge branch 'dev' 2022-03-10 07:46:23 +13:00
n9k cda687294e Nojs chat: fix users names/tripcodes having wrong colors 2022-03-10 07:45:56 +13:00
n9k 6249fdd840 Merge branch 'dev' 2022-03-09 17:43:35 +13:00
n9k 66eabd67af CSS: add `overflow: hidden;` to chat messages
Stops messages being able to obscure other messages with weird unicode
characters.
2022-03-09 17:42:44 +13:00
n9k 5df441abd8 Add venv/ to .gitignore 2022-03-09 16:58:04 +13:00
n9k 4c491e5318 v1.0.0 2022-03-09 16:57:59 +13:00
n9k a1b1147140 Add instructions 2022-03-08 17:07:55 +13:00
n9k 829f3f004b Add licences 2022-03-08 16:41:47 +13:00
n9k d6506ef9bf Add requirements.txt 2022-03-08 16:13:22 +13:00
n9k 4bab173237 Add Content Security Policy meta tags 2022-03-08 16:13:22 +13:00
n9k 5bd5d7ff6d Nojs chat form: more accesskeys 2022-03-08 16:13:22 +13:00
n9k 4cde4ea07a Add js appearance form (not complete c.f. nojs) 2022-03-08 16:13:22 +13:00
n9k ce5b7ba0ba Fix js memory leak
Already existing tripcode css rules were being re-inserted because of a typo.
2022-03-08 16:13:22 +13:00
n9k 55c16d7214 Nojs chat form: use `:checked` instead of `:target`
This works around a bug in mobile Firefox where under certain cirucmstances two
elements inside an iframe both become the iframe's target elment at the same
time, which breaks the CSS logic so instead of exactly one form being displayed,
nothing is displayed.
2022-03-08 16:13:22 +13:00
n9k 9c5fc4bc71 Keyboard accessible js captcha 2022-03-08 16:13:22 +13:00
n9k f48a27525e Autofocus chat form textarea 2022-03-08 16:13:22 +13:00
n9k 0ce1902918 Show notice from websocket in js chat form 2022-03-08 16:13:22 +13:00
n9k 5153f5d112 Add config option for old tripcode algorithm 2022-03-08 16:13:22 +13:00
n9k ade3ca4e9e Add broadcaster insignia
Also surrounded users' name tags in <b> (HTML) tags.
2022-03-08 16:13:21 +13:00
n9k 9ebcf57de5 Nojs uptime counter 2022-03-07 16:36:36 +13:00
n9k 5590fbbdbe Chat: use breaking space between name and message 2022-03-07 12:56:08 +13:00
n9k 2bb23ab4c4 Rename templates & routes to fit naming scheme 2022-03-07 12:56:08 +13:00
n9k c103de9849 Add meta viewport tags 2022-03-07 12:56:08 +13:00
n9k bb3002ffd5 Nojs chat: add fallback meta refresh to redirect url
Hacky workaround of weird behaviour in Firefox where on a page whose url has a
fragment/hash/anchor in it, sometimes a urlless meta refresh tag will jump to
the element instead of refreshing the page. Same thing happens if the meta
refresh tag's url component is the same as the page's url.
2022-03-07 12:56:08 +13:00
n9k 46fce9c393 Add nojs 'Reload stream' button
The nojs button appears when the stream is online and the user is not watching.
The js button appears when the stream is online and the media element either
(1) is not using the network or (2) fires an error event.
2022-03-07 12:56:08 +13:00
n9k 2763891a4e Nojs chat: only deverify user when they leave a message
Matches the behaviour of the js chat. Makes it so if you submit an empty
message but with a correct captcha, you won't be deverified and given another
captcha until you successfully send a message (and exceed the flood threshold).
Previously you could fill in the captcha with no message and be given back a
new captcha, which doesn't make that much sense.
2022-03-07 12:56:08 +13:00
n9k d4b0594103 Add `?token=...` to every url 2022-03-07 12:56:08 +13:00
n9k 6eda20a244 Add 'Reload stream' button in js 2022-03-07 12:56:08 +13:00
n9k edddbf00bc Show tripcodes in users list 2022-03-07 12:56:08 +13:00
n9k 7962de87e3 WS: combine `uptime` and `viewership` into `stats`
If the stream is offline, `stats` is null, otherwise it contains uptime and
viewership.
2022-03-07 12:56:08 +13:00
n9k ba90e18e30 Minor changes to the appearance of the users list
Made the 'Users in chat' header above the overflow area, so it always stays on
top. Now using `visibility: hidden;` instead of `display: none;` to show/hide
messages/users so that nojs css animations don't reset.
2022-03-07 12:56:08 +13:00
n9k a970368ee6 Nojs users list: add meta refresh tag & timeout 2022-03-07 12:56:08 +13:00
n9k 84ec253001 Show list of watching/non-watching users with js 2022-03-07 12:56:08 +13:00
n9k bfa77b738d Tell websockets which users are watching
This adds a field 'watching' in `user_for_websocket` that's True iff WATCHING,
False iff NOTWATCHING, and None otherwise (since clients don't need to know if
a user is tentative or absent). When the value of this field changes for any
user, they get added to the update buffer (like with any other change).

Removed race condition in `t_sunset_users`: `broadcast_users_update` was being
called *after* a user was removed from memory (and for each user being removed,
which was redundant). In that scenario if there's a user in the update buffer
and `t_sunset_users` wins the race between it and `t_broadcast_users_update`,
then when `t_sunset_users` calls `broadcast_users_update` a KeyError would be
raised since the user's already been removed.

Fixed unintended behaviour of `t_sunset_users`: it was removing users based on
the result of `is_visible`, so users who were actually tenative (as opposed to
absent) were being removed.
2022-03-07 12:54:35 +13:00
n9k 2b1cf7d7b0 CSS: make users button lighter 2022-03-07 12:54:35 +13:00
n9k 1b26ddb816 Nojs chat: add list of watching/non-watching users 2022-03-07 12:54:35 +13:00
n9k 3583005123 Link to git repos 2022-03-07 12:54:35 +13:00
n9k 8589216bf1 Send new captcha over websocket with js 2022-03-07 12:54:35 +13:00
n9k 3016705783 Keep track of stream viewership (number of viewers) 2022-03-07 12:54:35 +13:00
n9k da6e0352b8 Beautify nojs chat template, strip jinja whitespace 2022-03-07 12:54:35 +13:00
n9k a3b18bdc9f Background task for broadcasting title/uptime changes 2022-03-07 12:54:35 +13:00
n9k c36d2b2c38 Catch exception when inbound websocket data is not JSON 2022-03-07 12:54:35 +13:00
n9k 8b4d6e8c09 Get stream title from disk
By default from `title.txt`. Also replace newlines with spaces when setting the
title in js, for parity with the nojs info iframe.
2022-03-07 12:54:35 +13:00