Skip to content

Commit

Permalink
Chase contrib for entity() changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
William Pitcock committed Aug 21, 2010
1 parent 1e7cdfe commit e7fc8b9
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
14 changes: 7 additions & 7 deletions contrib/cs_userinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static void cs_cmd_userinfo(sourceinfo_t *si, int parc, char *parv[])
md = metadata_find(ca, "userinfo");
if (md == NULL)
continue;
command_success_nodata(si, "%-19s %s", ca->myuser->name, md->value);
command_success_nodata(si, "%-19s %s", entity(ca->myuser)->name, md->value);
}

command_success_nodata(si, "------------------- ---------------");
Expand All @@ -114,27 +114,27 @@ static void cs_cmd_userinfo(sourceinfo_t *si, int parc, char *parv[])
ca = chanacs_find(mc, mu, 0);
if (ca == NULL || ca->level & CA_AKICK)
{
command_fail(si, fault_nosuch_target, _("\2%s\2 has no access to \2%s\2."), mu->name, mc->name);
command_fail(si, fault_nosuch_target, _("\2%s\2 has no access to \2%s\2."), entity(mu)->name, mc->name);
return;
}
if (ca->level & ~allow_flags(mc, restrictflags))
{
command_fail(si, fault_noprivs, _("You are not authorized to modify the access entry for \2%s\2 on \2%s\2."), mu->name, mc->name);
command_fail(si, fault_noprivs, _("You are not authorized to modify the access entry for \2%s\2 on \2%s\2."), entity(mu)->name, mc->name);
return;
}
if (parc == 2)
{
metadata_delete(ca, "userinfo");
command_success_nodata(si, _("Deleted userinfo for \2%s\2 on \2%s\2."),
mu->name, mc->name);
logcommand(si, CMDLOG_SET, "USERINFO:DEL: \2%s\2 on \2%s\2", mu->name, mc->name);
entity(mu)->name, mc->name);
logcommand(si, CMDLOG_SET, "USERINFO:DEL: \2%s\2 on \2%s\2", entity(mu)->name, mc->name);
return;
}

metadata_add(ca, "userinfo", parv[2]);
command_success_nodata(si, _("Added userinfo for \2%s\2 on \2%s\2."),
mu->name, mc->name);
logcommand(si, CMDLOG_SET, "USERINFO:ADD: \2%s\2 on \2%s\2 (\2%s\2)", mu->name, mc->name, parv[2]);
entity(mu)->name, mc->name);
logcommand(si, CMDLOG_SET, "USERINFO:ADD: \2%s\2 on \2%s\2 (\2%s\2)", entity(mu)->name, mc->name, parv[2]);
}
return;
}
Expand Down
4 changes: 2 additions & 2 deletions contrib/gen_vhostonreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static void user_add_host(myuser_t *mu)
maxlen1 = HOSTLEN - 2 - strlen(me.hidehostsuffix);
if (maxlen1 < 9)
return;
p = mu->name;
p = entity(mu)->name;
i = 0;
while (i < maxlen1 && *p != '\0')
{
Expand All @@ -73,7 +73,7 @@ static void user_add_host(myuser_t *mu)
myuser_notice(nicksvs.nick, mu, "Your account name cannot be used in a vhost directly. To ensure uniqueness, a number was added.");
myuser_notice(nicksvs.nick, mu, "To avoid this, register an account name containing only letters, digits and %s.", VALID_SPECIALS);
if (!nicksvs.no_nick_ownership && command_find(nicksvs.me->cmdtree, "GROUP"))
myuser_notice(nicksvs.nick, mu, "If you drop %s you can group it to your new account.", mu->name);
myuser_notice(nicksvs.nick, mu, "If you drop %s you can group it to your new account.", entity(mu)->name);
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion contrib/graphtastical.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static void write_channels_dot_file(void *arg)
if (ca->level & CA_AKICK)
continue;

fprintf(f, "\"%s\" -- \"%s\" [fontname=\"Verdana\" fontsize=8]\n", ca->myuser ? ca->myuser->name : ca->host, mc->name);
fprintf(f, "\"%s\" -- \"%s\" [fontname=\"Verdana\" fontsize=8]\n", ca->myuser ? entity(ca->myuser)->name : ca->host, mc->name);
}
}

Expand Down
16 changes: 8 additions & 8 deletions contrib/ns_fenforce.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,28 @@ static void ns_cmd_fenforce(sourceinfo_t *si, int parc, char *parv[])
{
if ((md = metadata_find(mu, "private:doenforce")) != NULL)
{
command_fail(si, fault_nochange, _("The \2%s\2 flag is already set for account \2%s\2."), "ENFORCE", mu->name);
command_fail(si, fault_nochange, _("The \2%s\2 flag is already set for account \2%s\2."), "ENFORCE", entity(mu)->name);
}
else
{
wallops("%s enabled ENFORCE on the account \2%s\2.", get_oper_name(si), mu->name);
logcommand(si, CMDLOG_ADMIN, "FENFORCE:ON: \2%s\2", mu->name);
wallops("%s enabled ENFORCE on the account \2%s\2.", get_oper_name(si), entity(mu)->name);
logcommand(si, CMDLOG_ADMIN, "FENFORCE:ON: \2%s\2", entity(mu)->name);
metadata_add(mu, "private:doenforce", "1");
command_success_nodata(si, _("The \2%s\2 flag has been set for account \2%s\2."), "ENFORCE", mu->name);
command_success_nodata(si, _("The \2%s\2 flag has been set for account \2%s\2."), "ENFORCE", entity(mu)->name);
}
}
else if (strcasecmp(setting, "OFF") == 0)
{
if ((md = metadata_find(mu, "private:doenforce")) != NULL)
{
wallops("%s disabled ENFORCE on the account \2%s\2.", get_oper_name(si), mu->name);
logcommand(si, CMDLOG_ADMIN, "FENFORCE:OFF: \2%s\2", mu->name);
wallops("%s disabled ENFORCE on the account \2%s\2.", get_oper_name(si), entity(mu)->name);
logcommand(si, CMDLOG_ADMIN, "FENFORCE:OFF: \2%s\2", entity(mu)->name);
metadata_delete(mu, "private:doenforce");
command_success_nodata(si, _("The \2%s\2 flag has been removed for account \2%s\2."), "ENFORCE", mu->name);
command_success_nodata(si, _("The \2%s\2 flag has been removed for account \2%s\2."), "ENFORCE", entity(mu)->name);
}
else
{
command_fail(si, fault_nochange, _("The \2%s\2 flag is not set for account \2%s\2."), "ENFORCE", mu->name);
command_fail(si, fault_nochange, _("The \2%s\2 flag is not set for account \2%s\2."), "ENFORCE", entity(mu)->name);
}
}
else
Expand Down
12 changes: 6 additions & 6 deletions contrib/ns_forbid.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,22 @@ static void make_forbid(sourceinfo_t *si, const char *account, const char *reaso
metadata_add(mu, "private:freeze:timestamp", itoa(CURRTIME));
if (!nicksvs.no_nick_ownership)
{
mn = mynick_add(mu, mu->name);
mn = mynick_add(mu, entity(mu)->name);
mn->registered = CURRTIME;
mn->lastseen = CURRTIME;
u = user_find_named(mu->name);
u = user_find_named(entity(mu)->name);
if (u != NULL)
{
notice(si->service->nick, u->nick,
_("The nick \2%s\2 is now forbidden."),
mu->name);
entity(mu)->name);
hook_call_nick_enforce((&(hook_nick_enforce_t){ .u = u, .mn = mn }));
}
}

logcommand(si, CMDLOG_ADMIN | CMDLOG_REGISTER, "FORBID:ON: \2%s\2 (reason: \2%s\2)", account, reason);
wallops("%s forbade the nickname \2%s\2 (%s).", get_oper_name(si), account, reason);
command_success_nodata(si, "\2%s\2 is now forbidden.", mu->name);
command_success_nodata(si, "\2%s\2 is now forbidden.", entity(mu)->name);
/* don't call hooks, hmm */
}

Expand All @@ -109,9 +109,9 @@ static void destroy_forbid(sourceinfo_t *si, const char *account)
command_fail(si, fault_nosuch_target, _("\2%s\2 is not a forbidden nickname."), account);
return;
}
logcommand(si, CMDLOG_ADMIN | CMDLOG_REGISTER, "FORBID:OFF: \2%s\2", mu->name);
logcommand(si, CMDLOG_ADMIN | CMDLOG_REGISTER, "FORBID:OFF: \2%s\2", entity(mu)->name);
wallops("%s unforbade the nickname \2%s\2.", get_oper_name(si), account);
command_success_nodata(si, "\2%s\2 is no longer forbidden.", mu->name);
command_success_nodata(si, "\2%s\2 is no longer forbidden.", entity(mu)->name);
/* no hooks here either, hmm */
object_unref(mu);
}
Expand Down
8 changes: 4 additions & 4 deletions contrib/ns_fregister.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ static void ns_cmd_fregister(sourceinfo_t *si, int parc, char *parv[])
mu->lastlogin = CURRTIME;
if (!nicksvs.no_nick_ownership)
{
mn = mynick_add(mu, mu->name);
mn = mynick_add(mu, entity(mu)->name);
mn->registered = CURRTIME;
mn->lastseen = CURRTIME;
}

logcommand(si, CMDLOG_REGISTER, "FREGISTER: \2%s\2 to \2%s\2", account, email);
if (is_soper(mu))
{
wallops("%s used FREGISTER on account \2%s\2 with services operator privileges.", get_oper_name(si), mu->name);
slog(LG_INFO, "SOPER: \2%s\2", mu->name);
wallops("%s used FREGISTER on account \2%s\2 with services operator privileges.", get_oper_name(si), entity(mu)->name);
slog(LG_INFO, "SOPER: \2%s\2", entity(mu)->name);
}

command_success_nodata(si, "\2%s\2 is now registered to \2%s\2.", mu->name, mu->email);
command_success_nodata(si, "\2%s\2 is now registered to \2%s\2.", entity(mu)->name, mu->email);
hook_call_user_register(mu);
req.si = si;
req.mu = mu;
Expand Down
2 changes: 1 addition & 1 deletion contrib/ns_listlogins.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void ns_cmd_listlogins(sourceinfo_t *si, int parc, char *parv[])
return;
}

command_success_nodata(si, "Clients identified to account \2%s\2", si->smu->name);
command_success_nodata(si, "Clients identified to account \2%s\2", entity(si->smu)->name);
LIST_FOREACH(n, si->smu->logins.head)
{
u = n->data;
Expand Down

0 comments on commit e7fc8b9

Please sign in to comment.