summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-13 05:27:39 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-13 05:27:39 +0000
commit6dd331262aa8f989657891e27b8891ee6a00016c (patch)
treea414c7cacbdc046ee6529c63f000c26d973fe35c /include
parentd4ee4c5aa4312cde76fe50e34ef8ca1685d521f0 (diff)
Create subclass of User for FakeClient, to allow for use as command source
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11375 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/fakeuser.h31
-rw-r--r--include/inspircd.h3
-rw-r--r--include/users.h4
3 files changed, 35 insertions, 3 deletions
diff --git a/include/fakeuser.h b/include/fakeuser.h
new file mode 100644
index 000000000..5d62b7060
--- /dev/null
+++ b/include/fakeuser.h
@@ -0,0 +1,31 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
+ *
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __FAKEUSER_H__
+#define __FAKEUSER_H__
+
+#include "users.h"
+
+class CoreExport FakeUser : public User
+{
+ public:
+ FakeUser(InspIRCd* Instance) : User(Instance, "!")
+ {
+ SetFd(FD_MAGIC_NUMBER);
+ }
+
+ virtual const std::string GetFullHost() { return server; }
+ virtual const std::string GetFullRealHost() { return server; }
+};
+
+#endif
diff --git a/include/inspircd.h b/include/inspircd.h
index 0511058a4..6b13a5ed8 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -97,6 +97,7 @@ typedef std::multimap< std::string, KeyValList > ConfigDataHash;
#include "inspstring.h"
#include "protocol.h"
#include "threadengine.h"
+#include "fakeuser.h"
#ifndef PATH_MAX
#warning Potentially broken system, PATH_MAX undefined
@@ -407,7 +408,7 @@ class CoreExport InspIRCd : public classbase
* hash and set its descriptor to FD_MAGIC_NUMBER so the data
* falls into the abyss :p
*/
- User* FakeClient;
+ FakeUser* FakeClient;
/** Returns the next available UID for this server.
*/
diff --git a/include/users.h b/include/users.h
index 4871ca411..207d782b0 100644
--- a/include/users.h
+++ b/include/users.h
@@ -679,7 +679,7 @@ class CoreExport User : public EventHandler
* on the server, in nick!ident&at;host form.
* @return The full masked host of the user
*/
- virtual const std::string& GetFullHost();
+ virtual const std::string GetFullHost();
/** Returns the full real host of the user
* This member function returns the hostname of the user as seen by other users
@@ -687,7 +687,7 @@ class CoreExport User : public EventHandler
* e.g. through a module, then this method will ignore it and return the true hostname.
* @return The full real host of the user
*/
- virtual const std::string& GetFullRealHost();
+ virtual const std::string GetFullRealHost();
/** This clears any cached results that are used for GetFullRealHost() etc.
* The results of these calls are cached as generating them can be generally expensive.