bkad / prat Goto Github PK
View Code? Open in Web Editor NEWgroup chat with markdown served over websockets
group chat with markdown served over websockets
Allow the user to toggle between using Enter
and Shift+Enter
to send a message. Expose a little toggleable button to switch between the states.
There are really two parts to this, the actual design/implementation of the reconnection and the UI to let the user know what's happening.
Remember the open/close state of the left and right panels (channels/users). Use cookies.
This is important if we want to use Prat for any kind of corporate use. That way we can use it without VPN.
after X (say 5 for now) minutes of no new messages, the next message should create a new message container regardless of whether the author was the same.
expose a big ass trash can glyph when dragging channels to allow them to delete them
Where username
is the everything before the @
in the user's email address.
Currently we're creating a popup window when a user opens the login dialog. Setup Oauth2 / OpenID redirect URIs to fix this,
Turn #foo
into a channel link. Clicking it will add it to your list of channels if it isn't already in your channel list, then sets it as your current channel.
currently using the user's name, which can be the same for different emails.
mainstream gevent-zeromq has a green poller implementation now so the fork is no longer necessary
Thanks to @tobert for pointing this out. It would be stupid easy to support conference calls a la Campfire using Tropo:
https://www.tropo.com/docs/scripting/creating_conference_call.htm
Hit 'Preview' to see a Markdown-ified preview of your next message
I see two issues that both expose you to some kind of length extension attacks. @mdietz can tell you more :)
Lots of people get this wrong, but we should fix at some point.
I think a good example is AWS signature generation:
There is a weird bug that occurs if you switch channels. After switching, it will be at the bottom of the screen, but if you use the scroll wheel at all you'll suddenly jump to the top.
Youtube, vimeo, etc.
I started doing this but then realized it's a pain in the ass because of how callbacks work with sundown.
Here's a regex for youtube.com links to get started:
r"(https?://)?(www\.)?youtube\.com/watch\?\w*v=(?P<id>[0-9A-Za-z+)\w*"
Probably require user preferences in general.
Make the timestamps contextual rather than absolute, aka:
Finally:
To determine whether a user is online, we track all their open clients in a redis sets (under key: user-clients:[email protected]
, adding and removing clients as they connect/disconnect.
It's possible, however, for a client to connect, and add their key to the open clients set, and then fail (due to a server shutting down, or some other error). In order to evict these orphaned client ids, one could run a separate process which sends hooks into the pub/sub system, sends pings to clients, who send back pongs which include their client ids. The process could then determine which keys are valid in the redis client pool and evict those which aren't.
Could be a nice chance to write some gevent code. Could have a master thread tracking all open clients, which spawns randomly offset X
seconds from eachother and reaps a thread when the user the thread is tracking is has no open clients. Each child thread polls its open client pool every Y
, sends pings, waits Z
seconds, then evicts all client_ids which didnt send a pong.
Consider using zeptojs as a drop-in replacement for jquery.
In principle it seems nice because the library is smaller and drops support for older browsers.
might have to fork misaka/sundown to do this
http://packages.python.org/Flask-Login
Required to support multiple authentication mechanisms e.g issue #51
Not quite released yet, but soon the functionality of gevent_zeromq will be merged into pyzmq
OAuth2 is going to be better supported and give us finer grained control over the scopes we're asking for (email and profile scopes).
Accountchooser.com should give us a wrapper that will allow users to authenticate with the big 3-5 identity providers (Google, Facebook, Hotmail, Twitter, Yahoo). See: https://www.accountchooser.com/learnmore.html
Right now if you navigate to a different page and then navigate back, you'll get the view of the page when it loaded. subsequent messages will be appended, so you end up with a big gap of missing messages. You can reload the page to fix this.
We should use the HTML5 history API to fix this experience.
Right now whenever you refresh, you leave behind websocket file descriptors in a CLOSE_WAIT state. You hit the file descriptor cap for a process pretty quickly, and the process crashes in a blazing fire.
We'll need a keyboard shortcut help dialog of some kind as well.
Some initial ideas: (ctrl on linux/windows, cmd on mac)
j
/k
to scroll the message pane up and downctrl-u
/d
to scroll up and down by half a pageG
to scroll to the bottomctrl-n
/p
to switch next/previous channel?
open keyboard shortcut helpenter
to focus the text boxrefactor this into a function (something like get_db
) to make it easy to refactor if we switch datastores
detect if cursor is at the beginning of the message input. pressing up and down goes through your message history.
Whenever a new message comes in on a channel you're not active in, do something like accent the border of that channel to quietly inform the user that there are new messages to be read
Every minute (when timestamps refresh) the padding between the messages-container and the input-container collapses. It reappears if you open up chrome inspector.
We need something that isn't the most annoying sound ever.
like this
A chat is considered to be directed towards a person when a message includes @username
where username
is the everything before the @
in the user's email address.
This project needs tests. Right now, they would be valuable for the webserver code. The client code will likely become complex enough that you'll want coffeescript tests as well.
It sucks to work on a project when it's complex enough that you have no way of knowing that you're not breaking stuff.
Mozilla's persona project allows for federated login support using an email address as the identifier for a user (and the identity assertion is backed by some clever public key crypto so this should be more secure than any kind of bearer token based federated login system).
Once the socket disconnects and opens up again, have it queue up incoming messages while you fetch all the messages you missed. Then dump the missed messages + the queued messages into the DOM.
Necessary for using livecss in dev.
Right now, if I'm scrolled to the bottom and I make the window smaller, I'll be scrolled a little bit up. We should make the bottom "sticky"; i.e. if we're in "at the bottom" mode we should stay scrolled to the bottom if we resize the window.
going to get pretty messy if we continue having the rendering logic both client and server side
create a /rooms/:name
route
when a user navigates to it, it adds it to the list of the user's rooms and sets it as the current room
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.