bkad / prat

group chat with markdown served over websockets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

play sound when a chat is directed at a user and oochat is not focused

bkad opened this issue · comments

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 fucks up when alice@foo.com and alice@bar.com are logged into the same channel, but that's going to pretty rare for our use case.

use:

document.hasFocus() && !document.webkitHidden