Hi guys
Just looking for advice from anyone that might be able to help?
I've created a chat component but feel I need to change how I perform some of the functions.
My component is making use of the API.
Checking for new messages: I have an Ajax function running every 3 seconds that checks the notifications API for a Messages count above 0. If there are new message notifications, it uses the messages API to mark all messages in that thread as read, and then refreshes the messages on screen. This gives the desired result, but if I receive a message from somebody who I'm not chatting with, it refreshes the current message thread anyway. It would be useful if the message thread could include an ID, and if the notifications API could include the message thread id in the notifications array?
That way I only need to refresh the currently displayed thread if it receives a new message.
It would also be useful if I could mark just the messages in the current thread as "read" instead of all messages.
Is this functionality already available somewhere? Or can anybody suggest a better way of implementing this?
I also play a notification sound when a new message is received, but if it's for a thread I'm not currently viewing, it pings every time it checks, until I load that thread and mark the messages as read.
Any advice greatly appreciated.
Excellent! Thank you.
That will also allow me to ensure I only play the new notification sound if that figure increases :)
You should see this just created example : https://github.com/opensource-socialnetwork/UnreadMessagesCountAPI
Yes I think that's nailed it. If there was a user id associated with the notification that would probably resolve most of the hurdles I have.
Ok what I understand is you can able to read messages in one thread example only between user a and user b. But the problem is:
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)