init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
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
|
||||
*/
|
||||
#include "menu/menu_item_rate_transcribe_session.h"
|
||||
|
||||
#include "api/api_transcribes.h"
|
||||
#include "apiwrap.h"
|
||||
#include "data/data_peer.h"
|
||||
#include "data/data_session.h"
|
||||
#include "history/history.h"
|
||||
#include "history/history_item.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "main/main_session.h"
|
||||
#include "ui/rect.h"
|
||||
#include "ui/vertical_list.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "styles/style_chat_helpers.h"
|
||||
#include "styles/style_layers.h"
|
||||
|
||||
namespace Menu {
|
||||
|
||||
Fn<void(bool)> RateTranscribeCallbackFactory(
|
||||
not_null<HistoryItem*> item) {
|
||||
return [item](bool good) {
|
||||
item->history()->peer->session().api().transcribes().rate(
|
||||
item,
|
||||
good);
|
||||
};
|
||||
}
|
||||
|
||||
bool HasRateTranscribeItem(not_null<HistoryItem*> item) {
|
||||
const auto &peer = item->history()->peer;
|
||||
if (!peer->session().api().transcribes().entry(
|
||||
item).result.isEmpty()) {
|
||||
return !peer->session().api().transcribes().isRated(item);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace Menu
|
||||
Reference in New Issue
Block a user