Skip to content

Commit

Permalink
fix variable order
Browse files Browse the repository at this point in the history
  • Loading branch information
vanosg committed Dec 30, 2019
1 parent 949f4d0 commit c1140be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions doc/sphinx_source/mainDocs/tcl-commands.rst
Expand Up @@ -3290,11 +3290,11 @@ The following is a list of bind types and how they work. Below each bind type is

(51) INVT (stackable)

bind invt <flags> <mask> <prov>
bind invt <flags> <mask> <proc>

procname <nick> <user@host> <invitee> <channel>
procname <nick> <user@host> <channel> <invitee>

Description: triggered when eggdrop received an INVITE message. nick is the nickname of the person sending the invite request, user@host is the user@host of the person sending the invite, invitee is the target of the invite, channel is the channel the invitee is being invited to. The invitee argument was added to support the IRCv3 invite-notify capability, where the eggdrop may be able to see invite messages for other people that are not the eggdrop.
Description: triggered when eggdrop received an INVITE message. The mask for the bind is in the format "#channel nickname", where nickname (not a hostmask) is that of the invitee. For the proc, nick is the nickname of the person sending the invite request, user@host is the user@host of the person sending the invite, channel is the channel the invitee is being invited to, and invitee is the target (nickname only) of the invite. The invitee argument was added to support the IRCv3 invite-notify capability, where the eggdrop may be able to see invite messages for other people that are not the eggdrop.

^^^^^^^^^^^^^
Return Values
Expand Down
5 changes: 2 additions & 3 deletions src/mod/irc.mod/chan.c
Expand Up @@ -30,7 +30,6 @@ static int count_ctcp = 0;
static time_t last_invtime = (time_t) 0L;
static char last_invchan[CHANNELLEN + 1] = "";


/* ID length for !channels.
*/
#define CHANNEL_ID_LEN 5
Expand Down Expand Up @@ -1520,12 +1519,12 @@ static int gotinvite(char *from, char *msg)
invitee = newsplit(&msg);
fixcolon(msg);
nick = splitnick(&from);
check_tcl_invite(nick, from, invitee, msg);
check_tcl_invite(nick, from, msg, invitee);
/* Because who needs RFCs? Freakin IRCv3... */
if (!match_my_nick(invitee)) {
putlog(LOG_DEBUG, "*", "Received invite notifiation for %s to %s by %s.",
invitee, msg, nick);
return 1;
return 1;
}
if (!rfc_casecmp(last_invchan, msg))
if (now - last_invtime < 30)
Expand Down
13 changes: 8 additions & 5 deletions src/mod/irc.mod/irc.c
Expand Up @@ -750,7 +750,7 @@ static int invite_4char STDVAR
{
Function F = (Function) cd;

BADARGS(5, 5, " nick uhost invitee channel");
BADARGS(5, 5, " nick uhost channel invitee");

CHECKVALIDITY(invite_4char);
F(argv[1], argv[2], argv[3], argv[4]);
Expand Down Expand Up @@ -852,13 +852,16 @@ static void check_tcl_kick(char *nick, char *uhost, struct userrec *u,
MATCH_MASK | BIND_USE_ATTR | BIND_STACKABLE);
}

static void check_tcl_invite(char *nick, char *from, char *invitee, char *chan)
static void check_tcl_invite(char *nick, char *from, char *chan, char *invitee)
{
char args[512];

Tcl_SetVar(interp, "_invite1", nick, 0);
Tcl_SetVar(interp, "_invite2", from, 0);
Tcl_SetVar(interp, "_invite3", invitee, 0);
Tcl_SetVar(interp, "_invite4", chan, 0);
check_tcl_bind(H_invt, from, 0, " $_invite1 $_invite2 $_invite3 $_invite4",
Tcl_SetVar(interp, "_invite3", chan, 0);
Tcl_SetVar(interp, "_invite4", invitee, 0);
simple_sprintf(args, "%s %s", chan, invitee);
check_tcl_bind(H_invt, args, 0, " $_invite1 $_invite2 $_invite3 $_invite4",
MATCH_MASK | BIND_STACKABLE);
}

Expand Down

0 comments on commit c1140be

Please sign in to comment.