Community

Connecting WordPress People

Starting a chat with another user

MAMartin A 15 replies 0 views 3 readers

  1. New
    #1

    Is there a way to programmatically start a new mini-chat or open an existing thread in a mini-chat component when i have the WP_User objects of both participants in php? Should be possible with jQuery?

    Thanks!

    More reactions: press the Down arrow
    views
  2. New
    Admin
    #2

    Hi there!

    The problem is you need to create thread programmaticaly before you can open it, do you know how to?

    More reactions: press the Down arrow
  3. New
    #3

    No. Can i create it using one of the standard BP classes and then open it with jQuery in a mini-chat?

    More reactions: press the Down arrow
  4. New
    Admin
    In reply to Martin A #4

    Sorry, missed your message!
    Basically its possible, but abit tricky!

    Better you to wait, i will add simple js function to do this.

    More reactions: press the Down arrow
  5. New
    #5

    OK, sounds great. Any time estimation when this would be available?

    Just to clarify, this would enable to open with a link in template an existing thread between users in minichat or create a new chat if necessary and then open it in minichat?

    Thanks!

    More reactions: press the Down arrow
  6. New
    #6

    Hey, any updates or estimations on this feature? We're waiting to launch the improved messages to our users and want to launch with this feature.

    Thanks!

    More reactions: press the Down arrow
  7. New
    Admin
    #7

    Hi there!

    I will try to manage this in next mini update.

    Thanks!

    More reactions: press the Down arrow
  8. New
    #8

    Thanks! I will be waiting for it.

    More reactions: press the Down arrow
  9. New
    Admin
    #9

    Hi there!

    Releasing new version in next few days.
    This is the function to open mini chat:
    var thread_id = 1;
    //Thread ID, that should exist
    var open = true;
    //true or false, this mean if mini chat showing maximized or minified
    BBPMOpenMiniChat(thread_id, open);

    Next version will come with more improvements for the mini chats!
    Thanks for your patience!

    More reactions: press the Down arrow
  10. New
    #10

    Hey, thanks! This works great for opening an existing chat.

    But before i can launch this new chat to my users i also need to be able to directly open a mini chat between two users who don't have an existing thead. How can i solve this?

    If i understand correctly Buddypress requires a message to be sent before a new thread id can be created in the database. An option to get around this would be to create an empty message programmatically and thus get the thread id. However this would trigger the email notifications as well right? And that would be a problem for an empty message. And i don't want to create empty messages between all of the users on my site just in case, that would create a lot of trash data in the database.

    Ideally an empty message would be create only once i initialize the open of the minichat. Then an empty message can be created, a thread id can be generated and a mini chat can be opened. And somehow the email notification would need to be suppressed.

    Do you have any suggestions on how to solve this? It's still a show-stopper at the moment. But your plugin is so good i want to release it to my users as soon as possible 🙂

    More reactions: press the Down arrow
  11. New
    Admin
    #11

    Hi there, Martin!

    Can you explain how you are trying to use plugin?

    As I can understand you want to have the button which allow users go to the chat screen with another user immediatly, without entering subject, first message, etc?
    And how do you want to implement this?

    This is important to know for me, so I can make the base in plugin to make this possible.

    Im working on new update at the moment, where I will add list of threads and friends attached to the bottom of page just like minichats and there will be possible to create thread and open minichat immediatly. Is this something that can work for you?

    More reactions: press the Down arrow
  12. New
    #12

    Hey,

    What i'm trying to achieve is that there is a button in my template (which knows the current logged in user id and also the other user's id who they want to chat to). Clicking this button should open the minichat. If there is an existing thread between these two users, then i can use BBPMOpenMiniChat(thread_id, open) because i also know the thread_id already in my templated. But if there isn't an existing thread, then i can't open it right now. I want to enable that as well.

    So to recap – a button in the template that opens an existing thread between users in a minichat or if there isn't an existing thread, creates a thread and opens it in a minichat.

    I created three screenshots illustrating this idea. You can see them here: dropbox.com/sh/c9a2tt4z5n7e1ex/AACCQPc…

    More reactions: press the Down arrow
  13. New
    Admin
    #13

    Hi there!

    Just wanna to let you know, that im working on this at the moment and will release soon hopefully!

    Thanks!

    More reactions: press the Down arrow
  14. New
    #14

    Great, thanks! I'll be waiting 🙂

    More reactions: press the Down arrow
  15. New
    In reply to Andrij Tkachenko #15

    Where would I place the code in order to have my chat work?

    var thread_id = 1;
    //Thread ID, that should exist
    var open = true;
    //true or false, this mean if mini chat showing maximized or minified
    BBPMOpenMiniChat(thread_id, open);

    More reactions: press the Down arrow
  16. New
    Admin
    #16

    Hi there!

    Which chat are you talking about?
    This code is to open Mini Chat (this is available only in WebSocket version)

    More reactions: press the Down arrow
0