#pragma once #include #include "slimchat.h" #include "tgclient.h" #include "message.h" class TgTUI { public: TgTUI(); ~TgTUI(); void run(); void stop(); const std::vector& getChats(); private: void initDoneCB(); void threadLoop(); void handleNewChat(objptr chat); void handleChatMessages(const std::vector>& msgs); TGClient tgclient; std::vector chats; std::vector chatsItemList; std::vector> messages; bool shouldRun = false; std::thread tuiThread; };