Improve name of the chatActionWatchingAnimations chat action.

This commit is contained in:
levlam 2021-09-19 21:40:07 +03:00
parent a7dcbe8c18
commit 057cee8674
5 changed files with 20 additions and 20 deletions

View File

@ -2069,8 +2069,8 @@ chatActionRecordingVideoNote = ChatAction;
//@description The user is uploading a video note @progress Upload progress, as a percentage
chatActionUploadingVideoNote progress:int32 = ChatAction;
//@description The user is viewing animations sent by the other party by clicking on animated emojies @emoji The animated emoji
chatActionEnjoyingAnimations emoji:string = ChatAction;
//@description The user is watching animations sent by the other party by clicking on an animated emoji @emoji The animated emoji
chatActionWatchingAnimations emoji:string = ChatAction;
//@description The user has canceled the previous action
chatActionCancel = ChatAction;
@ -3835,7 +3835,7 @@ updateUsersNearby users_nearby:vector<chatNearby> = Update;
//@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis
updateDiceEmojis emojis:vector<string> = Update;
//@description Some animated emoji message was clicked and a big animated sticker should be played if the message is visible on the screen. chatActionEnjoyingAnimations with the text of the message needs to be sent if the sticker is played
//@description Some animated emoji message was clicked and a big animated sticker should be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played
//@chat_id Chat identifier @message_id Message identifier @sticker The animated sticker to be played
updateAnimatedEmojiMessageClicked chat_id:int53 message_id:int53 sticker:sticker = Update;

View File

@ -121,9 +121,9 @@ DialogAction::DialogAction(tl_object_ptr<td_api::ChatAction> &&action) {
case td_api::chatActionChoosingSticker::ID:
init(Type::ChoosingSticker);
break;
case td_api::chatActionEnjoyingAnimations::ID: {
auto enjoying_animations_action = move_tl_object_as<td_api::chatActionEnjoyingAnimations>(action);
init(Type::EnjoyingAnimations, std::move(enjoying_animations_action->emoji_));
case td_api::chatActionWatchingAnimations::ID: {
auto watching_animations_action = move_tl_object_as<td_api::chatActionWatchingAnimations>(action);
init(Type::WatchingAnimations, std::move(watching_animations_action->emoji_));
break;
}
default:
@ -196,7 +196,7 @@ DialogAction::DialogAction(tl_object_ptr<telegram_api::SendMessageAction> &&acti
break;
case telegram_api::sendMessageEmojiInteractionSeen::ID: {
auto emoji_interaction_seen_action = move_tl_object_as<telegram_api::sendMessageEmojiInteractionSeen>(action);
init(Type::EnjoyingAnimations, std::move(emoji_interaction_seen_action->emoticon_));
init(Type::WatchingAnimations, std::move(emoji_interaction_seen_action->emoticon_));
break;
}
case telegram_api::sendMessageEmojiInteraction::ID: {
@ -245,7 +245,7 @@ tl_object_ptr<telegram_api::SendMessageAction> DialogAction::get_input_send_mess
return make_tl_object<telegram_api::sendMessageHistoryImportAction>(progress_);
case Type::ChoosingSticker:
return make_tl_object<telegram_api::sendMessageChooseStickerAction>();
case Type::EnjoyingAnimations:
case Type::WatchingAnimations:
return make_tl_object<telegram_api::sendMessageEmojiInteractionSeen>(emoji_);
case Type::ClickingAnimatedEmoji:
default:
@ -288,7 +288,7 @@ tl_object_ptr<secret_api::SendMessageAction> DialogAction::get_secret_input_send
return make_tl_object<secret_api::sendMessageTypingAction>();
case Type::ChoosingSticker:
return make_tl_object<secret_api::sendMessageTypingAction>();
case Type::EnjoyingAnimations:
case Type::WatchingAnimations:
return make_tl_object<secret_api::sendMessageTypingAction>();
case Type::ClickingAnimatedEmoji:
default:
@ -327,8 +327,8 @@ tl_object_ptr<td_api::ChatAction> DialogAction::get_chat_action_object() const {
return td_api::make_object<td_api::chatActionUploadingVideoNote>(progress_);
case Type::ChoosingSticker:
return td_api::make_object<td_api::chatActionChoosingSticker>();
case Type::EnjoyingAnimations:
return td_api::make_object<td_api::chatActionEnjoyingAnimations>(emoji_);
case Type::WatchingAnimations:
return td_api::make_object<td_api::chatActionWatchingAnimations>(emoji_);
case Type::ImportingMessages:
case Type::SpeakingInVoiceChat:
case Type::ClickingAnimatedEmoji:
@ -444,8 +444,8 @@ int32 DialogAction::get_importing_messages_action_progress() const {
return progress_;
}
string DialogAction::get_enjoying_animations_emoji() const {
if (type_ == Type::EnjoyingAnimations) {
string DialogAction::get_watching_animations_emoji() const {
if (type_ == Type::WatchingAnimations) {
return emoji_;
}
return string();
@ -499,8 +499,8 @@ StringBuilder &operator<<(StringBuilder &string_builder, const DialogAction &act
return "ImportingMessages";
case DialogAction::Type::ChoosingSticker:
return "ChoosingSticker";
case DialogAction::Type::EnjoyingAnimations:
return "EnjoyingAnimations";
case DialogAction::Type::WatchingAnimations:
return "WatchingAnimations";
case DialogAction::Type::ClickingAnimatedEmoji:
return "ClickingAnimatedEmoji";
default:

View File

@ -34,7 +34,7 @@ class DialogAction {
SpeakingInVoiceChat,
ImportingMessages,
ChoosingSticker,
EnjoyingAnimations,
WatchingAnimations,
ClickingAnimatedEmoji
};
Type type_ = Type::Cancel;
@ -76,7 +76,7 @@ class DialogAction {
int32 get_importing_messages_action_progress() const;
string get_enjoying_animations_emoji() const;
string get_watching_animations_emoji() const;
struct ClickingAnimateEmojiInfo {
int32 message_id;

View File

@ -5558,7 +5558,7 @@ StickerSetId add_sticker_set(Td *td, tl_object_ptr<telegram_api::InputStickerSet
}
bool is_unsent_animated_emoji_click(Td *td, DialogId dialog_id, const DialogAction &action) {
auto emoji = action.get_enjoying_animations_emoji();
auto emoji = action.get_watching_animations_emoji();
if (emoji.empty()) {
return false;
}

View File

@ -1321,8 +1321,8 @@ class CliClient final : public Actor {
if (action == "cs" || action == "choose_sticker") {
return td_api::make_object<td_api::chatActionChoosingSticker>();
}
if (begins_with(action, "ea")) {
return td_api::make_object<td_api::chatActionEnjoyingAnimations>(action.substr(2).str());
if (begins_with(action, "wa")) {
return td_api::make_object<td_api::chatActionWatchingAnimations>(action.substr(2).str());
}
return td_api::make_object<td_api::chatActionTyping>();
}