Skip to content

Commit

Permalink
fix: thread safety for event objects
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Dec 16, 2024
1 parent fd647f6 commit 3790f1f
Show file tree
Hide file tree
Showing 32 changed files with 292 additions and 140 deletions.
14 changes: 7 additions & 7 deletions include/dpp/collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,27 +166,27 @@ class collected_reaction : public managed {
/**
* @brief Reacting user.
*/
user react_user;
user react_user{};

/**
* @brief Reacting guild.
*/
guild* react_guild{};
guild react_guild{};

/**
* @brief Reacting guild member.
*/
guild_member react_member;
guild_member react_member{};

/**
* @brief Reacting channel.
*/
channel* react_channel{};
channel react_channel{};

/**
* @brief Reacted emoji.
*/
emoji react_emoji;
emoji react_emoji{};

/**
* @brief Optional: ID of the user who authored the message which was reacted to.
Expand Down Expand Up @@ -351,7 +351,7 @@ class channel_collector : public channel_collector_t {
* @param element element to filter
* @return Returned item to add to the list, or nullptr to skip adding this element
*/
virtual const dpp::channel* filter(const dpp::channel_create_t& element) { return element.created; }
virtual const dpp::channel* filter(const dpp::channel_create_t& element) { return &element.created; }

/**
* @brief Destroy the channel collector object
Expand Down Expand Up @@ -425,7 +425,7 @@ class role_collector : public role_collector_t {
* @param element element to filter
* @return Returned item to add to the list, or nullptr to skip adding this element
*/
virtual const dpp::role* filter(const dpp::guild_role_create_t& element) { return element.created; }
virtual const dpp::role* filter(const dpp::guild_role_create_t& element) { return &element.created; }

/**
* @brief Destroy the role collector object
Expand Down
Loading

0 comments on commit 3790f1f

Please sign in to comment.