[Browser based Chat ] Help please, quite a challenging problem i guess

oracle

New Member
Messages
430
Reaction score
0
Points
0
Hello All,

I am developing a browser based chat program right now, But I am facing one problem in that and unable to think of a possible solution.

I am simulating it locally still and this is whats happening exactly. I am simulating two users scenario by logging in from two different browser. Suppose two users are A(mozilla) and B(netscape).

Both see the "logged in friends list" on there front panel and as they click the friend name another pop-up opens up (like gtalk) where they can chat. However the problem is, when user A clicks on user B to open a chat window and send a message to him, the pop-up windows doesn't open automatically on user B's side. Hence user B is unable to see that messages which user A is trying to send until he opens the chat window corresponding to user A on his side.

So user A will keep thinking that user B is recieving messages but ain't replying. However user B is unable to have a look at those message because he has not opened the chat window for user A, by clicking on user A in the the front panel.

What I am thinking is of generating another pop-up or a simple alert to start with, so that as soon as user A sends a message to user B, he gets a notification that user A is sending you a message. However I am blank over how can I achieve this. I thought of the below solution,but want some expert's comment before trying out further.

I thought that may be as soon as user A press the enter button to send message to user B, I detect the cookie. And for the user who's cookie is equal to user B's cookie, generate an alert message. However I am unable to understand that will the script running on user A side be able to detect cookie on user B's browser.

Quite a complex scenario i guess, never came across such a problem till now, so I am unable to understand how to proceed.

Also if some one can throw some light over how do Gtalk people generate those pop-up it will be of great help.

Kindly lemme know if you have ever solved such a problem.

Hoping for some help,
Imoracle.
 

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
gTalk (and the whole gmail) uses ajax requests, to get updates from master server (google server).

This is one way to do it: When A starts chat with B, on next update server tells user A (more exactly the code that is running) that user B has started chatting with him, allowing the code to open window for A.
 
Last edited:

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
As above, it utilizes ajax. There are lot of ajax toolkits out there but my personal one is my-bic as it doesn't really tie you to specific method, think of it more like a state of mind ;)
 
Top