Home Forums BP Better Messages Starting a chat with another user

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #5729
    Martin A
    Participant

    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!

    #5730
    Support
    Keymaster

    Hi there!

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

    #5731
    Martin A
    Participant

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

    #5744
    Support
    Keymaster

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

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

    #5745
    Martin A
    Participant

    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!

    #5876
    Martin A
    Participant

    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!

    #5877
    Support
    Keymaster

    Hi there!

    I will try to manage this in next mini update.

    Thanks!

    #5883
    Martin A
    Participant

    Thanks! I will be waiting for it.

    #5925
    Support
    Keymaster

    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!

    • This reply was modified 6 years, 1 month ago by Support.
    #5998
    Martin A
    Participant

    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 🙂

    #6007
    Support
    Keymaster

    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?

    • This reply was modified 6 years, 1 month ago by Support.
    #6010
    Martin A
    Participant

    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: https://www.dropbox.com/sh/c9a2tt4z5n7e1ex/AACCQPcFv5HC9RSxVIHWOsuLa?dl=0

    #6047
    Support
    Keymaster

    Hi there!

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

    Thanks!

    #6048
    Martin A
    Participant

    Great, thanks! I’ll be waiting 🙂

    #6133
    Guillermo
    Participant

    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);

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.