diff options
| author | 2014-01-05 15:04:01 +0100 | |
|---|---|---|
| committer | 2014-01-05 15:04:01 +0100 | |
| commit | 11916574f67962dce1d7a2fdf7ef6a3d2d1fa49f (patch) | |
| tree | 1c3c602de5512a62e2db96652ddd540e6e53e821 /include/server.h | |
| parent | Remove useless ULine() checks (diff) | |
Introduce Server class
- Replaces std::string server in User
- Replaces InspIRCd::ULine() and SilentULine()
Diffstat (limited to 'include/server.h')
| -rw-r--r-- | include/server.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/include/server.h b/include/server.h new file mode 100644 index 000000000..e6e96593d --- /dev/null +++ b/include/server.h @@ -0,0 +1,59 @@ +/* + * InspIRCd -- Internet Relay Chat Daemon + * + * Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com> + * + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +#pragma once + +class CoreExport Server : public classbase +{ + protected: + /** The name of this server + */ + const std::string name; + + /** True if this server is ulined + */ + bool uline; + + /** True if this server is a silent uline, i.e. silent="true" in the uline block + */ + bool silentuline; + + public: + Server(const std::string& srvname) + : name(srvname), uline(false), silentuline(false) { } + + /** + * Returns the name of this server + * @return The name of this server, for example "irc.inspircd.org". + */ + const std::string& GetName() const { return name; } + + /** + * Checks whether this server is ulined + * @return True if this server is ulined, false otherwise. + */ + bool IsULine() const { return uline; } + + /** + * Checks whether this server is a silent uline + * Silent uline servers introduce, quit and oper up users without a snotice being generated. + * @return True if this server is a silent uline, false otherwise. + */ + bool IsSilentULine() const { return silentuline; } +}; |
