13-swipe-p2p chat app/index.js
// Responds if the user or the peer is typing

Responds if the user or the peer is typing
Responds if the user or the peer is typing
function typing(bool) {
	if (!isConn)
		return false;
	if (bool == true && !typing_p) {
		peer.send('{"type" : "typing", "value" : true}');
		typing_p = true;
	}
	else if (bool == false) {
		peer.send('{"type" : "typing", "value" : false}');
		typing_p = false;
	}
	return true;
}
function typing ( bool ) { if ( ! isConn ) return false ; if ( bool == true && ! typing_p ) { peer . send ( '{"type" : "typing", "value" : true}' ) ; typing_p = true ; } else if ( bool == false ) { peer . send ( '{"type" : "typing", "value" : false}' ) ; typing_p = false ; } return true ; }
Responds if the user or the peer is typing
Responds if the user or the peer is typing