Search code examples
javascriptchatmessagequickblox

Quickblox: Message Delivered and Read Status


I have implemented quickblox chat in my web application. Now I want to show status of my messages as delivered in case when they are just sent to user and as read when they have seen the message.

In your Javascript SDK I have found two functions QB.chat.sendDeliveredMessage and QB.chat.sendReadMessage but every time I call this function as :

QB.chat.sendDeliveredMessage(
    QBChatHelpers.getJID(chatUser.id),
    "5600f885a28f9ac7e801048c"    //this is just a sample msg-id
);

It calls ajax with POST request over url http://chat.quickblox.com:8080/ while chat is running over http://chat.quickblox.com:5280/. Also within library, I changed the port to 5280 in place of 8080 so that it can call url with port 8080 and it calls http://chat.quickblox.com:5280/ which then gives error code 405: Invalid Hostname.

Please let me know what's wrong am I doing while calling this function. If further information is required then do let me know.


Solution

  • We are working on this feature, in the new version of QuickBlox JS SDK messages will be sent with the markable status. sendDeliveredStatus(params)-will be sent automatically after receiving a message with markable status, which will signalize via the function of Listener QB.chat.onDeliveredStatusListener(messageId, dialogId, userId);

    sendReadStatus(params)-will be possible to send it according to an event (for example, you set up a processor, which will notice that a message has already appeared on yours monitor, after receiving a message with markable status, which will signalize via the function of Listener QB.chat.onReadStatusListener(messageId, dialogId, userId);)

    parameters for status sending:

    params = {
        messageId: messageId,
        userId: userId,
        dialogId: dialogId
      };