mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Add foundation for membership ids
This commit is contained in:
parent
020f706bcb
commit
0205dd6548
@ -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
|
||||
@ -30,6 +32,10 @@
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user