refactor(tgbot-front): replaced the context usage with a new thread-safe one
This commit is contained in:
parent
b1c035ae35
commit
a6848bb4d7
5 changed files with 55 additions and 56 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include <vector>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include "constants.hpp"
|
||||
|
||||
enum class UserState {
|
||||
MAIN_MENU, // Главное меню
|
||||
|
|
@ -50,6 +51,13 @@ public:
|
|||
// Получить текущий шаг (последний в истории) или std::nullopt, если нет истории
|
||||
std::optional<NavigationStep> getCurrentStep(int64_t userId) const;
|
||||
|
||||
// pop последнего состояния. true в случае удачи
|
||||
bool popStep(int64_t userId);
|
||||
|
||||
// Удалить контекст пользователя (например, при логауте)
|
||||
void removeContext(int64_t userId);
|
||||
|
||||
/// @brief Создает контекст начального меню для пользователя
|
||||
/// @param userId
|
||||
void createInitContext(int64_t userId);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue