When user inputs 1 char into text field trigger event with data userid and oponentid. On the other side listen for such event if so trigger typing text or whatever make it last 10 sec after wich hide. Now back to the starting point after 10 sec get textarea total crars count on +1 again trigger event. On the other side if New message is detected hide typing.
What do you think it's dirty but will do.