/***********************************************************************
X3 ChangeLog
+2006-09-16 Neil Spierling <sirvulcan@gmail.com>
+
+ * src/chanserv.c: Do autojoin 5 seconds after handle_auth. Seems its
+ happening before autohide. Let me know if its still happening before
+ autohide.
+
+ * src/chanserv.help: Updated the AUTOJOIN bit.
+
2006-09-10 Neil Spierling <sirvulcan@gmail.com>
* src/mod-memoserv.c: Fixed crash bug.
return 0;
}
+static void
+chanserv_autojoin_channel(void *data)
+{
+ struct userData *channel;
+ struct userNode *user = data;
+
+ for(channel = user->handle_info->channels; channel; channel = channel->u_next)
+ {
+ struct chanNode *cn;
+ struct modeNode *mn;
+
+ if(IsUserSuspended(channel)
+ || IsSuspended(channel->channel)
+ || !(cn = channel->channel->channel))
+ continue;
+
+ mn = GetUserMode(cn, user);
+ if(!mn)
+ {
+ if(!IsUserSuspended(channel)
+ && IsUserAutoJoin(channel)
+ && (channel->access >= channel->channel->lvlOpts[lvlInviteMe])
+ && !self->burst
+ && !user->uplink->burst)
+ irc_svsjoin(chanserv, user, cn);
+ }
+ }
+}
+
static void
handle_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle))
{
&& !self->burst
&& !user->uplink->burst)
irc_invite(chanserv, user, cn);
-
- if(!IsUserSuspended(channel)
- && IsUserAutoJoin(channel)
- && (channel->access >= channel->channel->lvlOpts[lvlInviteMe])
- && !self->burst
- && !user->uplink->burst)
- irc_svsjoin(chanserv, user, cn);
-
continue;
}
if (user->handle_info->epithet)
irc_swhois(chanserv, user, user->handle_info->epithet);
+
+ /* process autojoin channels 5 seconds later as this sometimes
+ happens before autohide */
+ timeq_add(now + 5, chanserv_autojoin_channel, user);
}
static void
"INFO: Sets the infoline that $C sends when you join the channel.",
"AUTOOP: Enable or disable $C automatically opping you upon joining or authenticating.",
"AUTOINVITE: $C will invite you to this channel if you have access to and are not in when you authenticate if this setting is on.",
- "AUTOJOIN: $C will forcibly you to this channel if you have access to and are not in when you authenticate if this setting is on.",
+ "AUTOJOIN: $C will forcibly join you into this channel if you have access to and are not in it when you authenticate if this setting is on.",
"$uSee Also:$u set");
"USET INFO" ("/msg $C USET <#channel> INFO <info>",
"This command will set a user defined information message to be displayed when you join the channel. Set to '*' to clear the message.",
host_in_topic = atoi(hstr);
}
- if (type == 5) {
+ if (type >= 5) {
putsock("%s " P10_TOPIC " %s %s%s%s%s%s " FMT_TIME_T " " FMT_TIME_T " :%s", service->numeric, what->name,
who->nick, host_in_topic ? "!" : "", host_in_topic ? (IsSetHost(who) ? sident : who->ident) : "",
host_in_topic ? "@" : "", host_in_topic ? shost : "", what->timestamp, now, topic);