summaryrefslogtreecommitdiff
path: root/include/channels.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/channels.h')
-rw-r--r--include/channels.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/include/channels.h b/include/channels.h
index 845f8fc36..8c5d83c5d 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -44,7 +44,7 @@ struct UserContainer
{
User *user;
UserData ud;
- Flags<ChannelModeName> *Status;
+ ChannelStatus *Status;
UserContainer(User *u) : user(u) { }
virtual ~UserContainer() { }
@@ -104,6 +104,11 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
int16 bouncy_modes; /* Did we fail to set modes here? */
int16 topic_sync; /* Is the topic in sync? */
+ /** Call if we need to unset all modes and clear all user status (internally).
+ * Only useful if we get a SJOIN with a TS older than what we have here
+ */
+ void Reset();
+
/** Restore the channel topic, set mlock (key), set stickied bans, etc
*/
void Sync();
@@ -217,23 +222,27 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
/** Clear all the modes from the channel
* @param bi The client unsetting the modes
+ * @param internal Only remove the modes internally
*/
- void ClearModes(BotInfo *bi = NULL);
+ void ClearModes(BotInfo *bi = NULL, bool internal = false);
/** Clear all the bans from the channel
* @param bi The client unsetting the modes
+ * @param internal Only remove the modes internally
*/
- void ClearBans(BotInfo *bi = NULL);
+ void ClearBans(BotInfo *bi = NULL, bool internal = false);
/** Clear all the excepts from the channel
* @param bi The client unsetting the modes
+ * @param internal Only remove the modes internally
*/
- void ClearExcepts(BotInfo *bi = NULL);
+ void ClearExcepts(BotInfo *bi = NULL, bool internal = false);
/** Clear all the invites from the channel
* @param bi The client unsetting the modes
+ * @param internal Only remove the modes internally
*/
- void ClearInvites(BotInfo *bi = NULL);
+ void ClearInvites(BotInfo *bi = NULL, bool internal = false);
/** Get a param from the channel
* @param Name The mode
@@ -268,6 +277,13 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
* @return true if the kick was scucessful, false if a module blocked the kick
*/
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
+
+ /** Get a string of the modes set on this channel
+ * @param complete Include mode parameters
+ * @param plus If set to false (with complete), mode parameters will not be given for modes requring no parameters to be unset
+ * @return A mode string
+ */
+ Anope::string GetModes(bool complete, bool plus);
};
#endif // CHANNELS_H