ilyalatt / Telega

C# Telegram MTProto Client
https://ilyalatt.github.io/Telega/
MIT License
58 stars 15 forks source link

Mark dialog as read not working #79

Closed derodevil closed 2 years ago

derodevil commented 2 years ago
  var recipient = new InputPeer.UserTag(user.Default.Id, user.Default.AccessHash.Value);
  var peer = new InputDialogPeer.DefaultTag(recipient);
  await tg.Call(new Telega.Rpc.Dto.Functions.Messages.MarkDialogUnread(false, peer)); 

I called the above codes on Subscribe. I want the incoming message will automatically be marked as read

ilyalatt commented 2 years ago

I guess this function is intended for the opposit action. Try ReadDiscussion. You can browse available API methods directly from the scheme here.

derodevil commented 2 years ago

Setting up the unread parameter to true and false resulted nothing

ilyalatt commented 2 years ago

That means that your assumptions about this method are wrong. It can be a method reserved for a future use for example. I am not sure what it is for because you can not just 'unread' discussion. You need to have some set of messages to mark them as unreaded and it is not clear what is this set (maybe messages with lifetime less than some threshold). Anyway, you need to use ReadDiscussion, not MarkDialogUnread. Update: Discussion means channel post commenting. If the discussion is read and there are new comments there is a small dot near the button.

derodevil commented 2 years ago

The correct one is ReadHistory