Skip to content

Commit

Permalink
Rename MessageForwardOrigin to MessageOrigin.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Oct 26, 2023
1 parent a953ef7 commit 10c9e40
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
20 changes: 10 additions & 10 deletions td/generate/scheme/td_api.tl
Original file line number Diff line number Diff line change
Expand Up @@ -1138,24 +1138,24 @@ messageViewer user_id:int53 view_date:int32 = MessageViewer;
messageViewers viewers:vector<messageViewer> = MessageViewers;


//@class MessageForwardOrigin @description Contains information about the origin of a forwarded message
//@class MessageOrigin @description Contains information about the origin of a message

//@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message
messageForwardOriginUser sender_user_id:int53 = MessageForwardOrigin;
messageOriginUser sender_user_id:int53 = MessageOrigin;

//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender
messageOriginHiddenUser sender_name:string = MessageOrigin;

//@description The message was originally sent on behalf of a chat
//@sender_chat_id Identifier of the chat that originally sent the message
//@author_signature For messages originally sent by an anonymous chat administrator, original message author signature
messageForwardOriginChat sender_chat_id:int53 author_signature:string = MessageForwardOrigin;

//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender
messageForwardOriginHiddenUser sender_name:string = MessageForwardOrigin;
messageOriginChat sender_chat_id:int53 author_signature:string = MessageOrigin;

//@description The message was originally a post in a channel
//@chat_id Identifier of the chat from which the message was originally forwarded
//@chat_id Identifier of the channel chat to which the message was originally sent
//@message_id Message identifier of the original message
//@author_signature Original post author signature
messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin;
messageOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageOrigin;


//@class ReactionType @description Describes type of message reaction
Expand All @@ -1168,12 +1168,12 @@ reactionTypeCustomEmoji custom_emoji_id:int64 = ReactionType;


//@description Contains information about a forwarded message
//@origin Origin of a forwarded message
//@origin Origin of the forwarded message
//@date Point in time (Unix timestamp) when the message was originally sent
//@public_service_announcement_type The type of a public service announcement for the forwarded message
//@from_chat_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown
//@from_message_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown
messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo;
messageForwardInfo origin:MessageOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo;

//@description Contains information about a message created with importMessages
//@sender_name Name of the original sender
Expand Down
18 changes: 9 additions & 9 deletions td/telegram/MessageOrigin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,23 @@ Result<MessageOrigin> MessageOrigin::get_message_origin(
std::move(sender_name)};
}

td_api::object_ptr<td_api::MessageForwardOrigin> MessageOrigin::get_message_forward_origin_object(const Td *td) const {
td_api::object_ptr<td_api::MessageOrigin> MessageOrigin::get_message_origin_object(const Td *td) const {
if (is_sender_hidden()) {
return td_api::make_object<td_api::messageForwardOriginHiddenUser>(sender_name_.empty() ? author_signature_
: sender_name_);
return td_api::make_object<td_api::messageOriginHiddenUser>(sender_name_.empty() ? author_signature_
: sender_name_);
}
if (message_id_.is_valid()) {
return td_api::make_object<td_api::messageForwardOriginChannel>(
td->messages_manager_->get_chat_id_object(sender_dialog_id_, "messageForwardOriginChannel"), message_id_.get(),
return td_api::make_object<td_api::messageOriginChannel>(
td->messages_manager_->get_chat_id_object(sender_dialog_id_, "messageOriginChannel"), message_id_.get(),
author_signature_);
}
if (sender_dialog_id_.is_valid()) {
return td_api::make_object<td_api::messageForwardOriginChat>(
td->messages_manager_->get_chat_id_object(sender_dialog_id_, "messageForwardOriginChat"),
return td_api::make_object<td_api::messageOriginChat>(
td->messages_manager_->get_chat_id_object(sender_dialog_id_, "messageOriginChat"),
sender_name_.empty() ? author_signature_ : sender_name_);
}
return td_api::make_object<td_api::messageForwardOriginUser>(
td->contacts_manager_->get_user_id_object(sender_user_id_, "messageForwardOriginUser"));
return td_api::make_object<td_api::messageOriginUser>(
td->contacts_manager_->get_user_id_object(sender_user_id_, "messageOriginUser"));
}

bool MessageOrigin::is_sender_hidden() const {
Expand Down
2 changes: 1 addition & 1 deletion td/telegram/MessageOrigin.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MessageOrigin {
author_signature_.empty() && sender_name_.empty();
}

td_api::object_ptr<td_api::MessageForwardOrigin> get_message_forward_origin_object(const Td *td) const;
td_api::object_ptr<td_api::MessageOrigin> get_message_origin_object(const Td *td) const;

bool is_sender_hidden() const;

Expand Down
2 changes: 1 addition & 1 deletion td/telegram/MessagesManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27529,7 +27529,7 @@ td_api::object_ptr<td_api::messageForwardInfo> MessagesManager::get_message_forw
}

return td_api::make_object<td_api::messageForwardInfo>(
forward_info->origin.get_message_forward_origin_object(td_), forward_info->date, forward_info->psa_type,
forward_info->origin.get_message_origin_object(td_), forward_info->date, forward_info->psa_type,
get_chat_id_object(forward_info->from_dialog_id, "messageForwardInfo"), forward_info->from_message_id.get());
}

Expand Down

0 comments on commit 10c9e40

Please sign in to comment.