Home › Forums › BP Better Messages › Starting a chat with another user
- This topic has 15 replies, 3 voices, and was last updated 6 years, 8 months ago by Support.
-
AuthorPosts
-
February 15, 2018 at 8:34 pm #5729Martin AParticipant
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!
February 15, 2018 at 8:59 pm #5730SupportKeymasterHi there!
The problem is you need to create thread programmaticaly before you can open it, do you know how to?
February 15, 2018 at 9:06 pm #5731Martin AParticipantNo. Can i create it using one of the standard BP classes and then open it with jQuery in a mini-chat?
February 19, 2018 at 12:42 pm #5744SupportKeymasterSorry, missed your message!
Basically its possible, but abit tricky!Better you to wait, i will add simple js function to do this.
February 19, 2018 at 3:25 pm #5745Martin AParticipantOK, 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!
February 26, 2018 at 7:48 am #5876Martin AParticipantHey, 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!
February 26, 2018 at 9:42 pm #5877SupportKeymasterHi there!
I will try to manage this in next mini update.
Thanks!
February 27, 2018 at 7:37 am #5883Martin AParticipantThanks! I will be waiting for it.
March 8, 2018 at 7:00 am #5925SupportKeymasterHi 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, 8 months ago by Support.
March 12, 2018 at 8:46 pm #5998Martin AParticipantHey, 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 🙂
March 13, 2018 at 8:38 am #6007SupportKeymasterHi 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, 8 months ago by Support.
March 13, 2018 at 11:08 am #6010Martin AParticipantHey,
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
March 15, 2018 at 7:29 pm #6047SupportKeymasterHi there!
Just wanna to let you know, that im working on this at the moment and will release soon hopefully!
Thanks!
March 15, 2018 at 7:33 pm #6048Martin AParticipantGreat, thanks! I’ll be waiting 🙂
March 21, 2018 at 8:40 pm #6133GuillermoParticipantWhere 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); -
AuthorPosts
- You must be logged in to reply to this topic.