X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fusers.h;h=ca9c3f55703169fc016632a82183cf9a8748b53d;hb=327bacd3687f307a5f8586856a94b16c9e4370bf;hp=94a8af9a4115d95b502eeadcdfa69e56035e5b26;hpb=5f387071d339892ebed5accba92f91f997396476;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/users.h b/include/users.h index 94a8af9a4..ca9c3f557 100644 --- a/include/users.h +++ b/include/users.h @@ -1,12 +1,21 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2009 Daniel De Graaf - * Copyright (C) 2007-2008 Robin Burchell + * Copyright (C) 2019 linuxdaemon + * Copyright (C) 2019 Matt Schatz + * Copyright (C) 2013 Daniel Vassdal + * Copyright (C) 2012-2016, 2018 Attila Molnar + * Copyright (C) 2012-2013, 2016-2019 Sadie Powell + * Copyright (C) 2012, 2018-2019 Robby + * Copyright (C) 2012 DjSlash + * Copyright (C) 2012 ChrisTX + * Copyright (C) 2009-2010 Daniel De Graaf + * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2008 Thomas Stagner - * Copyright (C) 2003-2007 Craig Edwards - * Copyright (C) 2007 Burlex - * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2008 John Brooks + * Copyright (C) 2007-2009 Robin Burchell + * Copyright (C) 2007, 2009 Dennis Friis + * Copyright (C) 2006-2008 Craig Edwards * * 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 @@ -676,6 +685,12 @@ class CoreExport User : public Extensible */ virtual ~User(); CullResult cull() CXX11_OVERRIDE; + + /** @copydoc Serializable::Deserialize. */ + bool Deserialize(Data& data) CXX11_OVERRIDE; + + /** @copydoc Serializable::Deserialize. */ + bool Serialize(Serializable::Data& data) CXX11_OVERRIDE; }; class CoreExport UserIOHandler : public StreamSocket @@ -729,6 +744,8 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_nodeGetName(); } 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; } @@ -905,17 +929,17 @@ class CoreExport FakeUser : public User /** Is a local user */ inline LocalUser* IS_LOCAL(User* u) { - return u->usertype == USERTYPE_LOCAL ? static_cast(u) : NULL; + return (u != NULL && u->usertype == USERTYPE_LOCAL) ? static_cast(u) : NULL; } /** Is a remote user */ inline RemoteUser* IS_REMOTE(User* u) { - return u->usertype == USERTYPE_REMOTE ? static_cast(u) : NULL; + return (u != NULL && u->usertype == USERTYPE_REMOTE) ? static_cast(u) : NULL; } /** Is a server fakeuser */ inline FakeUser* IS_SERVER(User* u) { - return u->usertype == USERTYPE_SERVER ? static_cast(u) : NULL; + return (u != NULL && u->usertype == USERTYPE_SERVER) ? static_cast(u) : NULL; } inline bool User::IsModeSet(const ModeHandler* mh) const