]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/membership.h
Remove the Kiwi links from the readme.
[user/henk/code/inspircd.git] / include / membership.h
index 05d6b3796fb1ac72e44a035117d927077b4878f0..1bac0cf95e90563825e89d998a7f1284d7b53625 100644 (file)
@@ -1,7 +1,10 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2013-2014, 2016 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2010 Craig Edwards <brain@inspircd.org>
  *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
  *
  * 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<Id>(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;
 };