Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2004-05-25 03:10:12 UTC
Modified files:
ChangeLog ircd/m_invite.c
Log message:
Include channel name in the status message sent to channel operators.
Assign to chptr before trying to dereference it.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.423 ircu2.10/ChangeLog:1.424
--- ircu2.10/ChangeLog:1.423 Tue May 18 20:46:05 2004
+++ ircu2.10/ChangeLog Mon May 24 20:10:01 2004
@@ -1,3 +1,10 @@
+2004-05-24 Michael Poole <[EMAIL PROTECTED]>
+
+ * ircd/m_invite.c (m_invite): Include channel name in invitation
+ announcements.
+ (ms_invite): Likewise, and also fix a use-before-assignment bug in
+ them.
+
2004-05-18 Michael Poole <[EMAIL PROTECTED]>
Announce invitations to other channel operators.
Index: ircu2.10/ircd/m_invite.c
diff -u ircu2.10/ircd/m_invite.c:1.14 ircu2.10/ircd/m_invite.c:1.15
--- ircu2.10/ircd/m_invite.c:1.14 Tue May 18 20:46:04 2004
+++ ircu2.10/ircd/m_invite.c Mon May 24 20:10:01 2004
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_invite.c,v 1.14 2004/05/19 03:46:04 entrope Exp $
+ * $Id: m_invite.c,v 1.15 2004/05/25 03:10:01 entrope Exp $
*/
/*
@@ -183,8 +183,8 @@
if (feature_bool(FEAT_ANNOUNCE_INVITES)) {
sendcmdto_channel_butserv_butone(&me, get_error_numeric(RPL_ISSUEDINVITE)->str,
NULL, chptr, sptr, SKIP_NONOPS,
- "%C %C :%C has been invited by %C",
- acptr, sptr, acptr, sptr);
+ "%H %C %C :%C has been invited by %C",
+ chptr, acptr, sptr, acptr, sptr);
sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, sptr, 0,
"%s :%H", cli_name(acptr), chptr);
if (MyConnect(acptr))
@@ -242,27 +242,6 @@
send_reply(sptr, ERR_NOSUCHNICK, parv[1]);
return 0;
}
- if (feature_bool(FEAT_ANNOUNCE_INVITES)) {
- sendcmdto_channel_butserv_butone(&me, get_error_numeric(RPL_ISSUEDINVITE)->str,
- NULL, chptr, sptr, SKIP_NONOPS,
- "%C %C :%C has been invited by %C",
- acptr, sptr, acptr, sptr);
- sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, sptr, 0,
- "%s :%H", cli_name(acptr), chptr);
- if (MyConnect(acptr))
- sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr);
- return 0;
- }
- if (!MyUser(acptr)) {
- /*
- * just relay the message
- */
- sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%s", cli_name(acptr), parv[2]);
- return 0;
- }
-
- if (is_silenced(sptr, acptr))
- return 0;
if (!(chptr = FindChannel(parv[2]))) {
/*
@@ -277,11 +256,27 @@
send_reply(sptr, ERR_NOTONCHANNEL, chptr->chname);
return 0;
}
+
if (find_channel_member(acptr, chptr)) {
send_reply(sptr, ERR_USERONCHANNEL, cli_name(acptr), chptr->chname);
return 0;
}
- add_invite(acptr, chptr);
+
+ if (is_silenced(sptr, acptr))
+ return 0;
+
+ if (MyConnect(acptr))
+ add_invite(acptr, chptr);
+
+ if (feature_bool(FEAT_ANNOUNCE_INVITES)) {
+ sendcmdto_channel_butserv_butone(&me, get_error_numeric(RPL_ISSUEDINVITE)->str,
+ NULL, chptr, sptr, SKIP_NONOPS,
+ "%H %C %C :%C has been invited by %C",
+ chptr, acptr, sptr, acptr, sptr);
+ sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, sptr, 0,
+ "%s :%H", cli_name(acptr), chptr);
+ }
+
sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr);
return 0;
}
----------------------- End of diff -----------------------