Minor improvements.

This commit is contained in:
levlam 2022-06-28 15:32:05 +03:00
parent 386fec3d17
commit 26fdb92dd8
5 changed files with 12 additions and 9 deletions

View File

@ -6406,7 +6406,7 @@ getPremiumState = PremiumState;
//@description Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase
canPurchasePremium = Ok;
//@description Informs server about a Telegram Premium purchase through App Store. For official applications only @receipt App Store receipt @is_restore True, if this is restore of Premium purchase
//@description Informs server about a Telegram Premium purchase through App Store. For official applications only @receipt App Store receipt @is_restore Pass true if this is a restore of a Telegram Premium purchase
assignAppStoreTransaction receipt:bytes is_restore:Bool = Ok;
//@description Informs server about a Telegram Premium purchase through Google Play. For official applications only @purchase_token Google Play purchase token

View File

@ -1390,12 +1390,12 @@ static void sort_entities(vector<MessageEntity> &entities) {
std::sort(entities.begin(), entities.end());
}
#define check_is_sorted(entities) check_is_sorted_impl(entities, __LINE__)
#define check_is_sorted(entities) check_is_sorted_impl((entities), __LINE__)
static void check_is_sorted_impl(const vector<MessageEntity> &entities, int line) {
LOG_CHECK(std::is_sorted(entities.begin(), entities.end())) << line << " " << entities;
}
#define check_non_intersecting(entities) check_non_intersecting_impl(entities, __LINE__)
#define check_non_intersecting(entities) check_non_intersecting_impl((entities), __LINE__)
static void check_non_intersecting_impl(const vector<MessageEntity> &entities, int line) {
for (size_t i = 0; i + 1 < entities.size(); i++) {
LOG_CHECK(entities[i].offset + entities[i].length <= entities[i + 1].offset) << line << " " << entities;

View File

@ -27916,8 +27916,8 @@ class MessagesManager::ForwardMessagesLogEvent {
DialogId from_dialog_id;
vector<MessageId> message_ids;
vector<Message *> messages_in;
bool drop_author;
bool drop_media_captions;
bool drop_author = false;
bool drop_media_captions = false;
vector<unique_ptr<Message>> messages_out;
template <class StorerT>

View File

@ -8,12 +8,18 @@
#include "td/actor/actor.h"
#include "td/utils/Closure.h"
#include "td/utils/common.h"
#include "td/utils/invoke.h"
#include "td/utils/Promise.h"
#include "td/utils/ScopeGuard.h"
#include "td/utils/Status.h"
#include <tuple>
#include <utility>
namespace td {
namespace detail {
class EventPromise final : public PromiseInterface<Unit> {
public:
void set_value(Unit &&) final {

View File

@ -7,12 +7,9 @@
#pragma once
#include "td/utils/CancellationToken.h"
#include "td/utils/Closure.h"
#include "td/utils/common.h"
#include "td/utils/invoke.h"
#include "td/utils/logging.h"
#include "td/utils/MovableValue.h"
#include "td/utils/ScopeGuard.h"
#include "td/utils/Status.h"
#include <tuple>