From 7385ceccb109b7aca09efdaa83b4b627eab81da9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 7 Apr 2022 20:00:52 +0100 Subject: Expose the invite announcement level to modules. --- include/modules/invite.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include') diff --git a/include/modules/invite.h b/include/modules/invite.h index ba76f577e..20d06e3fb 100644 --- a/include/modules/invite.h +++ b/include/modules/invite.h @@ -26,6 +26,23 @@ namespace Invite class API; class Invite; + + /** Used to indicate who we announce invites to on a channel. */ + enum AnnounceState + { + /** Don't send invite announcements. */ + ANNOUNCE_NONE, + + /** Send invite announcements to all users. */ + ANNOUNCE_ALL, + + /** Send invite announcements to channel operators and higher. */ + ANNOUNCE_OPS, + + /** Send invite announcements to channel half-operators (if available) and higher. */ + ANNOUNCE_DYNAMIC + }; + typedef insp::intrusive_list List; } @@ -51,6 +68,9 @@ class Invite::APIBase : public DataProvider */ virtual Invite* Find(LocalUser* user, Channel* chan) = 0; + /** Returns the announcement behaviour for invites from . */ + virtual AnnounceState GetAnnounceState() const = 0; + /** Returns the list of channels a user has been invited to but has not yet joined. * @param user User whose invite list to retrieve * @return List of channels the user is invited to or NULL if the list is empty -- cgit v1.3.1-10-gc9f91