X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmembership.h;h=1bac0cf95e90563825e89d998a7f1284d7b53625;hb=d494fa6e094e85cd29235e995fb2b447d6e1f168;hp=05d6b3796fb1ac72e44a035117d927077b4878f0;hpb=a71f34e4b17420cacc4a50c5af64fe15811a8148;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/membership.h b/include/membership.h index 05d6b3796..1bac0cf95 100644 --- a/include/membership.h +++ b/include/membership.h @@ -1,7 +1,10 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2012-2014 Attila Molnar + * Copyright (C) 2013-2014, 2016 Attila Molnar + * Copyright (C) 2013, 2017-2018 Sadie Powell + * Copyright (C) 2012 Robby + * Copyright (C) 2010 Craig Edwards * Copyright (C) 2009 Daniel De Graaf * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -20,7 +23,7 @@ #pragma once -uint64_t ConvToUInt64(const std::string& in); +#include "convto.h" /** * Represents a member of a channel. @@ -60,7 +63,7 @@ class CoreExport Membership : public Extensible, public insp::intrusive_list_nod */ static Id IdFromString(const std::string& str) { - return ConvToUInt64(str); + return ConvToNum(str); } /** Constructor, sets the user and chan fields to the parameters, does NOT update any bookkeeping @@ -70,13 +73,13 @@ class CoreExport Membership : public Extensible, public insp::intrusive_list_nod */ Membership(User* u, Channel* c) : user(u), chan(c) {} - /** Returns true if this member has a given prefix mode set - * @param m The prefix mode letter to check + /** Check if this member has a given prefix mode set + * @param pm Prefix mode to check * @return True if the member has the prefix mode set, false otherwise */ - inline bool hasMode(char m) const + bool HasMode(const PrefixMode* pm) const { - return modes.find(m) != std::string::npos; + return (modes.find(pm->GetModeChar()) != std::string::npos); } /** Returns the rank of this member. @@ -110,5 +113,10 @@ class CoreExport Membership : public Extensible, public insp::intrusive_list_nod * be in rank order, greatest first, as certain IRC clients require * this when multiple prefixes are used names lists. */ - const char* GetAllPrefixChars() const; + std::string GetAllPrefixChars() const; + + /** Sends a server notice to this user in the context of this channel. + * @param text The contents of the message to send. + */ + void WriteNotice(const std::string& text) const; };