From 71d130385473c0a0649a6c605d1b7c2950ddbe1e Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 4 Dec 2023 21:29:41 +0000 Subject: [PATCH] Update content of files --- .../corefork.telegram.org/api/discussion.html | 56 ++++++++++++++++++- .../corefork.telegram.org/api/threads.html | 47 +--------------- .../constructor/channel.html | 2 +- 3 files changed, 56 insertions(+), 49 deletions(-) diff --git a/data/web/corefork.telegram.org/api/discussion.html b/data/web/corefork.telegram.org/api/discussion.html index 376592e9ce..8fff80e4cb 100644 --- a/data/web/corefork.telegram.org/api/discussion.html +++ b/data/web/corefork.telegram.org/api/discussion.html @@ -45,6 +45,7 @@

Groups can be associated to a channel as a discussion group, to allow users to discuss about posts.

+

Channel comments

boolFalse#bc799737 = Bool;
 boolTrue#997275b5 = Bool;
 
@@ -52,14 +53,65 @@
 
 messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
 
+messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
+
 ---functions---
 
 channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;
 channels.getGroupsForDiscussion#f5dad378 = messages.Chats;

A discussion group can be associated to a channel using channels.setDiscussionGroup.
The discussion group can be accessed in the client by clicking on the discuss button of the channel, or by accessing the comment section of a specific post; the discussion group ID is also present in the linked_chat_id field of the channelFull constructor.

-

All messages sent to the channel will also be sent to the linked group (with sender peer from_id equal to the peer of the linked channel); those messages will also be automatically pinned in the group.
-The comment section of a particular post can be disabled by removing the channel post message from the discussion group.

+

All messages sent to the channel will also be forwarded to the linked group (with sender peer from_id equal to the peer of the linked channel); those messages will also be automatically pinned in the group.

+

The comment section of a channel post is simply the message thread of the automatically forwarded channel message in the linked discussion supergroup.
+Thus, the comment section of a particular post can be disabled by removing the autoforwarded channel post message from the discussion group.

+

A messageReplies constructor will be attached the channel post in the original channel, containing information about the comment section, specifically:

+ +

The same messageReplies constructor with the usual flags for a thread (i.e. without channel_id, recent_replies) will also be present in the message automatically forwarded to the discussion group, as for all group messages that start a thread.

+

@replies

+
messageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;
+
+messageReplyHeader#a6d57763 flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;
+
+message#38116ee0 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;
+
+---functions---
+
+contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates;
+
+contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
+

Since a user can comment in channel posts without joining the actual discussion supergroup, there must be a way for them to receive notifications about replies in comment sections.
+For this reason, a special @replies username is provided. +Its ID for main and testing endpoints can be seen in the tdlib sources.

+

When someone replies to one of our messages in the comment section of a channel post, and the user is not subscribed to the discussion group, the client will receive two updates:

+ +

Clients should display messages coming from @replies as a read-only supergroup, with each reply displayed as a separate message from the author of the reply, with a "View in chat" button like for channel comments.

+

contacts.blockFromReplies may be used to stop getting notifications about thread replies from a certain user in @replies.

Linking a discussion group

To obtain a list of admined supergroups that a channel admin can possibly associate to a channel, use channels.getGroupsForDiscussion.
Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group.
diff --git a/data/web/corefork.telegram.org/api/threads.html b/data/web/corefork.telegram.org/api/threads.html index dceb854293..a7bf599d68 100644 --- a/data/web/corefork.telegram.org/api/threads.html +++ b/data/web/corefork.telegram.org/api/threads.html @@ -62,52 +62,7 @@ Replies to messages in a thread are part of the same thread, and do not spawn ne

When receiving a message from a group that is also the top of a thread (the message with ID 420), the replies optional field will contain a messageReplies constructor, containing the message ID and PTS of the latest reply in the thread, and the message ID of the latest read thread reply, along with the total number of replies in the thread.

Replies to a thread can also be manually fetched using messages.search, providing to top_msg_id the thread ID.

Channel comments

-
messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
-

The same messageReplies constructor seen above will also be contained in channel posts, this time containing information about the comment section of a specific channel post.
-The comment section of a channel post is simply the message thread of the automatically forwarded channel message in the linked discussion supergroup; the ID of the linked discussion supergroup will be contained in the messageReplies.channel_id field.

-

For channel posts, the recent_repliers field will also contain information about the last few comment posters for a specific thread, to show a small list of commenter profile pictures in client previews.

-

@replies

-
messageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;
-
-messageReplyHeader#a6d57763 flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;
-
-message#38116ee0 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
-
-updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
-updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;
-
----functions---
-
-contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates;
-
-contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
-

Since a user can comment in channel posts without joining the actual discussion supergroup, there must be a way for them to receive notifications about replies in comment sections.
-For this reason, a special @replies username is provided. -Its ID for main and testing endpoints can be seen in the tdlib sources.

-

When someone replies to one of our messages in the comment section of a channel post, and the user is not subscribed to the discussion group, the client will receive two updates:

- -

Clients should display messages coming from @replies as a read-only supergroup, with each reply displayed as a separate message from the author of the reply, with a "View in chat" button like for channel comments.

-

contacts.blockFromReplies may be used to stop getting notifications about thread replies from a certain user in @replies.

+

The same messageReplies constructor seen above will also be contained in channel posts, this time containing information about the comment section of a specific channel post, see here ยป for more info.

diff --git a/data/web/corefork.telegram.org/constructor/channel.html b/data/web/corefork.telegram.org/constructor/channel.html index 455358f260..2206673887 100644 --- a/data/web/corefork.telegram.org/constructor/channel.html +++ b/data/web/corefork.telegram.org/constructor/channel.html @@ -79,7 +79,7 @@ left flags.2?true -Whether the current user has left this channel +Whether the current user has left or is not a member of this channel broadcast