X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmembership.h;h=8630bb6730692886bd24bd657536e48aa35e0762;hb=1dca8b79edf65c0e5e846cc120f1321fb0a1d15c;hp=05d6b3796fb1ac72e44a035117d927077b4878f0;hpb=a71f34e4b17420cacc4a50c5af64fe15811a8148;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/membership.h b/include/membership.h index 05d6b3796..8630bb673 100644 --- a/include/membership.h +++ b/include/membership.h @@ -20,7 +20,7 @@ #pragma once -uint64_t ConvToUInt64(const std::string& in); +#include "convto.h" /** * Represents a member of a channel. @@ -60,7 +60,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 +70,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 +110,5 @@ 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; };