An alert for when someone opens a private channel

59 views
Skip to first unread message

DAhrens

unread,
Sep 11, 2014, 4:10:35 PM9/11/14
to ajax...@googlegroups.com
Hi, first time posting but have been stuck on this for a bit. Using v0.8.7 Standalone.

I would like for the users of my chat to receive an alert for when someone has opened a private channel to them that gives them the option of opening their own private channel to the initiator. Let me break this down with an example: 
 - Bob opens a private channel to Jim 
 - Jim gets an alert that states "Bob has opened a private channel, would you like to start chatting privately with Bob?" and has "Yes" and "No" options (I would use jQuery for this portion). 
 - Jim presses yes, he initiates a private channel with Bob. He presses No, the dialog just closes but he is still able to receive Bob's private messages.

I have been able to setup cookies for the initiator, now its just routing the /queryOpen message to the right user and popping the dialog. The problem is, I have no idea how these messages are routed to users or where to even begin with something like this. I'm not interested in setting up the whole new div with private messages in that div, etc. Just need to alert the user when a private channel has been opened to them. Any help would be appreciated. 

Thanks.

Ingrid Sedé

unread,
Dec 1, 2014, 6:03:00 PM12/1/14
to ajax...@googlegroups.com
Not exactly what you asked for but hey... ;)
in chat.js look for:

+ '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/query '
                    + encodedUserName
                    + '\');">'

and replace with:

                    + '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/query '
                    + encodedUserName
                    + '\');"'
                    + ' onclick="ajaxChat.sendMessageWrapper(\'/msg '
                    + encodedUserName   
                    +  '  Hi there! Open Up a private chat man! :P\''                              
                    + '\);">'
Reply all
Reply to author
Forward
0 new messages