summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/regchannel.h28
-rw-r--r--include/services.h19
2 files changed, 35 insertions, 12 deletions
diff --git a/include/regchannel.h b/include/regchannel.h
index 59a956710..45c8341b6 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -40,8 +40,7 @@ class CoreExport ChannelInfo : public Extensible
int16 *levels; /* Access levels for commands */
std::vector<ChanAccess *> access; /* List of authorized users */
- uint16 akickcount;
- AutoKick *akick; /* List of users to kickban */
+ std::vector<AutoKick *> akick; /* List of users to kickban */
std::bitset<128> mlock_on;
std::bitset<128> mlock_off;
@@ -115,6 +114,31 @@ class CoreExport ChannelInfo : public Extensible
*/
void ClearAccess();
+ /** Add an akick entry to the channel by NickCore
+ * @param user The user who added the akick
+ * @param akicknc The nickcore being akicked
+ * @param reason The reason for the akick
+ * @param t The time the akick was added, defaults to now
+ */
+ AutoKick *AddAkick(const std::string &user, NickCore *akicknc, const std::string &reason, time_t t = time(NULL));
+
+ /** Add an akick entry to the channel by reason
+ * @param user The user who added the akick
+ * @param mask The mask of the akick
+ * @param reason The reason for the akick
+ * @param t The time the akick was added, defaults to now
+ */
+ AutoKick *AddAkick(const std::string &user, const std::string &mask, const std::string &reason, time_t t = time(NULL));
+
+ /** Erase an entry from the channel akick list
+ * @param akick The akick
+ */
+ void EraseAkick(AutoKick *akick);
+
+ /** Clear the whole akick list
+ */
+ void ClearAkick();
+
/** Check if a mode is mlocked
* @param Name The mode
* @param status True to check mlock on, false for mlock off
diff --git a/include/services.h b/include/services.h
index d90146e41..738c4b283 100644
--- a/include/services.h
+++ b/include/services.h
@@ -645,19 +645,18 @@ struct ChanAccess {
};
/* AutoKick data. */
-typedef struct {
- int16 in_use; /* Always 0 if not in use */
- int16 is_nick; /* 1 if a regged nickname, 0 if a nick!user@host mask */
+struct AutoKick
+{
uint16 flags;
- union {
- char *mask; /* Guaranteed to be non-NULL if in use, NULL if not */
- NickCore *nc; /* Same */
- } u;
- char *reason;
- char *creator;
+ /* Only one of these can be in use */
+ std::string mask;
+ NickCore *nc;
+
+ std::string reason;
+ std::string creator;
time_t addtime;
-} AutoKick;
+};
#define AK_USED 0x0001
#define AK_ISNICK 0x0002