- New user mode +I (IRCOp only) which hides idle times to other users,

suggested and patch supplied by Nath & binki ().
This commit is contained in:
Bram Matthys 2012-01-22 16:32:28 +01:00
parent b9137af15c
commit c597c90f4a
6 changed files with 29 additions and 7 deletions

View file

@ -2352,3 +2352,5 @@
userhost-in-names (UHNAMES). Patch from nenotopia (#4018, #4066).
- Fix issue with CAP & NOSPOOF. Patch from nenolod (#4077).
- Advertise 'tls' (STARTTLS) capability in CAP. Patch from nenolod (#4081).
- New user mode +I (IRCOp only) which hides idle times to other users,
suggested and patch supplied by Nath & binki (#3953).

View file

@ -2926,7 +2926,7 @@ files {
<td><div align="center"><b>Description</b></div></td>
</tr>
<tr>
<td colspan="2"><div align="center"><b>User Modes</b></div></td>
<td colspan="2" id="usermodes"><div align="center"><b>User Modes</b></div></td>
</tr>
<tr>
<td><div align="center">A</div></td>
@ -2965,6 +2965,10 @@ files {
<td><div align="center">h</div></td>
<td>Available for help (HelpOp) (Set in OperBlock)</td>
</tr>
<tr>
<td><div style="text-align: center">I</div></td>
<td>Hide an oper's idle time (in /whois output) from regular users.</td>
</tr>
<tr>
<td><div align="center">i</div></td>
<td>Invisible (not shown in /who)</td>
@ -3054,12 +3058,24 @@ to get more information on a command.</p>
<td>Changes your online nick name. Alerts others to the change of your nick<br></td>
<td>All</td>
</tr>
<tr>
<tr id="command_whois">
<td>whois &lt;nick&gt;</td>
<td>Displays information of user requested. Includes Full Name, Host, Channels
User is in, and Oper Status<br></td>
<td>All</td>
</tr>
<tr id="command_whois_nicknick">
<td>whois &lt;nick&gt; &lt;nick&gt;</td>
<td>
Performs a remote <a href="#command_whois">WHOIS</a>. If a
person is not on the same server as another person, a simple
WHOIS will not display all possible WHOIS responses. For
example, idle times are not shown in such a case. To request a
remote whois, issue a WHOIS with the remote user's nick as the
first and as the second arguments.
</td>
<td>All</td>
</tr>
<tr>
<td height="39">who &lt;mask&gt;</td>
<td>Who allows you to search for users. Masks

View file

@ -114,6 +114,7 @@ help Umodes {
" B = Marks you as being a Bot";
" G = Filters out all Bad words in your messages with <censored>";
" H = Hide IRCop status in /WHO and /WHOIS. (IRC Operators only)";
" I = Hide an oper's idle time (in /whois output) from regular users.";
" R = Allows you to only receive PRIVMSGs/NOTICEs from registered (+r) users";
" S = For Services only. (Protects them)";
" T = Prevents you from receiving CTCPs";

View file

@ -446,6 +446,7 @@ extern MODVAR long UMODE_SETHOST; /* 0x40000000 used sethost */
extern MODVAR long UMODE_STRIPBADWORDS; /* 0x80000000 */
extern MODVAR long UMODE_HIDEWHOIS; /* hides channels in /whois */
extern MODVAR long UMODE_NOCTCP; /* blocks all ctcp (except dcc and action) */
extern MODVAR long UMODE_HIDLE; /* hides oper idle times */
extern MODVAR long AllUmodes, SendUmodes;
extern MODVAR long SNO_KILLS;

View file

@ -329,15 +329,15 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
sendto_one(sptr, rpl_str(RPL_WHOISLOGGEDIN), me.name, parv[0], name, user->svid);
/*
* Fix /whois to not show idle times of
* global opers to anyone except another
* global oper or services.
* -CodeM/Barubary
* Umode +I hides an oper's idle time from regular users.
* -Nath.
*/
if (MyConnect(acptr))
if (MyConnect(acptr) && (IsAnOper(sptr) || !(acptr->umodes & UMODE_HIDLE)))
{
sendto_one(sptr, rpl_str(RPL_WHOISIDLE),
me.name, parv[0], name,
TStime() - acptr->last, acptr->firsttime);
}
}
if (!found)
sendto_one(sptr, err_str(ERR_NOSUCHNICK),

View file

@ -78,6 +78,7 @@ long UMODE_SETHOST = 0L; /* Used sethost */
long UMODE_STRIPBADWORDS = 0L; /* Strip badwords */
long UMODE_HIDEWHOIS = 0L; /* Hides channels in /whois */
long UMODE_NOCTCP = 0L; /* Blocks ctcp (except dcc and action) */
long UMODE_HIDLE = 0L; /* Hides the idle time of opers */
long SNO_KILLS = 0L;
long SNO_CLIENT = 0L;
@ -155,6 +156,7 @@ void umode_init(void)
UmodeAdd(NULL, 't', UMODE_GLOBAL, NULL, &UMODE_SETHOST);
UmodeAdd(NULL, 'G', UMODE_GLOBAL, NULL, &UMODE_STRIPBADWORDS);
UmodeAdd(NULL, 'p', UMODE_GLOBAL, NULL, &UMODE_HIDEWHOIS);
UmodeAdd(NULL, 'I', UMODE_GLOBAL, umode_allow_opers, &UMODE_HIDLE);
SnomaskAdd(NULL, 'k', umode_allow_all, &SNO_KILLS);
SnomaskAdd(NULL, 'c', umode_allow_opers, &SNO_CLIENT);
SnomaskAdd(NULL, 'f', umode_allow_opers, &SNO_FLOOD);