mirror of
https://github.com/pissnet/pissircd.git
synced 2025-08-13 21:51:36 +01:00
Added HOOKTYPE_PRE_LOCAL_QUIT
This commit is contained in:
parent
c07e1f96e1
commit
3185d8c23b
3 changed files with 15 additions and 3 deletions
2
Changes
2
Changes
|
@ -2731,3 +2731,5 @@ seen. gmtime warning still there
|
|||
- Renamed "FAKE_LAG_FOR_LOCOPS" to "NO_FAKE_LAG_FOR_LOCOPS" since that's what it did
|
||||
anyway, requested by Greg (#0001453)
|
||||
- Made it so chan ops can invite in a +V channel. Requested by AI (#0001478)
|
||||
- Added HOOKTYPE_PRE_LOCAL_QUIT to allow changing quit messages. Suggested by penna22
|
||||
(#0001424)
|
||||
|
|
|
@ -500,7 +500,7 @@ int CallCmdoverride(Cmdoverride *ovr, aClient *cptr, aClient *sptr, int parc, ch
|
|||
#define HOOKTYPE_CONFIGPOSTTEST 6
|
||||
#define HOOKTYPE_REHASH 7
|
||||
#define HOOKTYPE_PRE_LOCAL_CONNECT 8
|
||||
#define HOOKTYPE_HTTPD_URL 9
|
||||
#define HOOKTYPE_PRE_LOCAL_QUIT 9
|
||||
#define HOOKTYPE_GUEST 10
|
||||
#define HOOKTYPE_SERVER_CONNECT 11
|
||||
#define HOOKTYPE_SERVER_QUIT 12
|
||||
|
|
|
@ -103,10 +103,10 @@ DLLFUNC int m_quit(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
|||
int blocked = 0;
|
||||
#endif
|
||||
char *s = comment;
|
||||
Hook *tmphook;
|
||||
if (STATIC_QUIT)
|
||||
{
|
||||
return exit_client(cptr, sptr, sptr, STATIC_QUIT);
|
||||
}
|
||||
|
||||
if (!prefix_quit || strcmp(prefix_quit, "no"))
|
||||
s = ircsprintf(comment, "%s ",
|
||||
BadPtr(prefix_quit) ? "Quit:" : prefix_quit);
|
||||
|
@ -146,6 +146,16 @@ DLLFUNC int m_quit(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
|||
ocomment = parv[0];
|
||||
} /* (strip color codes) */
|
||||
|
||||
for (tmphook = Hooks[HOOKTYPE_PRE_LOCAL_QUIT]; tmphook; tmphook = tmphook->next)
|
||||
{
|
||||
ocomment = (*(tmphook->func.pcharfunc))(sptr, ocomment);
|
||||
if (!ocomment)
|
||||
{
|
||||
ocomment = parv[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
strncpy(s, ocomment, TOPICLEN - (s - comment));
|
||||
comment[TOPICLEN] = '\0';
|
||||
return exit_client(cptr, sptr, sptr, comment);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue