2022-05-24 15:38:46 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "mtproto/sender.h"
|
|
|
|
|
|
|
|
class ApiWrap;
|
|
|
|
|
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
|
|
|
namespace Api {
|
|
|
|
|
|
|
|
class Transcribes final {
|
|
|
|
public:
|
|
|
|
explicit Transcribes(not_null<ApiWrap*> api);
|
|
|
|
|
|
|
|
struct Entry {
|
|
|
|
QString result;
|
|
|
|
bool shown = false;
|
|
|
|
bool failed = false;
|
2022-06-06 14:04:27 +00:00
|
|
|
bool toolong = false;
|
2022-05-24 15:38:46 +00:00
|
|
|
bool pending = false;
|
|
|
|
mtpRequestId requestId = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
void toggle(not_null<HistoryItem*> item);
|
|
|
|
[[nodiscard]] const Entry &entry(not_null<HistoryItem*> item) const;
|
|
|
|
|
2022-06-06 05:44:39 +00:00
|
|
|
void apply(const MTPDupdateTranscribedAudio &update);
|
2022-05-24 15:38:46 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void load(not_null<HistoryItem*> item);
|
|
|
|
|
|
|
|
const not_null<Main::Session*> _session;
|
|
|
|
MTP::Sender _api;
|
|
|
|
|
|
|
|
base::flat_map<FullMsgId, Entry> _map;
|
|
|
|
base::flat_map<uint64, FullMsgId> _ids;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Api
|