mirror of
https://github.com/anope/anope.git
synced 2026-07-05 11:03:12 +02:00
BUILD : 1.7.8 (631) BUGS : 320 NOTES : Fixed an error in the big if/else if thing when setting the modes on SJOIN, should now give correct modes
git-svn-id: svn://svn.anope.org/anope/trunk@631 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@479 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
89e28df398
commit
1fec2a9abd
@@ -8,6 +8,7 @@ Provided by Anope Dev. <dev@anope.org> - 2005
|
||||
02/13 A Internal Event support, see EVENTS in the doc folder for help [ #00]
|
||||
02/05 A Support for Unreal 3.2 +I channel mode. [ #00]
|
||||
02/03 A Merged anope-win32 branch into the main, now Win32 ready. [ #00]
|
||||
03/16 F Wrong modes being set in certain cases with SJOIN. [#320]
|
||||
03/14 F Two normalized strings not being freed. [#314]
|
||||
03/14 F Various minor mistakes (see bugreport for full list). [#313]
|
||||
03/14 F Sync state of servers was not recorded reliable enough. [ #00]
|
||||
|
||||
@@ -151,6 +151,8 @@ E void expire_chans(void);
|
||||
E void cs_remove_nick(const NickCore * nc);
|
||||
E void cs_remove_bot(const BotInfo * bi);
|
||||
|
||||
E int is_real_founder(User * user, ChannelInfo * ci);
|
||||
|
||||
E void check_modes(Channel * c);
|
||||
E int check_valid_admin(User * user, Channel * chan, int servermode);
|
||||
E int check_valid_op(User * user, Channel * chan, int servermode);
|
||||
|
||||
+61
-23
@@ -1217,35 +1217,73 @@ void add_invite(Channel * chan, char *mask)
|
||||
|
||||
void chan_set_correct_modes(User * user, Channel * c)
|
||||
{
|
||||
char *chan;
|
||||
char *tmp;
|
||||
int status;
|
||||
ChannelInfo *ci;
|
||||
|
||||
chan = c->name;
|
||||
ci = c->ci;
|
||||
|
||||
if (get_ignore(user->nick) == NULL) {
|
||||
status = chan_get_user_status(c, user);
|
||||
/* This looks dirty. For every mode we first check if the IRCd
|
||||
* supports it. If true, we check if the user already has the
|
||||
* mode. If both are true, we check if they should get the mode,
|
||||
* which sends the mode to the uplink and returns true. If the
|
||||
* mode is sent, we internally update to finish it off. -GD
|
||||
*/
|
||||
if (ircd->owner && !(status & CUS_OWNER)
|
||||
&& check_should_owner(user, chan))
|
||||
chan_set_user_status(c, user, CUS_OWNER | CUS_OP);
|
||||
else if (ircd->protect && !(status & CUS_PROTECT)
|
||||
&& check_should_protect(user, chan))
|
||||
chan_set_user_status(c, user, CUS_PROTECT | CUS_OP);
|
||||
else if (ircd->admin && !(status & CUS_PROTECT)
|
||||
&& check_should_protect(user, chan))
|
||||
chan_set_user_status(c, user, CUS_PROTECT | CUS_OP);
|
||||
else if (!(status & CUS_OP) && check_should_op(user, chan))
|
||||
if (!ci || (ci->flags & CI_VERBOTEN) || (*(c->name) == '+'))
|
||||
return;
|
||||
|
||||
if ((ci->flags & CI_SECURE) && !nick_identified(user))
|
||||
return;
|
||||
|
||||
if (get_ignore(user->nick) != NULL)
|
||||
return;
|
||||
|
||||
status = chan_get_user_status(c, user);
|
||||
if (ircd->owner
|
||||
&& (((ci->flags & CI_SECUREFOUNDER) && is_real_founder(user, ci))
|
||||
|| (!(ci->flags & CI_SECUREFOUNDER)
|
||||
&& is_founder(user, ci)))) {
|
||||
if (!(status & CUS_OWNER)) {
|
||||
tmp = stripModePrefix(ircd->ownerset);
|
||||
if (!(status & CUS_OP)) {
|
||||
anope_cmd_mode(whosends(ci), c->name, "+o%s %s %s", tmp,
|
||||
user->nick, user->nick);
|
||||
chan_set_user_status(c, user, CUS_OWNER | CUS_OP);
|
||||
} else {
|
||||
anope_cmd_mode(whosends(ci), c->name, "+%s %s", tmp,
|
||||
user->nick);
|
||||
chan_set_user_status(c, user, CUS_OWNER);
|
||||
}
|
||||
} else if (!(status & CUS_OP)) {
|
||||
anope_cmd_mode(whosends(ci), c->name, "+o %s", user->nick);
|
||||
chan_set_user_status(c, user, CUS_OP);
|
||||
else if (ircd->halfop && !(status & CUS_HALFOP)
|
||||
&& check_should_halfop(user, chan))
|
||||
}
|
||||
} else if ((ircd->protect || ircd->admin)
|
||||
&& check_access(user, ci, CA_AUTOPROTECT)) {
|
||||
tmp = stripModePrefix(ircd->adminset);
|
||||
if (!(status & CUS_PROTECT)) {
|
||||
if (!(status & CUS_OP)) {
|
||||
anope_cmd_mode(whosends(ci), c->name, "+o%s %s %s", tmp,
|
||||
user->nick, user->nick);
|
||||
chan_set_user_status(c, user, CUS_PROTECT | CUS_OP);
|
||||
} else {
|
||||
anope_cmd_mode(whosends(ci), c->name, "+%s %s", tmp,
|
||||
user->nick);
|
||||
chan_set_user_status(c, user, CUS_PROTECT);
|
||||
}
|
||||
} else if (!(status & CUS_OP)) {
|
||||
anope_cmd_mode(whosends(ci), c->name, "+o %s", user->nick);
|
||||
chan_set_user_status(c, user, CUS_OP);
|
||||
}
|
||||
} else if (check_access(user, ci, CA_AUTOOP)) {
|
||||
if (!(status & CUS_OP)) {
|
||||
anope_cmd_mode(whosends(ci), c->name, "+o %s", user->nick);
|
||||
chan_set_user_status(c, user, CUS_OP);
|
||||
}
|
||||
} else if (ircd->halfop && check_access(user, ci, CA_AUTOHALFOP)) {
|
||||
if (!(status & CUS_HALFOP)) {
|
||||
anope_cmd_mode(whosends(ci), c->name, "+h %s", user->nick);
|
||||
chan_set_user_status(c, user, CUS_HALFOP);
|
||||
else if (!(status & CUS_VOICE) && check_should_voice(user, chan))
|
||||
}
|
||||
} else if (check_access(user, ci, CA_AUTOVOICE)) {
|
||||
if (!(status & CUS_VOICE)) {
|
||||
anope_cmd_mode(whosends(ci), c->name, "+v %s", user->nick);
|
||||
chan_set_user_status(c, user, CUS_VOICE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -186,7 +186,6 @@ void alpha_insert_chan(ChannelInfo * ci);
|
||||
static ChannelInfo *makechan(const char *chan);
|
||||
int delchan(ChannelInfo * ci);
|
||||
void reset_levels(ChannelInfo * ci);
|
||||
static int is_real_founder(User * user, ChannelInfo * ci);
|
||||
static int is_identified(User * user, ChannelInfo * ci);
|
||||
static void make_unidentified(User * u, ChannelInfo * ci);
|
||||
|
||||
@@ -2304,7 +2303,7 @@ int is_founder(User * user, ChannelInfo * ci)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
static int is_real_founder(User * user, ChannelInfo * ci)
|
||||
int is_real_founder(User * user, ChannelInfo * ci)
|
||||
{
|
||||
if (user->isSuperAdmin) {
|
||||
return 1;
|
||||
|
||||
+5
-1
@@ -8,10 +8,14 @@
|
||||
VERSION_MAJOR="1"
|
||||
VERSION_MINOR="7"
|
||||
VERSION_PATCH="8"
|
||||
VERSION_BUILD="630"
|
||||
VERSION_BUILD="631"
|
||||
|
||||
# $Log$
|
||||
#
|
||||
# BUILD : 1.7.8 (631)
|
||||
# BUGS : 320
|
||||
# NOTES : Fixed an error in the big if/else if thing when setting the modes on SJOIN, should now give correct modes
|
||||
#
|
||||
# BUILD : 1.7.8 (630)
|
||||
# BUGS : N/A
|
||||
# NOTES : Use sstrdup instead of strdup
|
||||
|
||||
Reference in New Issue
Block a user