Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only call ircd_on_logout when the ircd knows a user is logged in #818

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion libathemecore/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,10 @@ bool ircd_logout_or_kill(struct user *u, const char *login)
hook_call_user_can_logout(&req);

if (req.allowed)
jesopo marked this conversation as resolved.
Show resolved Hide resolved
return ircd_on_logout(u, login);
if (!(u->myuser->flags & MU_WAITAUTH))
return ircd_on_logout(u, login);
else
return false;

kill_user(nicksvs.me ? nicksvs.me->me : NULL, u, "Forcing logout %s -> %s", u->nick, login);
return true;
Expand Down
2 changes: 1 addition & 1 deletion modules/nickserv/identify.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ ns_cmd_login(struct sourceinfo *si, int parc, char *parv[])
{
command_success_nodata(si, _("You have been logged out of \2%s\2."), entity(u->myuser)->name);

if (ircd_on_logout(u, entity(u->myuser)->name))
if (!(u->myuser->flags & MU_WAITAUTH) && ircd_on_logout(u, entity(u->myuser)->name))
// logout killed the user...
return;
u->myuser->lastlogin = CURRTIME;
Expand Down
2 changes: 1 addition & 1 deletion modules/nickserv/logout.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ ns_cmd_logout(struct sourceinfo *si, int parc, char *parv[])
if (mn != NULL && mn->owner == u->myuser)
mn->lastseen = CURRTIME;

if (!ircd_on_logout(u, entity(u->myuser)->name))
if (u->myuser->flags & MU_WAITAUTH || !ircd_on_logout(u, entity(u->myuser)->name))
{
MOWGLI_ITER_FOREACH_SAFE(n, tn, u->myuser->logins.head)
{
Expand Down
2 changes: 1 addition & 1 deletion modules/saslserv/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ sasl_handle_login(struct sasl_session *const restrict p, struct user *const u, s

(void) logcommand_user(saslsvs, u, CMDLOG_LOGIN, "LOGOUT");

if (! (was_killed = ircd_on_logout(u, entity(u->myuser)->name)))
if (u->myuser->flags & MU_WAITAUTH || !(was_killed = ircd_on_logout(u, entity(u->myuser)->name)))
{
mowgli_node_t *n;

Expand Down