UM_WALLOPS = 'w'-65,
UM_INVISIBLE = 'i'-65,
UM_OPERATOR = 'o'-65,
+ UM_SNOMASK = 'n'-65,
};
enum RegistrationState {
irc::string channel;
};
-
-
class InspIRCd;
/** Derived from Resolver, and performs user forward/reverse lookups.
* channels are removed from this list.
*/
InvitedList invites;
+
+ /** Number of channels this user is currently on
+ */
+ unsigned int ChannelCount;
public:
/** Resolvers for looking up this users IP address
* This will occur if and when res_reverse completes.
/** Process a snomask modifier string, e.g. +abc-de
* @param sm A sequence of notice mask characters
- * @return True if the notice masks were successfully applied
+ * @return The cleaned mode sequence which can be output,
+ * e.g. in the above example if masks c and e are not
+ * valid, this function will return +ab-d
*/
- bool userrec::ProcessNoticeMasks(const char *sm);
+ std::string ProcessNoticeMasks(const char *sm);
/** Returns true if a notice mask is set
* @param sm A notice mask character to check
* @param a The string to add to the users read buffer
* @return True if the string was successfully added to the read buffer
*/
- bool AddBuffer(const std::string &a);
+ bool AddBuffer(std::string a);
/** This method returns true if the buffer contains at least one carriage return
* character (e.g. one complete line may be read)
/** Write text to this user, appending CR/LF.
* @param text A std::string to send to the user
*/
- void Write(const std::string &text);
+ void Write(std::string text);
/** Write text to this user, appending CR/LF.
* @param text The format string for text to send to the user
/** Change the displayed host of a user.
* ALWAYS use this function, rather than writing userrec::dhost directly,
* as this triggers module events allowing the change to be syncronized to
- * remote servers.
+ * remote servers. This will also emulate a QUIT and rejoin (where configured)
+ * before setting their host field.
* @param host The new hostname to set
* @return True if the change succeeded, false if it didn't
*/
bool ChangeDisplayedHost(const char* host);
+ /** Change the ident (username) of a user.
+ * ALWAYS use this function, rather than writing userrec::ident directly,
+ * as this correctly causes the user to seem to quit (where configured)
+ * before setting their ident field.
+ * @param host The new ident to set
+ * @return True if the change succeeded, false if it didn't
+ */
+ bool ChangeIdent(const char* newident);
+
/** Change a users realname field.
* ALWAYS use this function, rather than writing userrec::fullname directly,
* as this triggers module events allowing the change to be syncronized to
*/
int CountChannels();
+ /** Modify the number of channels this user is on (used by CountChannels).
+ * Pass a positive number to increment the counter, or a negative number
+ * to decrement it.
+ */
+ void ModChannelCount(int n);
+
/** Send a notice to all local users from this user
* @param text The text format string to send
* @param ... Format arguments
*/
void ShowRULES();
+ /** Handle socket event.
+ * From EventHandler class.
+ */
+ void HandleEvent(EventType et);
+
/** Default destructor
*/
virtual ~userrec();
/** Called every hour by the core to remove expired entries
*/
- void MaintainWhoWas(time_t TIME);
+ void MaintainWhoWas(InspIRCd* ServerInstance, time_t TIME);
};
};