]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/membership.h
m_spanningtree Use the value of StartBurst to determine whether a server is bursting...
[user/henk/code/inspircd.git] / include / membership.h
index e2c13c7e4ff4dfbb158ea6aa2b542d95c3913d54..71008e46b5b1b2c2632e2ccb263ffa82af038a4e 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+uint64_t ConvToUInt64(const std::string& in);
+
 /**
  * Represents a member of a channel.
  * A Membership object is created when a user joins a channel, and destroyed when a user leaves
 class CoreExport Membership : public Extensible, public intrusive_list_node<Membership>
 {
  public:
+       /** Type of the Membership id
+        */
+       typedef uint64_t Id;
+
        /** User on the channel
         */
        User* const user;
@@ -43,6 +49,20 @@ class CoreExport Membership : public Extensible, public intrusive_list_node<Memb
         */
        std::string modes;
 
+       /** Id of this Membership, set by the protocol module, other components should never read or
+        * write this field.
+        */
+       Id id;
+
+       /** Converts a string to a Membership::Id
+        * @param str The string to convert
+        * @return Raw value of type Membership::Id
+        */
+       static Id IdFromString(const std::string& str)
+       {
+               return ConvToUInt64(str);
+       }
+
        /** Constructor, sets the user and chan fields to the parameters, does NOT update any bookkeeping
         * information in the User or the Channel.
         * Call Channel::JoinUser() or ForceJoin() to make a user join a channel instead of constructing