Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added newly_created bool to threads #1069

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/dpp/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ class DPP_EXPORT thread : public channel, public json_interface<thread> {
*/
uint8_t member_count = 0;

/**
* @brief Was this thread newly created?
* @note This will only show in dpp::cluster::on_thread_create if the thread was just made.
*/
bool newly_created{false};

/**
* @brief Returns true if the thread is within an announcement channel
*
Expand Down
2 changes: 2 additions & 0 deletions src/dpp/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ thread& thread::fill_from_json_impl(json* j) {
set_int32_not_null(j, "total_message_sent", this->total_messages_sent);
set_int8_not_null(j, "message_count", this->message_count);
set_int8_not_null(j, "member_count", this->member_count);
set_bool_not_null(j, "newly_created", this->newly_created);

auto json_metadata = (*j)["thread_metadata"];
metadata.archived = bool_not_null(&json_metadata, "archived");
metadata.archive_timestamp = ts_not_null(&json_metadata, "archive_timestamp");
Expand Down
Loading