Various fixes.

This commit is contained in:
levlam 2024-08-14 05:04:59 +03:00
parent 072cba1396
commit 076173dcf4
7 changed files with 14 additions and 9 deletions

View File

@ -896,7 +896,7 @@ botTransactionPurposePaidMedia media:vector<PaidMedia> = BotTransactionPurpose;
//@description User bought a product from the bot
//@product_info Information about the bought product; may be null if not applicable
//@invoice_payload Invoice payload; for bots only
botTransactionPurposeInvoicePayment product_info:productInfo invoice_payload:bytes = BotTransactionPurpose;
botTransactionPurposeInvoicePayment product_info:productInfo invoice_payload:bytes = BotTransactionPurpose;
//@class ChannelTransactionPurpose @description Describes purpose of a transaction with a channel
@ -1234,7 +1234,7 @@ supergroupMembersFilterBots = SupergroupMembersFilter;
//@subscription_pricing Information about subscription plan that is applied to the users joining the chat by the link; may be null if the link doesn't require subscription
//@member_limit The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval
//@member_count Number of chat members, which joined the chat using the link
//@expired_member_count Number of chat members, which joined the chat using the link, but have already left because of expired subscription; for subscription links only
//@expired_member_count Number of chat members, which joined the chat using the link, but have already left because of expired subscription; for subscription links only
//@pending_join_request_count Number of pending join requests created using this link
//@creates_join_request True, if the link only creates join request. If true, total number of joining members will be unlimited
//@is_primary True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time
@ -10176,7 +10176,7 @@ getChatInviteLinks chat_id:int53 creator_user_id:int53 is_revoked:Bool offset_da
//@description Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
//@chat_id Chat identifier
//@invite_link Invite link for which to return chat members
//@only_with_expired_subscription True, if the link is a subscription link and only members with expired subscription must be returned
//@only_with_expired_subscription Pass true if the link is a subscription link and only members with expired subscription must be returned
//@offset_member A chat member from which to return next chat members; pass null to get results from the beginning
//@limit The maximum number of chat members to return; up to 100
getChatInviteLinkMembers chat_id:int53 invite_link:string only_with_expired_subscription:Bool offset_member:chatInviteLinkMember limit:int32 = ChatInviteLinkMembers;

View File

@ -10,6 +10,7 @@
#include "td/telegram/Td.h"
#include "td/utils/algorithm.h"
#include "td/utils/logging.h"
namespace td {

View File

@ -135,8 +135,8 @@ StringBuilder &operator<<(StringBuilder &string_builder, const DialogInviteLink
<< invite_link.creator_user_id_ << " created at " << invite_link.date_ << " edited at "
<< invite_link.edit_date_ << " expiring at " << invite_link.expire_date_ << " used by "
<< invite_link.usage_count_ << " + " << invite_link.expired_usage_count_ << " with usage limit "
<< invite_link.usage_limit_ << ", " << invite_link.request_count_ << " pending join requests"
<< " and " << invite_link.pricing_ << "]";
<< invite_link.usage_limit_ << ", " << invite_link.request_count_
<< " pending join requests and " << invite_link.pricing_ << "]";
}
} // namespace td

View File

@ -9,6 +9,8 @@
#include "td/telegram/Dependencies.h"
#include "td/telegram/MessageSender.h"
#include "td/utils/logging.h"
#include <algorithm>
namespace td {

View File

@ -13,6 +13,7 @@
#include "td/utils/base64.h"
#include "td/utils/crypto.h"
#include "td/utils/emoji.h"
#include "td/utils/logging.h"
#include "td/utils/Slice.h"
#include "td/utils/SliceBuilder.h"
#include "td/utils/utf8.h"

View File

@ -12,6 +12,7 @@
#include "td/telegram/DialogManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/MessageContent.h"
#include "td/telegram/MessageContentType.h"
#include "td/telegram/MessageEntity.h"
#include "td/telegram/MessageSelfDestructType.h"
#include "td/telegram/net/NetQueryCreator.h"

View File

@ -206,7 +206,7 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
LOG(ERROR) << "Receive Star transaction with bot payload";
}
}
auto get_paid_media_objects = [&](DialogId dialog_id) -> vector<td_api::object_ptr<td_api::PaidMedia>> {
auto get_paid_media_object = [&](DialogId dialog_id) -> vector<td_api::object_ptr<td_api::PaidMedia>> {
auto extended_media = transform(std::move(transaction->extended_media_), [td = td_, dialog_id](auto &&media) {
return MessageExtendedMedia(td, std::move(media), dialog_id);
});
@ -282,7 +282,7 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
if (!transaction->extended_media_.empty()) { // TODO
return td_api::make_object<td_api::starTransactionPartnerBusiness>(
td_->user_manager_->get_user_id_object(user_id, "starTransactionPartnerBusiness"),
get_paid_media_objects(DialogId(user_id)));
get_paid_media_object(DialogId(user_id)));
}
LOG(ERROR) << "Receive Telegram Star transaction with " << user_id;
return td_api::make_object<td_api::starTransactionPartnerUnsupported>();
@ -294,7 +294,7 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
return td_api::make_object<td_api::starTransactionPartnerBot>(
td_->user_manager_->get_user_id_object(user_id, "starTransactionPartnerBot"),
td_api::make_object<td_api::botTransactionPurposePaidMedia>(
get_paid_media_objects(DialogId(user_id))));
get_paid_media_object(DialogId(user_id))));
}
SCOPE_EXIT {
bot_payload.clear();
@ -342,7 +342,7 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler {
return td_api::make_object<td_api::starTransactionPartnerChannel>(
td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChannel"),
td_api::make_object<td_api::channelTransactionPurposePaidMedia>(message_id.get(),
get_paid_media_objects(dialog_id)));
get_paid_media_object(dialog_id)));
}
LOG(ERROR) << "Receive Telegram Star transaction with " << dialog_id;
return td_api::make_object<td_api::starTransactionPartnerUnsupported>();