Skip to content

Commit

Permalink
feat: added SUPPRESS_NOTIFICATIONS message flag (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis authored Feb 12, 2023
2 parents 44fa006 + 4091cda commit 2a35f18
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/dpp/automod.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct DPP_EXPORT automod_metadata : public json_interface<automod_metadata> {
* @brief @brief Substrings which will be searched for in content (Maximum of 1000).
*
* Each keyword can be a phrase which contains multiple words.
* All keywords are case insensitive and can be up to 30 characters.
* All keywords are case insensitive and can be up to 60 characters.
*
* Wildcard symbols (`*`) can be used to customize how each keyword will be matched.
*
Expand Down Expand Up @@ -165,7 +165,7 @@ struct DPP_EXPORT automod_metadata : public json_interface<automod_metadata> {
* @brief Substrings which should not trigger the rule.
*
* Each keyword can be a phrase which contains multiple words.
* All keywords are case insensitive and can be up to 30 characters.
* All keywords are case insensitive and can be up to 60 characters.
*
* Wildcard symbols (`*`) can be used to customize how each keyword will be matched.
*
Expand Down
2 changes: 1 addition & 1 deletion include/dpp/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ class DPP_EXPORT thread : public channel {
*/
uint8_t message_count;

/** Approximate count of members in a thread (threads) */
/** Approximate count of members in a thread (stops counting at 50) */
uint8_t member_count;

/**
Expand Down
9 changes: 9 additions & 0 deletions include/dpp/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,8 @@ enum message_flags : uint16_t {
m_loading = 1 << 7,
/// this message failed to mention some roles and add their members to the thread
m_thread_mention_failed = 1 << 8,
/// this message will not trigger push and desktop notifications
m_suppress_notifications = 1 << 9,
};

/**
Expand Down Expand Up @@ -1394,6 +1396,13 @@ struct DPP_EXPORT message : public managed {
*/
bool is_thread_mention_failed() const;

/**
* @brief True if the message will not trigger push and desktop notifications
*
* @return True if notifications suppressed
*/
bool suppress_notifications() const;

/**
* @brief Add a component (button) to message
*
Expand Down
4 changes: 4 additions & 0 deletions src/dpp/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,10 @@ bool message::is_thread_mention_failed() const {
return flags & m_thread_mention_failed;
}

bool message::suppress_notifications() const {
return flags & m_suppress_notifications;
}

message::~message() = default;


Expand Down

0 comments on commit 2a35f18

Please sign in to comment.