Skip to content

Commit

Permalink
Fix to track returns from away
Browse files Browse the repository at this point in the history
  • Loading branch information
vanosg committed Oct 26, 2019
1 parent 1e5761e commit f0657df
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/mod/server.mod/servmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,14 @@ static int check_tcl_wall(char *from, char *msg)

static int check_tcl_awayv3(char *from, char *msg)
{
int x;

Tcl_SetVar(interp, "_awayv31", from, 0);
Tcl_SetVar(interp, "_awayv32", msg, 0);
check_tcl_bind(H_awayv3, msg, 0, " $_awayv31, $_awayv32",
MATCH_MASK | BIND_STACKABLE | BIND_STACKRET);
// Do stuff here
return 1;
Tcl_SetVar(interp, "_awayv32", msg ? (char *) msg : "", 0);
x = check_tcl_bind(H_awayv3, from, 0, " $_awayv31, $_awayv32",
MATCH_MASK | BIND_STACKABLE);

return (x == BIND_EXEC_LOG);
}

static int check_tcl_flud(char *nick, char *uhost, struct userrec *u,
Expand Down Expand Up @@ -1333,13 +1335,13 @@ static int handle_sasl_timeout()
/* Got AWAY message; only valid for IRCv3 away-notify capability */
static int gotawayv3(char *from, char *msg)
{
fixcolon(msg);
check_tcl_awayv3(from, msg);
if (strlen(msg)) {
fixcolon(msg);
putlog(LOG_SERV, "*", "%s is now away: %s", from, msg);
} else {
putlog(LOG_SERV, "*", "%s has returned from away status", from);
}
check_tcl_awayv3(from, msg);
return 0;
}

Expand Down

0 comments on commit f0657df

Please sign in to comment.