summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/extern.h6
-rw-r--r--include/modes.h10
-rw-r--r--include/modules.h5
-rw-r--r--include/services.h23
4 files changed, 26 insertions, 18 deletions
diff --git a/include/extern.h b/include/extern.h
index 75ad3eb28..a46894fa2 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -68,9 +68,6 @@ E void bot_raw_mode(User * requester, ChannelInfo * ci, const char *mode, char *
E Channel *chanlist[1024];
-E void chan_adduser2(User * user, Channel * c);
-E Channel *join_user_update(User * user, Channel * chan, const char *name, time_t chants);
-
E void get_channel_stats(long *nrec, long *memuse);
E Channel *findchan(const char *chan);
E Channel *firstchan();
@@ -78,8 +75,6 @@ E Channel *nextchan();
E void ChanSetInternalModes(Channel *c, int ac, const char **av);
-E void chan_deluser(User * user, Channel * c);
-
E int is_on_chan(Channel * c, User * u);
E User *nc_on_chan(Channel * c, NickCore * nc);
@@ -97,7 +92,6 @@ E void do_cmode(const char *source, int ac, const char **av);
E void do_join(const char *source, int ac, const char **av);
E void do_kick(const std::string &source, int ac, const char **av);
E void do_part(const char *source, int ac, const char **av);
-E void do_sjoin(const char *source, int ac, const char **av);
E void do_topic(const char *source, int ac, const char **av);
E void MassChannelModes(BotInfo *bi, const std::string &modes);
diff --git a/include/modes.h b/include/modes.h
index 5a1fd60b5..64532bb6d 100644
--- a/include/modes.h
+++ b/include/modes.h
@@ -99,7 +99,7 @@ class UserModeParam : public UserMode
* @param value The param
* @return true or false
*/
- virtual bool IsValid(const char *value) { return true; }
+ virtual bool IsValid(const std::string &value) { return true; }
};
/** This class is a channel mode, all channel modes use this/inherit from this
@@ -151,7 +151,7 @@ class CoreExport ChannelModeList : public ChannelMode
* @param mask The mask
* @return true for yes, false for no
*/
- virtual bool IsValid(const char *mask) { return true; }
+ virtual bool IsValid(const std::string &mask) { return true; }
/** Add the mask to the channel, this should be overridden
* @param chan The channel
@@ -190,7 +190,7 @@ class CoreExport ChannelModeParam : public ChannelMode
* @param value The param
* @return true for yes, false for no
*/
- virtual bool IsValid(const char *value) { return true; }
+ virtual bool IsValid(const std::string &value) { return true; }
};
/** This is a mode that is a channel status, eg +v/h/o/a/q.
@@ -264,7 +264,7 @@ class CoreExport ChannelModeKey : public ChannelModeParam
public:
ChannelModeKey() : ChannelModeParam(CMODE_KEY) { }
- bool IsValid(const char *value);
+ bool IsValid(const std::string &value);
};
/** Channel mode +f (flood)
@@ -274,7 +274,7 @@ class ChannelModeFlood : public ChannelModeParam
public:
ChannelModeFlood() : ChannelModeParam(CMODE_FLOOD) { }
- bool IsValid(const char *value);
+ bool IsValid(const std::string &value);
};
/** This class is used for channel mode +A (Admin only)
diff --git a/include/modules.h b/include/modules.h
index 8903eb9c2..45541c28c 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -644,9 +644,10 @@ class CoreExport Module
/** Called before a user joins a channel
* @param u The user
- * @param channel The channel
+ * @param c The channel
+ * @return EVENT_STOP to allow the user to join the channel through restrictions, EVENT_CONTINUE to let other modules decide
*/
- virtual void OnPreJoinChannel(User *u, const char *channel) { }
+ virtual EventReturn OnPreJoinChannel(User *u, Channel *c) { return EVENT_CONTINUE; }
/** Called when a user joins a channel
* @param u The user
diff --git a/include/services.h b/include/services.h
index de6972fc2..244377419 100644
--- a/include/services.h
+++ b/include/services.h
@@ -410,10 +410,7 @@ struct ircdvars_ {
int knock_needs_i; /* Check if we needed +i when setting NOKNOCK */
char *chanmodes; /* If the ircd sends CHANMODE in CAPAB this is where we store it */
int token; /* Does Anope support the tokens for the ircd */
- int sjb64; /* Base 64 encode TIMESTAMP */
- int sjoinbanchar; /* use single quotes to define it */
- int sjoinexchar; /* use single quotes to define it */
- int sjoininvchar; /* use single quotes to define it */
+ int sjb64;
int svsmode_ucmode; /* Can remove User Channel Modes with SVSMODE */
int sglineenforce;
int ts6; /* ircd is TS6 */
@@ -832,7 +829,9 @@ struct c_userlist {
enum ChannelFlags
{
/* Channel still exists when emptied */
- CH_PERSIST
+ CH_PERSIST,
+ /* If set the channel is syncing users (eg, multi user SJOIN) and it should not be deleted */
+ CH_SYNCING
};
class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
@@ -878,6 +877,20 @@ 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? */
+ /** Restore the channel topic, set mlock (key), set stickied bans, etc
+ */
+ void Sync();
+
+ /** Join a user internally to the channel
+ * @param u The user
+ */
+ void JoinUser(User *u);
+
+ /** Remove a user internally from the channel
+ * @param u The user
+ */
+ void DeleteUser(User *u);
+
/**
* See if a channel has a mode
* @param Name The mode name