summaryrefslogtreecommitdiff
path: root/include/modules/botserv
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-03-08 12:22:07 +0000
committerSadie Powell <sadie@witchery.services>2025-03-08 12:22:07 +0000
commitdf0cd3ef3e9a5cd1230aebdb45569f54512373ad (patch)
tree3abf54908e7aac069da940f1d6db85829a46b302 /include/modules/botserv
parent9e37a643f13a8e6b5b8468f245f21fd23238f058 (diff)
Move some headers around.
Diffstat (limited to 'include/modules/botserv')
-rw-r--r--include/modules/botserv/badwords.h72
-rw-r--r--include/modules/botserv/kick.h46
2 files changed, 118 insertions, 0 deletions
diff --git a/include/modules/botserv/badwords.h b/include/modules/botserv/badwords.h
new file mode 100644
index 000000000..ae78df8b1
--- /dev/null
+++ b/include/modules/botserv/badwords.h
@@ -0,0 +1,72 @@
+/* BotServ core functions
+ *
+ * (C) 2003-2025 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
+#pragma once
+
+/** Flags for badwords
+ */
+enum BadWordType
+{
+ /* Always kicks if the word is said */
+ BW_ANY,
+ /* User must way the entire word */
+ BW_SINGLE,
+ /* The word has to start with the badword */
+ BW_START,
+ /* The word has to end with the badword */
+ BW_END
+};
+
+/* Structure used to contain bad words. */
+struct BadWord
+{
+ Anope::string chan;
+ Anope::string word;
+ BadWordType type;
+
+ virtual ~BadWord() = default;
+protected:
+ BadWord() = default;
+};
+
+struct BadWords
+{
+ virtual ~BadWords() = default;
+
+ /** Add a badword to the badword list
+ * @param word The badword
+ * @param type The type (SINGLE START END)
+ * @return The badword
+ */
+ virtual BadWord *AddBadWord(const Anope::string &word, BadWordType type) = 0;
+
+ /** Get a badword structure by index
+ * @param index The index
+ * @return The badword
+ */
+ virtual BadWord *GetBadWord(unsigned index) const = 0;
+
+ /** Get how many badwords are on this channel
+ * @return The number of badwords in the vector
+ */
+ virtual unsigned GetBadWordCount() const = 0;
+
+ /** Remove a badword
+ * @param index The index of the badword
+ */
+ virtual void EraseBadWord(unsigned index) = 0;
+
+ /** Clear all badwords from the channel
+ */
+ virtual void ClearBadWords() = 0;
+
+ virtual void Check() = 0;
+};
diff --git a/include/modules/botserv/kick.h b/include/modules/botserv/kick.h
new file mode 100644
index 000000000..8ad44aab5
--- /dev/null
+++ b/include/modules/botserv/kick.h
@@ -0,0 +1,46 @@
+/* BotServ core functions
+ *
+ * (C) 2003-2025 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
+#pragma once
+
+/* Indices for TTB (Times To Ban) */
+enum
+{
+ TTB_BOLDS,
+ TTB_COLORS,
+ TTB_REVERSES,
+ TTB_UNDERLINES,
+ TTB_BADWORDS,
+ TTB_CAPS,
+ TTB_FLOOD,
+ TTB_REPEAT,
+ TTB_ITALICS,
+ TTB_AMSGS,
+ TTB_SIZE
+};
+
+struct KickerData
+{
+ bool amsgs, badwords, bolds, caps, colors, flood, italics, repeat, reverses, underlines;
+ int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
+ int16_t capsmin, capspercent; /* For CAPS kicker */
+ int16_t floodlines, floodsecs; /* For FLOOD kicker */
+ int16_t repeattimes; /* For REPEAT kicker */
+
+ bool dontkickops, dontkickvoices;
+
+protected:
+ KickerData() = default;
+
+public:
+ virtual ~KickerData() = default;
+ virtual void Check(ChannelInfo *ci) = 0;
+};