static const char *his_servercomment;
static int extended_accounts;
+/* These correspond to 1 << X: 012345678901234567 */
+const char irc_user_mode_chars[] = "o iw dkgn I";
+
static struct userNode *AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *numeric, const char *userinfo, time_t timestamp, const char *realip);
extern int off_channel;
return;
irc_p10_ntop(b64ip, &user->ip);
if (user->modes) {
- int modelen;
char modes[32];
- modelen = 0;
- if (IsOper(user))
- modes[modelen++] = 'o';
- if (IsInvisible(user))
- modes[modelen++] = 'i';
- if (IsWallOp(user))
- modes[modelen++] = 'w';
- if (IsService(user))
- modes[modelen++] = 'k';
- if (IsDeaf(user))
- modes[modelen++] = 'd';
- if (IsGlobal(user))
- modes[modelen++] = 'g';
- // sethost - reed/apples
- // if (IsHelperIrcu(user))
- if (IsSetHost(user))
- modes[modelen++] = 'h';
- if (IsFakeHost(user))
- modes[modelen++] = 'f';
- if (IsHiddenHost(user))
- modes[modelen++] = 'x';
- if (IsBotM(user))
- modes[modelen++] = 'B';
- if (IsHideChans(user))
- modes[modelen++] = 'n';
- if (IsHideIdle(user))
- modes[modelen++] = 'I';
- if (IsXtraOp(user))
- modes[modelen++] = 'X';
-
- modes[modelen] = 0;
-
+ irc_user_modes(user, modes, sizeof(modes));
/* we don't need to put the + in modes because it's in the format string. */
putsock("%s " P10_NICK " %s %d " FMT_TIME_T " %s %s +%s %s %s :%s",
user->uplink->numeric, user->nick, user->uplink->hops+1, user->timestamp, user->ident, user->hostname, modes, b64ip, user->numeric, user->info);
}
void
-irc_svsquit(struct userNode *from, struct userNode *who, char *reason)
+irc_svsquit(struct userNode *from, struct userNode *who, char const *reason)
{
putsock("%s " P10_SVSQUIT " %s :%s", from->uplink->numeric, who->numeric, reason);
}
{
struct server *sender;
dict_iterator_t it;
- unsigned int ii;
if (!(sender = GetServerH(origin)))
return 0;
}
sender->self_burst = 0;
recalc_bursts(sender);
- for (ii=0; ii<slf_used; ii++)
- slf_list[ii](sender);
+ call_server_link_funcs(sender);
/* let auto-routing figure out if we were
* wating on this server to link a child to it */
/* DONT call this if uplink is _US_ */
putsock("%s " P10_PRIVS " %s %s%s", self->numeric, target->numeric, (add == PRIV_ADD) ? "+" : "-", flag);
}
+void
+irc_raw_privs(struct userNode *target, const char *privs)
+{
+ putsock("%s " P10_PRIVS " %s %s", self->numeric, target->numeric, privs);
+}
+
static CMD_FUNC(cmd_privs)
{
char *tstr = NULL;
{
unsigned int nn;
free(of_list);
+ free(of_list_extra);
free(privmsg_funcs);
num_privmsg_funcs = 0;
free(notice_funcs);
AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *numeric, const char *userinfo, time_t timestamp, const char *realip)
{
struct userNode *oldUser, *uNode;
- unsigned int n, ignore_user, dummy;
+ unsigned int ignore_user, dummy;
char *tstr;
int type;
}
if (IsLocal(uNode))
irc_user(uNode);
- for (n=0; (n<nuf_used) && !uNode->dead; n++)
- nuf_list[n](uNode);
+ call_new_user_funcs(uNode);
if ((uNode->loc == 1) && (uNode->handle_info))
send_func_list(uNode);
void
DelUser(struct userNode* user, struct userNode *killer, int announce, const char *why)
{
- unsigned int n;
verify(user);
/* Call these in reverse order so ChanServ can update presence
information before NickServ nukes the handle_info. */
- for (n = duf_used; n > 0; )
- duf_list[--n](user, killer, why);
+ call_del_user_funcs(user, killer, why);
user->uplink->clients--;
user->uplink->users[user->num_local] = NULL;