This commit is contained in:
IlyaShurupov 2023-09-03 10:48:24 +03:00
parent b3d06906ff
commit b0d5226915
7 changed files with 317 additions and 52 deletions

View file

@ -1,6 +1,8 @@
#pragma once
#include "Module.hpp"
#include "Strings.hpp"
#include "Map.hpp"
#include "List.hpp"
namespace tp {
@ -14,14 +16,30 @@ namespace tp {
tp::int1 pass[SIZE] {0};
};
typedef List<String> ChatsList;
struct Message {
String user;
String text;
};
typedef List<Message> ChatHistory;
public:
ChatAPI() = default;
[[nodiscard]] bool isLogged() const;
void login(const Credentials& credentials);
[[nodiscard]] const ChatsList* getChatsList() const;
[[nodiscard]] const ChatHistory* getChatHistory(const String& chatName) const;
void logout();
void send(const String& chatName, const Message& message);
private:
bool mLogged = false;
Credentials mCredentials;
ChatsList mChatsList;
Map<String, ChatHistory> mChatHistories;
};
}