GithubHelp home page GithubHelp logo

Mark a message as (read or seen) about td HOT 8 CLOSED

Qasemt avatar Qasemt commented on May 1, 2024
Mark a message as (read or seen)

from td.

Comments (8)

JaEdmuva avatar JaEdmuva commented on May 1, 2024 2

I have been using all three methods (open, close and viewMessages WITH force read option True) but it won't always work. Is there a way to effectively mark messages as read for sure?

from td.

recolic avatar recolic commented on May 1, 2024 1

@JaEdmuva @CharlesOkwuagwu
Update: I got the reason why the openChat - viewMessages - closeChat is not reliable.

To mark message as read in a reliable way, you must only openChat. You MUST NOT closeChat.

In my program, I have another timer thread. It calls openChat and viewMessages once a second. After 10 seconds, it calls closeChat.
You must keep the chat "opened" as long as possible, to make it reliable.

from td.

levlam avatar levlam commented on May 1, 2024

To achieve this you need to call OpenChat/CloseChat when chats are opening/closed by the user and call ViewMessages whenever a message is shown to the user. The library will figure out which messages should be read itself. Messages are read only if they are shown in currently opened chat, but if you definitely need to read messages in a closed chat, you may use force_read parameter of ViewMessages method.

from td.

Qasemt avatar Qasemt commented on May 1, 2024

tanx

from td.

kolopeda avatar kolopeda commented on May 1, 2024

This method does not work, the "viewMessages" method works

from td.

CharlesOkwuagwu avatar CharlesOkwuagwu commented on May 1, 2024

I have been using all three methods (open, close and viewMessages WITH force read option True) but it won't always work. Is there a way to effectively mark messages as read for sure?

@JaEdmuva Hi, have you found a reliable way to mark as read?

from td.

CharlesOkwuagwu avatar CharlesOkwuagwu commented on May 1, 2024

@JaEdmuva @CharlesOkwuagwu Update: I got the reason why the openChat - viewMessages - closeChat is not reliable.

To mark message as read in a reliable way, you must only openChat. You MUST NOT closeChat.

In my program, I have another timer thread. It calls openChat and viewMessages once a second. After 10 seconds, it calls closeChat. You must keep the chat "opened" as long as possible, to make it reliable.

@recolic

Are you sending openChat and viewMessages for each chat received?

from td.

recolic avatar recolic commented on May 1, 2024

@recolic

Are you sending openChat and viewMessages for each chat received?

I am creating an anti-spam bot, so I do it for every chat unless it's whitelisted. You need to do that basing on your need.

If you want to mark a message as read, you need to open that chat (and keep it opened for a while)

This is my code, for your reference.

from td.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.