FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
tdesktop/Telegram/SourceFiles/api/api_transcribes.h at dev · dmitry/tdesktop · GitHub
dmitry
tdesktop
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
tdesktop
/
Telegram
/
SourceFiles
/
api
/
api_transcribes.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
81 lines (61 loc) · 1.93 KB
Breadcrumbs
tdesktop
/
Telegram
/
SourceFiles
/
api
/
api_transcribes.h
Copy path
File metadata and controls
81 lines (61 loc) · 1.93 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
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
"
#
include
"
spellcheck/spellcheck_types.h
"
class
ApiWrap
;
namespace
Main
{
class
Session
;
}
//
namespace Main
namespace
Api
{
struct
SummaryEntry
{
TextWithEntities result;
LanguageId languageId;
bool
shown =
false
;
bool
loading =
false
;
bool
premiumRequired =
false
;
mtpRequestId requestId =
0
;
};
class
Transcribes
final
{
public:
explicit
Transcribes
(not_null<ApiWrap*> api);
struct
Entry
{
QString result;
bool
shown =
false
;
bool
failed =
false
;
bool
toolong =
false
;
bool
pending =
false
;
bool
roundview =
false
;
mtpRequestId requestId =
0
;
};
void
toggle
(not_null<HistoryItem*> item);
[[nodiscard]]
const
Entry &
entry
(not_null<HistoryItem*> item)
const
;
void
toggleSummary
(not_null<HistoryItem*> item);
[[nodiscard]]
const
SummaryEntry &
summary
(
not_null<
const
HistoryItem*> item)
const
;
void
checkSummaryToTranslate
(FullMsgId id);
void
apply
(
const
MTPDupdateTranscribedAudio &update);
[[nodiscard]]
bool
freeFor
(not_null<HistoryItem*> item)
const
;
[[nodiscard]]
bool
isRated
(not_null<HistoryItem*> item)
const
;
void
rate
(not_null<HistoryItem*> item,
bool
isGood);
[[nodiscard]]
bool
trialsSupport
();
[[nodiscard]]
TimeId
trialsRefreshAt
();
[[nodiscard]]
int
trialsCount
();
[[nodiscard]]
crl::time
trialsMaxLengthMs
()
const
;
private:
void
load
(not_null<HistoryItem*> item);
void
summarize
(not_null<HistoryItem*> item);
const
not_null<Main::Session*> _session;
MTP
::Sender _api;
int
_trialsCount = -
1
;
std::optional<
bool
> _trialsSupport;
TimeId _trialsRefreshAt = -
1
;
base::flat_map<FullMsgId, Entry> _map;
base::flat_map<uint64, FullMsgId> _ids;
base::flat_map<FullMsgId, SummaryEntry> _summaries;
};
}
//
namespace Api
Back
|
FazBrowse Home
|
New Git URL