This commit is contained in:
Martin Slachta
2026-07-18 14:31:15 +02:00
commit a04f0dc262
3343 changed files with 1140208 additions and 0 deletions
@@ -0,0 +1,19 @@
project(tw_chat_lib)
file(GLOB_RECURSE HEADERS
include/*.hpp
)
add_library(${PROJECT_NAME} OBJECT ${HEADERS} ${PROTO_FILES})
add_library(tw::chat::lib ALIAS ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME}
PUBLIC
./include/
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
spdlog::spdlog
tw::network
)
@@ -0,0 +1,10 @@
#pragma once
namespace tw::chat {
enum class ChatClientError {
PermissionDenied,
ChannelNotFound,
};
} // namespace tw::chat
@@ -0,0 +1,10 @@
#pragma once
namespace tw::chat {
enum class ChatServerError {
PermissionDenied,
ChannelNotFound,
};
} // namespace tw::chat
@@ -0,0 +1,20 @@
#pragma once
#include <chrono>
namespace tw::chat {
class ChatMessage {
public:
using Clock = std::chrono::system_clock;
using TimePoint = Clock::time_point;
TimePoint timestamp;
uint64_t client_id;
uint64_t channel_id;
std::string message;
};
}