Add forum-related chat actions.
This commit is contained in:
parent
5420c3526c
commit
87b3d9415c
@ -2978,6 +2978,21 @@ chatEventVideoChatParticipantIsMutedToggled participant_id:MessageSender is_mute
|
||||
//@description A video chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents
|
||||
chatEventVideoChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction;
|
||||
|
||||
//@description The is_forum setting of a channel was toggled @is_forum New value of is_forum
|
||||
chatEventIsForumToggled is_forum:Bool = ChatEventAction;
|
||||
|
||||
//@description A new forum topic was created @topic_info Information about the topic
|
||||
chatEventForumTopicCreated topic_info:forumTopicInfo = ChatEventAction;
|
||||
|
||||
//@description A forum topic was edited @old_topic_info Old information about the topic @new_topic_info New information about the topic
|
||||
chatEventForumTopicEdited old_topic_info:forumTopicInfo new_topic_info:forumTopicInfo = ChatEventAction;
|
||||
|
||||
//@description A forum topic was deleted @topic_info Information about the topic
|
||||
chatEventForumTopicDeleted topic_info:forumTopicInfo = ChatEventAction;
|
||||
|
||||
//@description A pinned forum topic was changed @old_topic_info Information about the old pinned topic; may be null @new_topic_info Information about the new pinned topic; may be null
|
||||
chatEventForumTopicPinned old_topic_info:forumTopicInfo new_topic_info:forumTopicInfo = ChatEventAction;
|
||||
|
||||
//@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @member_id Identifier of the user or chat who performed the action @action The action
|
||||
chatEvent id:int64 date:int32 member_id:MessageSender action:ChatEventAction = ChatEvent;
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "td/telegram/DialogInviteLink.h"
|
||||
#include "td/telegram/DialogLocation.h"
|
||||
#include "td/telegram/DialogParticipant.h"
|
||||
#include "td/telegram/ForumTopicInfo.h"
|
||||
#include "td/telegram/Global.h"
|
||||
#include "td/telegram/GroupCallManager.h"
|
||||
#include "td/telegram/GroupCallParticipant.h"
|
||||
@ -357,12 +358,52 @@ static td_api::object_ptr<td_api::ChatEventAction> get_chat_event_action_object(
|
||||
old_available_reactions.get_chat_available_reactions_object(),
|
||||
new_available_reactions.get_chat_available_reactions_object());
|
||||
}
|
||||
case telegram_api::channelAdminLogEventActionToggleForum::ID:
|
||||
case telegram_api::channelAdminLogEventActionCreateTopic::ID:
|
||||
case telegram_api::channelAdminLogEventActionEditTopic::ID:
|
||||
case telegram_api::channelAdminLogEventActionDeleteTopic::ID:
|
||||
case telegram_api::channelAdminLogEventActionPinTopic::ID:
|
||||
return nullptr;
|
||||
case telegram_api::channelAdminLogEventActionToggleForum::ID: {
|
||||
auto action = move_tl_object_as<telegram_api::channelAdminLogEventActionToggleForum>(action_ptr);
|
||||
return td_api::make_object<td_api::chatEventIsForumToggled>(action->new_value_);
|
||||
}
|
||||
case telegram_api::channelAdminLogEventActionCreateTopic::ID: {
|
||||
auto action = move_tl_object_as<telegram_api::channelAdminLogEventActionCreateTopic>(action_ptr);
|
||||
auto topic_info = ForumTopicInfo(td, action->topic_);
|
||||
if (topic_info.is_empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
return td_api::make_object<td_api::chatEventForumTopicCreated>(topic_info.get_forum_topic_info_object(td));
|
||||
}
|
||||
case telegram_api::channelAdminLogEventActionEditTopic::ID: {
|
||||
auto action = move_tl_object_as<telegram_api::channelAdminLogEventActionEditTopic>(action_ptr);
|
||||
auto old_topic_info = ForumTopicInfo(td, action->prev_topic_);
|
||||
auto new_topic_info = ForumTopicInfo(td, action->new_topic_);
|
||||
if (old_topic_info.is_empty() || new_topic_info.is_empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
return td_api::make_object<td_api::chatEventForumTopicEdited>(old_topic_info.get_forum_topic_info_object(td),
|
||||
new_topic_info.get_forum_topic_info_object(td));
|
||||
}
|
||||
case telegram_api::channelAdminLogEventActionDeleteTopic::ID: {
|
||||
auto action = move_tl_object_as<telegram_api::channelAdminLogEventActionDeleteTopic>(action_ptr);
|
||||
auto topic_info = ForumTopicInfo(td, action->topic_);
|
||||
if (topic_info.is_empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
return td_api::make_object<td_api::chatEventForumTopicDeleted>(topic_info.get_forum_topic_info_object(td));
|
||||
}
|
||||
case telegram_api::channelAdminLogEventActionPinTopic::ID: {
|
||||
auto action = move_tl_object_as<telegram_api::channelAdminLogEventActionPinTopic>(action_ptr);
|
||||
ForumTopicInfo old_topic_info;
|
||||
ForumTopicInfo new_topic_info;
|
||||
if (action->prev_topic_ != nullptr) {
|
||||
old_topic_info = ForumTopicInfo(td, action->prev_topic_);
|
||||
}
|
||||
if (action->new_topic_ != nullptr) {
|
||||
new_topic_info = ForumTopicInfo(td, action->new_topic_);
|
||||
}
|
||||
if (old_topic_info.is_empty() && new_topic_info.is_empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
return td_api::make_object<td_api::chatEventForumTopicPinned>(old_topic_info.get_forum_topic_info_object(td),
|
||||
new_topic_info.get_forum_topic_info_object(td));
|
||||
}
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user