[srvx-commits] CVS: services/src nickserv.help,1.16.2.7,1.16.2.8 nickserv.h,1.24.2.7,1.24.2.8 nickse
Brought to you by:
entrope
From: Entrope <en...@us...> - 2001-08-14 01:19:31
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv30468/src Modified Files: Tag: rel-1_0 nickserv.help nickserv.h nickserv.c nickserv-not.help chanserv.c Log Message: document "frozen" (on-vacation) flag and let normal users set it with "vacation" command add no-delete flag for handles in general Index: nickserv.help =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.help,v retrieving revision 1.16.2.7 retrieving revision 1.16.2.8 diff -C2 -r1.16.2.7 -r1.16.2.8 *** nickserv.help 2001/08/03 02:49:13 1.16.2.7 --- nickserv.help 2001/08/14 01:19:27 1.16.2.8 *************** *** 69,73 **** "$bs$b Handle suspended", "$bc$b Use mIRC color codes in responses", ! "$bf$b Handle frozen (Will not be unregistered; cleared when handle is authenticated against. Useful for going on vacation.)", "$uSee Also:$u handleinfo, set"); "HELP" ("$bHELP$b", --- 69,74 ---- "$bs$b Handle suspended", "$bc$b Use mIRC color codes in responses", ! "$bf$b Handle frozen/on vacation (will not be unregistered for inactivity; cleared when handle is authenticated against)", ! "$bn$b No-delete (will never be unregistered for inactivity)", "$uSee Also:$u handleinfo, set"); "HELP" ("$bHELP$b", *************** *** 172,175 **** --- 173,180 ---- "/msg $N RENAME <current-handle> <new-handle>", "Renames a handle. This command is only accessible to helpers and IRC operators."); + "VACATION" ("$bVACATION$b", + "/msg $N VACATION", + "Marks your handle as \"on vacation\" until the next time you authenticate to $N.", + "While you are \"on vacation\", your handle will not be deleted for inactivity."); "SEARCH" ("$bSEARCH$b", "/msg $N SEARCH <action> <criteria>", Index: nickserv.h =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.h,v retrieving revision 1.24.2.7 retrieving revision 1.24.2.8 diff -C2 -r1.24.2.7 -r1.24.2.8 *** nickserv.h 2001/07/21 12:32:03 1.24.2.7 --- nickserv.h 2001/08/14 01:19:27 1.24.2.8 *************** *** 37,42 **** #define HI_FLAG_MIRC_COLOR 0x00000020 #define HI_FLAG_FROZEN 0x00000040 /* Flag characters for the above. First char is LSB, etc. */ ! #define HANDLE_FLAGS "Sphgscf" /* HI_STYLE_* go into handle_info.userlist_style */ --- 37,43 ---- #define HI_FLAG_MIRC_COLOR 0x00000020 #define HI_FLAG_FROZEN 0x00000040 + #define HI_FLAG_NODELETE 0x00000080 /* Flag characters for the above. First char is LSB, etc. */ ! #define HANDLE_FLAGS "Sphgscfn" /* HI_STYLE_* go into handle_info.userlist_style */ Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.138.2.39 retrieving revision 1.138.2.40 diff -C2 -r1.138.2.39 -r1.138.2.40 *** nickserv.c 2001/08/14 00:15:52 1.138.2.39 --- nickserv.c 2001/08/14 01:19:27 1.138.2.40 *************** *** 111,114 **** --- 111,115 ---- #define NSMSG_HANDLEINFO_REGGED " Registered on: %s" #define NSMSG_HANDLEINFO_LASTSEEN " Last seen: %s" + #define NSMSG_HANDLEINFO_VACATION " On vacation." #define NSMSG_HANDLEINFO_INFOLINE " Infoline: %s" #define NSMSG_HANDLEINFO_FLAGS " Flags: %s" *************** *** 158,161 **** --- 159,163 ---- #define NSMSG_LAST_WRITE "Last db write was %s ago." #define NSMSG_NO_DB_WRITE "There have been no db writes performed." + #define NSMSG_ON_VACATION "You are now on vacation. Your handle will be preserved until you authenticate again." #define NSMSG_NO_ACCESS "Access denied." #define NSMSG_INVALID_FLAGS "$b%s$b is not a valid handle flag string." *************** *** 759,777 **** } ! nickserv_notice(user, NSMSG_HANDLEINFO_INFOLINE, hi->info); if (hi != user->handle_info) { /* Test IsOper separately, so that normal users don't see * "Access Denied!" after the information we already give ! * them. ! */ ! /* XXX: Entrope should review this and fix the underlying ! cause. */ if (!user->handle_info) return 1; if (!IsOper(user) && !IsHelping(user)) return 1; if (!is_valid_oper(user, 0)) return 1; /* Normally, since we check for is_valid_oper, we'd want to log this ! * separately. But we've already logged it above. ! */ } --- 761,776 ---- } ! nickserv_notice(user, NSMSG_HANDLEINFO_INFOLINE, (hi->info[0] ? hi->info : NSMSG_NONE)); ! nickserv_notice(user, NSMSG_HANDLEINFO_VACATION); if (hi != user->handle_info) { /* Test IsOper separately, so that normal users don't see * "Access Denied!" after the information we already give ! * them. */ if (!user->handle_info) return 1; if (!IsOper(user) && !IsHelping(user)) return 1; if (!is_valid_oper(user, 0)) return 1; /* Normally, since we check for is_valid_oper, we'd want to log this ! * separately. But we've already logged it above. */ } *************** *** 1625,1628 **** --- 1624,1635 ---- } + static NICKSERV_FUNC(cmd_vacation) + { + (void)argc; (void)argv; + HANDLE_SET_FLAG(user->handle_info, FROZEN); + nickserv_notice(user, NSMSG_ON_VACATION); + return 1; + } + static NICKSERV_FUNC(cmd_version) { *************** *** 1889,1894 **** if (((discrim->flags_on & hi->flags) != discrim->flags_on) || (discrim->flags_off & hi->flags) ! || (discrim->registered > hi->registered) ! || (discrim->lastseen > hi->lastseen) || (discrim->handlemask && !match_ircglob(hi->handle, discrim->handlemask))) { return 0; --- 1896,1901 ---- if (((discrim->flags_on & hi->flags) != discrim->flags_on) || (discrim->flags_off & hi->flags) ! || (discrim->registered < hi->registered) ! || (discrim->lastseen < hi->lastseen) || (discrim->handlemask && !match_ircglob(hi->handle, discrim->handlemask))) { return 0; *************** *** 2134,2138 **** if ((handle->opserv_level > 0) || handle->users ! || HANDLE_FLAGGED(handle, FROZEN)) { return 0; } --- 2141,2146 ---- if ((handle->opserv_level > 0) || handle->users ! || HANDLE_FLAGGED(handle, FROZEN) ! || HANDLE_FLAGGED(handle, NODELETE)) { return 0; } *************** *** 2360,2363 **** --- 2368,2372 ---- nickserv_define_func("USERINFO", cmd_userinfo, -1, 1); nickserv_define_func("RENAME", cmd_rename_handle, 0, 1); + nickserv_define_func("VACATION", cmd_vacation, -1, 1); if (!nickserv_conf.disable_nicks) { /* nick management commands */ Index: nickserv-not.help =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv-not.help,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -r1.1.2.6 -r1.1.2.7 *** nickserv-not.help 2001/08/03 02:49:13 1.1.2.6 --- nickserv-not.help 2001/08/14 01:19:27 1.1.2.7 *************** *** 58,62 **** "Displays infomation on the specified handle, including the date the handle was registered, the last time that person was seen, the handle's $b$N$b info, its flags, its hostmask(s), its channels, and the handle's current nickname.", "You may use *Handle instead of Nick as the name argument; the * makes $N use the name of a handle directly (useful if the user is not online).", ! "$uSee Also:$u userinfo"); "HELP" ("$bHELP$b", "/msg $N HELP [topic/command]", --- 58,73 ---- "Displays infomation on the specified handle, including the date the handle was registered, the last time that person was seen, the handle's $b$N$b info, its flags, its hostmask(s), its channels, and the handle's current nickname.", "You may use *Handle instead of Nick as the name argument; the * makes $N use the name of a handle directly (useful if the user is not online).", ! "$uSee Also:$u userinfo, handle flags"); ! "HANDLE FLAGS" ("$bHANDLE FLAGS$b", ! "The following flags on handles are defined:", ! "$bS$b $O access suspended", ! "$bp$b Use PRIVMSG for messages rather than NOTICE", ! "$bh$b User is a helper (can turn god mode on/off for self)", ! "$bg$b God mode (security override for IRC staff)", ! "$bs$b Handle suspended", ! "$bc$b Use mIRC color codes in responses", ! "$bf$b Handle frozen/on vacation (will not be unregistered for inactivity; cleared when handle is authenticated against)", ! "$bn$b No-delete (will never be unregistered for inactivity)", ! "$uSee Also:$u handleinfo, set"); "HELP" ("$bHELP$b", "/msg $N HELP [topic/command]", *************** *** 132,135 **** --- 143,150 ---- "/msg $N RENAME <current-handle> <new-handle>", "Renames a handle. This command is only accessible to helpers and IRC operators."); + "VACATION" ("$bVACATION$b", + "/msg $N VACATION", + "Marks your handle as \"on vacation\" until the next time you authenticate to $N.", + "While you are \"on vacation\", your handle will not be deleted for inactivity."); "SEARCH" ("$bSEARCH$b", "/msg $N SEARCH <action> <criteria>", Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.161.2.72 retrieving revision 1.161.2.73 diff -C2 -r1.161.2.72 -r1.161.2.73 *** chanserv.c 2001/08/12 01:18:25 1.161.2.72 --- chanserv.c 2001/08/14 01:19:27 1.161.2.73 *************** *** 250,253 **** --- 250,254 ---- /* Seen information */ #define CSMSG_USER_SEEN "%s was last seen $b%s$b ago." + #define CSMSG_USER_VACATION "%s is currently on vacation." #define CSMSG_USER_PRESENT "%s is in the channel $bright now$b." *************** *** 3379,3382 **** --- 3380,3387 ---- intervalString(seen, now - uData->seen); chanserv_notice(user, CSMSG_USER_SEEN, handle->handle, seen); + if (HANDLE_FLAGGED(handle, FROZEN)) + { + chanserv_notice(user, CSMSG_USER_VACATION, handle->handle); + } } |