2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix -Wunused-function warnings

This commit is contained in:
Ilya Fedin
2021-07-12 11:13:58 +04:00
committed by John Preston
parent 84b1fac0c8
commit 89765340c3
19 changed files with 6 additions and 231 deletions

View File

@@ -74,12 +74,6 @@ constexpr auto kMaxMediumQualities = 16; // 4 Fulls or 16 Mediums.
return msgId / double(1ULL << 32);
}
[[nodiscard]] std::string ReadJsonString(
const QJsonObject &object,
const char *key) {
return object.value(key).toString().toStdString();
}
[[nodiscard]] uint64 FindLocalRaisedHandRating(
const std::vector<Data::GroupCallParticipant> &list) {
const auto i = ranges::max_element(

View File

@@ -109,34 +109,6 @@ void StopGroupCallRecordingBox(
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
}
[[nodiscard]] auto ToDurationFrom(TimeId startDate) {
return [=] {
const auto now = base::unixtime::now();
const auto elapsed = std::max(now - startDate, 0);
const auto hours = elapsed / 3600;
const auto minutes = (elapsed % 3600) / 60;
const auto seconds = (elapsed % 60);
return hours
? QString("%1:%2:%3"
).arg(hours
).arg(minutes, 2, 10, QChar('0')
).arg(seconds, 2, 10, QChar('0'))
: QString("%1:%2"
).arg(minutes
).arg(seconds, 2, 10, QChar('0'));
};
}
[[nodiscard]] rpl::producer<QString> ToRecordDuration(TimeId startDate) {
return !startDate
? (rpl::single(QString()) | rpl::type_erased())
: rpl::single(
rpl::empty_value()
) | rpl::then(base::timer_each(
crl::time(1000)
)) | rpl::map(ToDurationFrom(startDate));
}
class JoinAsAction final : public Ui::Menu::ItemBase {
public:
JoinAsAction(