diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp index ee0e28f1e..aa36a08e7 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp @@ -246,51 +246,6 @@ void ShowEditPermissions( }, box->lifetime()); } -void ShowEditInviteLinks( - not_null navigation, - not_null peer) { - auto content = Box(navigation, peer); - const auto box = QPointer(content.data()); - navigation->parentController()->show( - std::move(content), - Ui::LayerOption::KeepOther); - const auto saving = box->lifetime().make_state(0); - const auto save = [=]( - not_null peer, - EditPeerPermissionsBox::Result result) { - Expects(result.slowmodeSeconds == 0 || peer->isChannel()); - - const auto close = crl::guard(box, [=] { box->closeBox(); }); - SaveDefaultRestrictions( - peer, - result.rights, - close); - if (const auto channel = peer->asChannel()) { - SaveSlowmodeSeconds(channel, result.slowmodeSeconds, close); - } - }; - box->saveEvents( - ) | rpl::start_with_next([=](EditPeerPermissionsBox::Result result) { - if (*saving) { - return; - } - *saving = true; - - const auto saveFor = peer->migrateToOrMe(); - const auto chat = saveFor->asChat(); - if (!result.slowmodeSeconds || !chat) { - save(saveFor, result); - return; - } - const auto api = &peer->session().api(); - api->migrateChat(chat, [=](not_null channel) { - save(channel, result); - }, [=](const MTP::Error &error) { - *saving = false; - }); - }, box->lifetime()); -} - } // namespace namespace { diff --git a/Telegram/SourceFiles/boxes/send_files_box.cpp b/Telegram/SourceFiles/boxes/send_files_box.cpp index 79a240a8c..b43c3a7bf 100644 --- a/Telegram/SourceFiles/boxes/send_files_box.cpp +++ b/Telegram/SourceFiles/boxes/send_files_box.cpp @@ -68,10 +68,6 @@ inline bool CanAddUrls(const QList &urls) { return !urls.isEmpty() && ranges::all_of(urls, &QUrl::isLocalFile); } -inline bool IsSingleItem(const Ui::PreparedList &list) { - return list.files.size() == 1; -} - void FileDialogCallback( FileDialog::OpenResult &&result, Fn checkResult, diff --git a/Telegram/SourceFiles/calls/group/calls_group_call.cpp b/Telegram/SourceFiles/calls/group/calls_group_call.cpp index fa300c229..71508fa7d 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_call.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_call.cpp @@ -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 &list) { const auto i = ranges::max_element( diff --git a/Telegram/SourceFiles/calls/group/calls_group_menu.cpp b/Telegram/SourceFiles/calls/group/calls_group_menu.cpp index b588ff97d..a57a1b3cb 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_menu.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_menu.cpp @@ -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 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( diff --git a/Telegram/SourceFiles/core/utils.cpp b/Telegram/SourceFiles/core/utils.cpp index c640ebf82..10d3f9ad7 100644 --- a/Telegram/SourceFiles/core/utils.cpp +++ b/Telegram/SourceFiles/core/utils.cpp @@ -63,57 +63,6 @@ struct CRYPTO_dynlock_value { namespace { bool _sslInited = false; QMutex *_sslLocks = nullptr; - void _sslLockingCallback(int mode, int type, const char *file, int line) { - if (!_sslLocks) return; // not inited - - if (mode & CRYPTO_LOCK) { - _sslLocks[type].lock(); - } else { - _sslLocks[type].unlock(); - } - } - void _sslThreadId(CRYPTO_THREADID *id) { - CRYPTO_THREADID_set_pointer(id, QThread::currentThreadId()); - } - CRYPTO_dynlock_value *_sslCreateFunction(const char *file, int line) { - return new CRYPTO_dynlock_value(); - } - void _sslLockFunction(int mode, CRYPTO_dynlock_value *l, const char *file, int line) { - if (mode & CRYPTO_LOCK) { - l->mutex.lock(); - } else { - l->mutex.unlock(); - } - } - void _sslDestroyFunction(CRYPTO_dynlock_value *l, const char *file, int line) { - delete l; - } - - int _ffmpegLockManager(void **mutex, AVLockOp op) { - switch (op) { - case AV_LOCK_CREATE: { - Assert(*mutex == nullptr); - *mutex = reinterpret_cast(new QMutex()); - } break; - - case AV_LOCK_OBTAIN: { - Assert(*mutex != nullptr); - reinterpret_cast(*mutex)->lock(); - } break; - - case AV_LOCK_RELEASE: { - Assert(*mutex != nullptr); - reinterpret_cast(*mutex)->unlock(); - }; break; - - case AV_LOCK_DESTROY: { - Assert(*mutex != nullptr); - delete reinterpret_cast(*mutex); - *mutex = nullptr; - } break; - } - return 0; - } } namespace ThirdParty { diff --git a/Telegram/SourceFiles/data/data_group_call.cpp b/Telegram/SourceFiles/data/data_group_call.cpp index 07db42880..8fd732dc9 100644 --- a/Telegram/SourceFiles/data/data_group_call.cpp +++ b/Telegram/SourceFiles/data/data_group_call.cpp @@ -33,11 +33,6 @@ constexpr auto kWaitForUpdatesTimeout = 3 * crl::time(1000); }); } -[[nodiscard]] const std::string &EmptyEndpoint() { - static const auto result = std::string(); - return result; -} - } // namespace const std::string &GroupCallParticipant::cameraEndpoint() const { diff --git a/Telegram/SourceFiles/export/export_api_wrap.cpp b/Telegram/SourceFiles/export/export_api_wrap.cpp index cf7c7a45e..eb8353d6a 100644 --- a/Telegram/SourceFiles/export/export_api_wrap.cpp +++ b/Telegram/SourceFiles/export/export_api_wrap.cpp @@ -40,12 +40,6 @@ struct LocationKey { } }; -std::tuple value_ordering_helper(const LocationKey &value) { - return std::tie( - value.type, - value.id); -} - LocationKey ComputeLocationKey(const Data::FileLocation &value) { auto result = LocationKey(); result.type = value.dcId; diff --git a/Telegram/SourceFiles/export/output/export_output_html.cpp b/Telegram/SourceFiles/export/output/export_output_html.cpp index d6ba9196d..16c9c0d3a 100644 --- a/Telegram/SourceFiles/export/output/export_output_html.cpp +++ b/Telegram/SourceFiles/export/output/export_output_html.cpp @@ -320,12 +320,6 @@ QByteArray FormatTimeText(TimeId date) { + Data::NumberToString(parsed.minute(), 2); } -QByteArray SerializeLink( - const Data::Utf8String &text, - const QString &path) { - return "" + text + ""; -} - } // namespace namespace details { diff --git a/Telegram/SourceFiles/media/audio/media_child_ffmpeg_loader.cpp b/Telegram/SourceFiles/media/audio/media_child_ffmpeg_loader.cpp index 179a53589..1bd3d658d 100644 --- a/Telegram/SourceFiles/media/audio/media_child_ffmpeg_loader.cpp +++ b/Telegram/SourceFiles/media/audio/media_child_ffmpeg_loader.cpp @@ -17,15 +17,6 @@ constexpr AVSampleFormat AudioToFormat = AV_SAMPLE_FMT_S16; constexpr int64_t AudioToChannelLayout = AV_CH_LAYOUT_STEREO; constexpr int32 AudioToChannels = 2; -bool IsPlanarFormat(int format) { - return (format == AV_SAMPLE_FMT_U8P) - || (format == AV_SAMPLE_FMT_S16P) - || (format == AV_SAMPLE_FMT_S32P) - || (format == AV_SAMPLE_FMT_FLTP) - || (format == AV_SAMPLE_FMT_DBLP) - || (format == AV_SAMPLE_FMT_S64P); -} - } // namespace ChildFFMpegLoader::ChildFFMpegLoader( diff --git a/Telegram/SourceFiles/media/view/media_view_group_thumbs.cpp b/Telegram/SourceFiles/media/view/media_view_group_thumbs.cpp index cdc042e7e..1ed1da330 100644 --- a/Telegram/SourceFiles/media/view/media_view_group_thumbs.cpp +++ b/Telegram/SourceFiles/media/view/media_view_group_thumbs.cpp @@ -38,6 +38,7 @@ int Round(float64 value) { using Context = GroupThumbs::Context; using Key = GroupThumbs::Key; +#if 0 [[nodiscard]] QString DebugSerializeMsgId(FullMsgId itemId) { return QString("msg%1_%2").arg(itemId.channel.bare).arg(itemId.msg); } @@ -73,6 +74,7 @@ using Key = GroupThumbs::Key; return "null"; }); } +#endif Data::FileOrigin ComputeFileOrigin(const Key &key, const Context &context) { return v::match(key, [&](PhotoId photoId) { @@ -511,6 +513,7 @@ void GroupThumbs::RefreshFromSlice( } } +#if 0 template void ValidateSlice( const Slice &slice, @@ -544,6 +547,7 @@ void ValidateSlice( } } } +#endif template void GroupThumbs::fillItems( diff --git a/Telegram/SourceFiles/mtproto/session_private.cpp b/Telegram/SourceFiles/mtproto/session_private.cpp index afedfc35e..804c1ac0c 100644 --- a/Telegram/SourceFiles/mtproto/session_private.cpp +++ b/Telegram/SourceFiles/mtproto/session_private.cpp @@ -72,15 +72,6 @@ using namespace details; return idsStr + "]"; } -[[nodiscard]] QString LogIds(const QVector &ids) { - if (!ids.size()) return "[]"; - auto idsStr = QString("[%1").arg(*ids.cbegin()); - for (const auto id : ids) { - idsStr += QString(", %2").arg(id); - } - return idsStr + "]"; -} - [[nodiscard]] QString ComputeAppVersion() { return QString::fromLatin1(AppVersionStr) + ([] { #if defined OS_MAC_STORE diff --git a/Telegram/SourceFiles/settings/settings_privacy_security.cpp b/Telegram/SourceFiles/settings/settings_privacy_security.cpp index d588e48ef..62d797dc7 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_security.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_security.cpp @@ -237,15 +237,6 @@ void SetupArchiveAndMute( )); } -not_null*> AddSeparator( - not_null container) { - return container->add( - object_ptr>( - container, - object_ptr(container), - st::settingsSeparatorPadding)); -} - void SetupLocalPasscode( not_null controller, not_null container) { diff --git a/Telegram/SourceFiles/storage/localstorage.cpp b/Telegram/SourceFiles/storage/localstorage.cpp index 41610ed84..b4b635f4d 100644 --- a/Telegram/SourceFiles/storage/localstorage.cpp +++ b/Telegram/SourceFiles/storage/localstorage.cpp @@ -92,10 +92,6 @@ enum class WriteMapWhen { Soon, }; -bool _working() { - return !_basePath.isEmpty(); -} - bool CheckStreamStatus(QDataStream &stream) { if (stream.status() != QDataStream::Ok) { LOG(("Bad data stream status: %1").arg(stream.status())); diff --git a/Telegram/SourceFiles/storage/storage_domain.cpp b/Telegram/SourceFiles/storage/storage_domain.cpp index 2066fa5ef..d7d5ab96d 100644 --- a/Telegram/SourceFiles/storage/storage_domain.cpp +++ b/Telegram/SourceFiles/storage/storage_domain.cpp @@ -28,12 +28,6 @@ using namespace details; return "key_" + dataName; } -[[nodiscard]] QString ComputeInfoName(const QString &dataName) { - // We dropped old test authorizations when migrated to multi auth. - //return "info_" + dataName + (cTestMode() ? "[test]" : ""); - return "info_" + dataName; -} - } // namespace Domain::Domain(not_null owner, const QString &dataName) diff --git a/Telegram/SourceFiles/ui/controls/call_mute_button.cpp b/Telegram/SourceFiles/ui/controls/call_mute_button.cpp index 33a3bc94b..cac8dea77 100644 --- a/Telegram/SourceFiles/ui/controls/call_mute_button.cpp +++ b/Telegram/SourceFiles/ui/controls/call_mute_button.cpp @@ -142,10 +142,6 @@ auto Colors() { return result; } -bool IsMuted(CallMuteButtonType type) { - return (type != CallMuteButtonType::Active); -} - bool IsConnecting(CallMuteButtonType type) { return (type == CallMuteButtonType::Connecting); } diff --git a/Telegram/SourceFiles/ui/effects/round_checkbox.cpp b/Telegram/SourceFiles/ui/effects/round_checkbox.cpp index 87b4233c5..2aec274b6 100644 --- a/Telegram/SourceFiles/ui/effects/round_checkbox.cpp +++ b/Telegram/SourceFiles/ui/effects/round_checkbox.cpp @@ -258,37 +258,6 @@ CheckCaches *FrameCaches() { return result; } -void prepareCheckCaches(const style::RoundCheckbox *st, bool displayInactive, QPixmap &checkBgCache, QPixmap &checkFullCache) { - auto size = st->size; - auto wideSize = size * kWideScale; - auto cache = QImage(wideSize * cIntRetinaFactor(), wideSize * cIntRetinaFactor(), QImage::Format_ARGB32_Premultiplied); - cache.setDevicePixelRatio(cRetinaFactor()); - cache.fill(Qt::transparent); - { - Painter p(&cache); - PainterHighQualityEnabler hq(p); - - if (displayInactive) { - p.setPen(Qt::NoPen); - } else { - auto pen = st->border->p; - pen.setWidth(st->width); - p.setPen(pen); - } - p.setBrush(st->bgActive); - auto ellipse = QRect((wideSize - size) / 2, (wideSize - size) / 2, size, size); - p.drawEllipse(ellipse); - } - auto cacheIcon = cache; - { - Painter p(&cacheIcon); - auto ellipse = QRect((wideSize - size) / 2, (wideSize - size) / 2, size, size); - st->check.paint(p, ellipse.topLeft(), wideSize); - } - checkBgCache = Ui::PixmapFromImage(std::move(cache)); - checkFullCache = Ui::PixmapFromImage(std::move(cacheIcon)); -} - } // namespace RoundCheckbox::RoundCheckbox(const style::RoundCheckbox &st, Fn updateCallback) diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index 5335ab677..1c090e649 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -41,10 +41,6 @@ namespace Notifications { namespace Default { namespace { -int notificationMaxHeight() { - return st::notifyMinHeight + st::notifyReplyArea.heightMax + st::notifyBorderWidth; -} - QPoint notificationStartPosition() { const auto corner = Core::App().settings().notificationsCorner(); const auto window = Core::App().activeWindow(); diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp index c713a7598..55d21f6a7 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp @@ -254,10 +254,6 @@ void ImportFromFile( crl::guard(parent, callback)); } -[[nodiscard]] QString BytesToUTF8(QLatin1String string) { - return QString::fromUtf8(string.data(), string.size()); -} - // They're duplicated in window_theme.cpp:ChatBackground::ChatBackground. [[nodiscard]] QByteArray ReplaceAdjustableColors(QByteArray data) { const auto &themeObject = Background()->themeObject(); diff --git a/Telegram/SourceFiles/window/window_outdated_bar.cpp b/Telegram/SourceFiles/window/window_outdated_bar.cpp index 70fcebd1d..ab1a6e9f3 100644 --- a/Telegram/SourceFiles/window/window_outdated_bar.cpp +++ b/Telegram/SourceFiles/window/window_outdated_bar.cpp @@ -96,6 +96,7 @@ void Bar::paintEvent(QPaintEvent *e) { _soon ? st::outdateSoonBg : st::outdatedBg); } +#ifdef DESKTOP_APP_SPECIAL_TARGET QString LastHiddenPath() { return cWorkingDir() + qsl("tdata/outdated_hidden"); } @@ -145,6 +146,7 @@ void Closed() { reinterpret_cast(&value), sizeof(qint32))); } +#endif // DESKTOP_APP_SPECIAL_TARGET } // namespace