WordPress.org

Ready to get started?Download WordPress

Forums

Quick Chat
Private Chat Notification (3 posts)

  1. tongas
    Member
    Posted 1 year ago #

    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

    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/

  2. Marko-M
    Member
    Plugin Author

    Posted 1 year ago #

    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. 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

  3. tongas
    Member
    Posted 1 year ago #

    Great Marko!
    Thanks for your quick reply!
    I will try that out and let you know!
    Thank you again :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic