Title: [Plugin: Quick Chat] Private Chat Notification
Last modified: August 20, 2016

---

# [Plugin: Quick Chat] Private Chat Notification

 *  [tongas](https://wordpress.org/support/users/tongas/)
 * (@tongas)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-quick-chat-private-chat-notification/)
 * Hi Marko,
 * One of the best chat plugins I found around!
 * 3 questions regarding private chats
 * 1) After receiving a chat request, two private chat windows appear, one with 
   the one user and the other one with the two users, see screenshot here: [http://screencast.com/t/oYM3d9JicuTM](http://screencast.com/t/oYM3d9JicuTM)
 * 2) Is there a way not to depend on the user to accept the private chat request?
   Can it just be that when you want to private chat with someone you only click
   on his/her username and the private window pops out for both and chat starts?
 * 3) If point 2) is not possible or too difficult, here is another question. We
   are putting chat window inside a footer bar. Chat window is closed until you 
   click on the footer bar. I wanted to know where can I capture the notification
   of new private chat request notice in order to show an alert on this bar if the
   chat window is closed.
 * Hope it is clear.
 * Thank you!
 * [http://wordpress.org/extend/plugins/quick-chat/](http://wordpress.org/extend/plugins/quick-chat/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Marko-M](https://wordpress.org/support/users/marko-m/)
 * (@marko-m)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-quick-chat-private-chat-notification/#post-2850476)
 * Hello.
    1) Two private chat windows opening isn’t correct behavior and I can’t
   reproduce it on my localhost or any other site. This was issue with one older
   version, 3.00 I believe I’ve fixed it in 3.01 and current version is 4.01. You
   can reproduce this issue every time? If yes these are my thoughts on this. There
   could be some kind of conflict where some other plugin javascript triggers extra
   click event but not likely. If you can’t reproduce it every time it is possible
   that one I call it “system message” got lost. To emulate private chat invitations
   QC sends messages with json payload and keeps private chat invitation queues 
   on both sides. I one side didn’t get invitation or sender didn’t receive back
   it’s own pvt invitation that could mess up other invitation queue to result in
   two windows being open. But this all stands only if it isn’t reproducible every
   time.
 * 2) Yes that would actually make code simpler because there wouldn’t be need for
   pvt chat invitation queues on both sides. Take a look at quick_chat.private_queue
   and quick_chat.private_current objects in quick-chat-core.dev.js For more on 
   private chat internals please take a look at my last reply to [this thread](http://wordpress.org/support/topic/plugin-quick-chat-private-chat-only?replies=5).
   The meat of pvt chat is quick_chat.update_messages where it detect is message
   system message caring json payload to process into queue or regular message etc.
 * 3. You could tap into code mentioned under 2) quick_chat.update_messages ajax
   success callback where you have:
 *     ```
       if(updates[i].alias != 'quick_chat'){
           // Regular message
       } else if(quick_chat.last_timestamp != 0){
           /* System message has sender name 'quick_chat' and here it Json decodes updates[i].message and see if it's pvt invitation, from whom it is and stores it in quick_chat.private_queue or starts private chat if it finds existing inv. from same user etc... quick_chat.last_timestamp != 0 is there to prevent processing old system message on first load, first load has quick_chat.last_timestamp == 0 */
       }
       ```
   
 * It’s a lot of code, I wrote most of it a year ago so now I would probably do 
   some things differently.
 * Hope this helps,
    regards
 *  Thread Starter [tongas](https://wordpress.org/support/users/tongas/)
 * (@tongas)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-quick-chat-private-chat-notification/#post-2850559)
 * Great Marko!
    Thanks for your quick reply! I will try that out and let you know!
   Thank you again 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Quick Chat] Private Chat Notification’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/quick-chat.svg)
 * [Quick Chat](https://wordpress.org/plugins/quick-chat/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/quick-chat/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/quick-chat/)
 * [Active Topics](https://wordpress.org/support/plugin/quick-chat/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/quick-chat/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/quick-chat/reviews/)

## Tags

 * [private](https://wordpress.org/support/topic-tag/private/)
 * [request](https://wordpress.org/support/topic-tag/request/)

 * 2 replies
 * 2 participants
 * Last reply from: [tongas](https://wordpress.org/support/users/tongas/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-quick-chat-private-chat-notification/#post-2850559)
 * Status: not resolved