From 18154f4d229cf8ebdcec0dac671ad6e2e0049fee Mon Sep 17 00:00:00 2001 From: aquanight Date: Fri, 8 Feb 2008 23:35:39 +0000 Subject: Support for /invite - if the user doesn't partake in time, the invite expires git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8854 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/modules.h | 6 ++++-- include/users.h | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/modules.h b/include/modules.h index e14b13c9b..09b1f954b 100644 --- a/include/modules.h +++ b/include/modules.h @@ -626,9 +626,10 @@ class CoreExport Module : public Extensible * @param source The user who is issuing the INVITE * @param dest The user being invited * @param channel The channel the user is being invited to + * @param timeout The time the invite will expire (0 == never) * @return 1 to deny the invite, 0 to allow */ - virtual int OnUserPreInvite(User* source,User* dest,Channel* channel); + virtual int OnUserPreInvite(User* source,User* dest,Channel* channel, time_t timeout); /** Called after a user has been successfully invited to a channel. * You cannot prevent the invite from occuring using this function, to do that, @@ -636,8 +637,9 @@ class CoreExport Module : public Extensible * @param source The user who is issuing the INVITE * @param dest The user being invited * @param channel The channel the user is being invited to + * @param timeout The time the invite will expire (0 == never) */ - virtual void OnUserInvite(User* source,User* dest,Channel* channel); + virtual void OnUserInvite(User* source,User* dest,Channel* channel, time_t timeout); /** Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. * Returning any nonzero value from this function stops the process immediately, causing no diff --git a/include/users.h b/include/users.h index 1fca831ef..a7b6f5629 100644 --- a/include/users.h +++ b/include/users.h @@ -360,9 +360,9 @@ public: } }; -/** Holds a complete list of all channels to which a user has been invited and has not yet joined. +/** Holds a complete list of all channels to which a user has been invited and has not yet joined, and the time at which they'll expire. */ -typedef std::vector InvitedList; +typedef std::vector< std::pair > InvitedList; /** Holds a complete list of all allow and deny tags from the configuration file (connection classes) */ @@ -736,8 +736,9 @@ class CoreExport User : public connection /** Adds a channel to a users invite list (invites them to a channel) * @param channel A channel name to add + * @param timeout When the invite should expire (0 == never) */ - virtual void InviteTo(const irc::string &channel); + virtual void InviteTo(const irc::string &channel, time_t timeout); /** Removes a channel from a users invite list. * This member function is called on successfully joining an invite only channel -- cgit v1.2.3