thread field

25 views
Skip to first unread message

Dragos

unread,
Dec 6, 2022, 3:45:08 AM12/6/22
to Tinode General
Hi,

How this field works ? It's something like Slack has ? I do not see it used in the tinode web app but it's in the docs https://github.com/tinode/chat/blob/master/docs/API.md#pub

As of now I am using the reply field to make something like Slack thread but I feel it's wrong cause I can't find a way to not mark the "thread" messages as recv/read when I open the chat. They should only be marked when the specific "thread" is opened.


Thank you.

Gene

unread,
Dec 6, 2022, 1:13:02 PM12/6/22
to Tinode General
On Tuesday, December 6, 2022 at 12:45:08 AM UTC-8 Dragos wrote:
Hi,

How this field works ? It's something like Slack has ? I do not see it used in the tinode web app but it's in the docs https://github.com/tinode/chat/blob/master/docs/API.md#pub

Yes, the intent of 'thread' is to group messages together. We have not implemented it yet though. 
 
As of now I am using the reply field to make something like Slack thread but I feel it's wrong cause I can't find a way to not mark the "thread" messages as recv/read when I open the chat. They should only be marked when the specific "thread" is opened.

That has to be implemented. We did not do it yet.
 


Thank you.

Dragos

unread,
Dec 6, 2022, 3:53:44 PM12/6/22
to Tinode General
How would you advice to make a Thread like on Slack ?

For now my server copy was changed to group replies under a message like: message: {replies: [], ..otherData} and I use the message seq to group display they thread and do stuff with it. This allows multiple replies to a message and it looks like a thread :)

But I am stuck at a problem regarding marking messages as recv and read. I could not find a way to mark just the messages first(when the topic is accesed or when the window recives focus) and when a message is marked as recv/read by the other user on the info message only a seq is received and there is no fast way to check if it's a reply or a message and mark them accordingly. Any advice ?

I am making a custom client and not using the tinode sdk or the tinode react app so I can implement anything in the front end. :D

Gene

unread,
Dec 6, 2022, 4:14:22 PM12/6/22
to Tinode General
On Tuesday, December 6, 2022 at 12:53:44 PM UTC-8 Dragos wrote:
How would you advice to make a Thread like on Slack ?

For now my server copy was changed to group replies under a message like: message: {replies: [], ..otherData} and I use the message seq to group display they thread and do stuff with it. This allows multiple replies to a message and it looks like a thread :)

I would suggest using thread, because even within the thread you still want your users to reply to individual messages. 


But I am stuck at a problem regarding marking messages as recv and read. I could not find a way to mark just the messages first(when the topic is accesed or when the window recives focus) and when a message is marked as recv/read by the other user on the info message only a seq is received and there is no fast way to check if it's a reply or a message and mark them accordingly. Any advice ?

Yes, such marking of messages would be a problem: we currently store only the ID of the most recent received/read message. All older messages are assumed to be read too. The feature you want would require server-side changes. I.e. instead of keeping just the most recent read/received ID you need to mark individual messages as read/received by each subscriber. It can be done, just not that simple. And would require changing the DB schema. 

Take a look how how information about soft-deleted messages is stored. Read/recv would have to be done in a similar (complex) way. Potentially, it's possible to add a column to the deleted messages table (dellog) like 'action' and store recv/read in that table. It would be a lot less work. But the table would be huge. Something would have to be done about it.

You could also do it purely on the client. But then the read/recv information won't be shared between user's devices, say between desktop and mobile.
Reply all
Reply to author
Forward
0 new messages