// This is the source code of AyuGram for Desktop. // // We do not and cannot prevent the use of our code, // but be respectful and credit the original author. // // Copyright @Radolyn, 2025 #pragma once #include "ayu/data/entities.h" #include "core/application.h" #include "dialogs/dialogs_main_list.h" #include "main/main_domain.h" using Callback = Fn; Main::Session *getSession(ID userId); void dispatchToMainThread(std::function callback, int delay = 0); ID getDialogIdFromPeer(not_null peer); ID getBareID(not_null peer); bool isExteraPeer(ID peerId); bool isSupporterPeer(ID peerId); bool isMessageHidden(not_null item); void MarkAsReadChatList(not_null list); void MarkAsReadThread(not_null thread); void readHistory(not_null message); QString formatTTL(int time); QString formatDateTime(const QDateTime &date); QString getDCName(int dc); QString getMediaSize(not_null message); QString getMediaMime(not_null message); QString getMediaName(not_null message); QString getMediaResolution(not_null message); QString getMediaDC(not_null message); QString getPeerDC(not_null peer); int getScheduleTime(int64 sumSize); void searchById(ID userId, Main::Session *session, bool retry, const Callback &callback); void searchById(ID userId, Main::Session *session, const Callback &callback); ID getUserIdFromPackId(uint64 id);