X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=include%2Fchannels.h;h=b71da1570fbe5b41fdfca96031a4386fd8dbf973;hb=21eba8e86b3d7361bc9334b4e15e968ba095db76;hp=3c60fcd6abe880208b6d68e2887d6154970e06c2;hpb=11cafc12d5440b67a9f676c9f6aa67840ca5399d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/channels.h b/include/channels.h index 3c60fcd6a..b71da1570 100644 --- a/include/channels.h +++ b/include/channels.h @@ -35,10 +35,6 @@ */ class CoreExport Channel : public Extensible, public InviteBase { - /** Connect a Channel to a User - */ - static Channel* ForceChan(Channel* Ptr, User* user, const std::string &privs, bool bursting, bool created); - /** Set default modes for the channel on creation */ void SetDefaultModes(); @@ -180,7 +176,7 @@ class CoreExport Channel : public Extensible, public InviteBase * @param user The user being kicked (must be on this channel) * @param reason The reason for the kick */ - void KickUser(User *src, User *user, const char* reason); + void KickUser(User *src, User *user, const std::string& reason); /** Part a user from this channel with the given reason. * If the reason field is NULL, no reason will be sent. @@ -189,16 +185,24 @@ class CoreExport Channel : public Extensible, public InviteBase */ void PartUser(User *user, std::string &reason); - /* Join a user to a channel. May be a channel that doesnt exist yet. + /** Join a local user to a channel, with or without permission checks. May be a channel that doesn't exist yet. * @param user The user to join to the channel. * @param channame The channel name to join to. Does not have to exist. * @param key The key of the channel, if given * @param override If true, override all join restrictions such as +bkil * @return A pointer to the Channel the user was joined to. A new Channel may have * been created if the channel did not exist before the user was joined to it. - * If the user could not be joined to a channel, the return value may be NULL. + * If the user could not be joined to a channel, the return value is NULL. + */ + static Channel* JoinUser(LocalUser* user, std::string channame, bool override = false, const std::string& key = ""); + + /** Join a user to an existing channel, without doing any permission checks + * @param user The user to join to the channel + * @param privs Priviliges (prefix mode letters) to give to this user, may be NULL + * @param bursting True if this join is the result of a netburst (passed to modules in the OnUserJoin hook) + * @param created True if this channel was just created by a local user (passed to modules in the OnUserJoin hook) */ - static Channel* JoinUser(User *user, std::string channame, bool override, const std::string& key, bool bursting, time_t TS = 0); + void ForceJoin(User* user, const std::string* privs = NULL, bool bursting = false, bool created_by_local = false); /** Write to a channel, from a user, using va_args for text * @param user User whos details to prefix the line with @@ -275,7 +279,7 @@ class CoreExport Channel : public Extensible, public InviteBase * otherwise it is replaced with '<KEY>' * @return The channel mode string */ - char* ChanModes(bool showkey); + const char* ChanModes(bool showkey); /** Spool the NAMES list for this channel to the given user * @param user The user to spool the NAMES list to