summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-09-23 11:49:26 +0100
committerPeter Powell <petpow@saberuk.com>2019-09-23 13:18:14 +0100
commita4305d8f3c3e613be839bdcd61a1d14c87fed5aa (patch)
tree16e01b6079f017c00d2bda2da0fcb759b98a5ea1 /include
parentb64177d3fb4f113c4db3325575970964867f01cc (diff)
Add the server id to the Server class.
Diffstat (limited to 'include')
-rw-r--r--include/server.h24
-rw-r--r--include/users.h5
2 files changed, 25 insertions, 4 deletions
diff --git a/include/server.h b/include/server.h
index d73c9673a..491754e13 100644
--- a/include/server.h
+++ b/include/server.h
@@ -22,6 +22,9 @@
class CoreExport Server : public classbase
{
protected:
+ /** The unique identifier for this server. */
+ const std::string id;
+
/** The name of this server
*/
const std::string name;
@@ -44,8 +47,25 @@ class CoreExport Server : public classbase
friend class ConfigReaderThread;
public:
- Server(const std::string& srvname, const std::string& srvdesc)
- : name(srvname), description(srvdesc), uline(false), silentuline(false) { }
+ Server(const std::string& srvid, const std::string& srvname, const std::string& srvdesc)
+ : id(srvid)
+ , name(srvname)
+ , description(srvdesc)
+ , uline(false)
+ , silentuline(false)
+ {
+ }
+
+ DEPRECATED_METHOD(Server(const std::string& srvname, const std::string& srvdesc))
+ : name(srvname)
+ , description(srvdesc)
+ , uline(false)
+ , silentuline(false)
+ {
+ }
+
+ /** Retrieves the unique identifier for this server (e.g. 36C). */
+ const std::string& GetId() const { return id; }
/**
* Returns the name of this server
diff --git a/include/users.h b/include/users.h
index 94a8af9a4..6b7e18953 100644
--- a/include/users.h
+++ b/include/users.h
@@ -885,13 +885,14 @@ class RemoteUser : public User
class CoreExport FakeUser : public User
{
public:
- FakeUser(const std::string& uid, Server* srv) : User(uid, srv, USERTYPE_SERVER)
+ FakeUser(const std::string& uid, Server* srv)
+ : User(uid, srv, USERTYPE_SERVER)
{
nick = srv->GetName();
}
FakeUser(const std::string& uid, const std::string& sname, const std::string& sdesc)
- : User(uid, new Server(sname, sdesc), USERTYPE_SERVER)
+ : User(uid, new Server(uid, sname, sdesc), USERTYPE_SERVER)
{
nick = sname;
}