InspIRCd
3.0
|
#include <membership.h>
Public Types | |
typedef uint64_t | Id |
![]() | |
typedef insp::flat_map< reference< ExtensionItem >, void * > | ExtensibleStore |
Public Member Functions | |
Membership (User *u, Channel *c) | |
bool | HasMode (const PrefixMode *pm) const |
unsigned int | getRank () |
bool | SetPrefix (PrefixMode *mh, bool adding) |
char | GetPrefixChar () const |
std::string | GetAllPrefixChars () const |
void | WriteNotice (const std::string &text) const |
![]() | |
const ExtensibleStore & | GetExtList () const |
CullResult | cull () CXX11_OVERRIDE |
void | doUnhookExtensions (const std::vector< reference< ExtensionItem > > &toRemove) |
void | FreeAllExtItems () |
bool | Deserialize (Data &data) CXX11_OVERRIDE |
bool | Serialize (Serializable::Data &data) CXX11_OVERRIDE |
Static Public Member Functions | |
static Id | IdFromString (const std::string &str) |
Public Attributes | |
User *const | user |
Channel *const | chan |
std::string | modes |
Id | id |
Represents a member of a channel. A Membership object is created when a user joins a channel, and destroyed when a user leaves (via kick, part or quit) a channel. All prefix modes a member has is tracked by this object. Moreover, Memberships are Extensibles meaning modules can add arbitrary data to them using extensions (see m_delaymsg for an example).
typedef uint64_t Membership::Id |
Type of the Membership id
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 Membership objects directly.
std::string Membership::GetAllPrefixChars | ( | ) | const |
Return all prefix chars this member has.
char Membership::GetPrefixChar | ( | ) | const |
Get the highest prefix this user has on the channel
unsigned int Membership::getRank | ( | ) |
Returns the rank of this member. The rank of a member is defined as the rank given by the 'strongest' prefix mode a member has. See the PrefixMode class description for more info.
|
inline |
Check if this member has a given prefix mode set
pm | Prefix mode to check |
|
inlinestatic |
Converts a string to a Membership::Id
str | The string to convert |
bool Membership::SetPrefix | ( | PrefixMode * | mh, |
bool | adding | ||
) |
Add a prefix character to a user. Only the core should call this method, usually from within the mode parser or when the first user joins the channel (to grant the default privs to them)
mh | The mode handler of the prefix mode to associate |
adding | True if adding the prefix, false when removing |
void Membership::WriteNotice | ( | const std::string & | text | ) | const |
Sends a server notice to this user in the context of this channel.
text | The contents of the message to send. |
Id Membership::id |
Id of this Membership, set by the protocol module, other components should never read or write this field.
std::string Membership::modes |
List of prefix mode letters this member has, sorted by prefix rank, highest first