aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/adminproc.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-05-18 09:53:50 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-05-18 09:53:50 +0200
commita9370d5c471495ec422bd52f08f4a7b1d512641b (patch)
tree67e10d1419f1961e2d608e18744ee5e64174c2d6 /FICS/adminproc.c
parent2064d28dab760ca94e1f0c0caf8f629ee92e0796 (diff)
Reformatted com_asetemail()
Diffstat (limited to 'FICS/adminproc.c')
-rw-r--r--FICS/adminproc.c75
1 files changed, 44 insertions, 31 deletions
diff --git a/FICS/adminproc.c b/FICS/adminproc.c
index 6abb649..a6623a6 100644
--- a/FICS/adminproc.c
+++ b/FICS/adminproc.c
@@ -1278,41 +1278,54 @@ com_asetpasswd(int p, param_list param)
* command, but no other users -- except admins -- will have another
* player's email address displayed.
*/
-PUBLIC int com_asetemail(int p, param_list param)
+PUBLIC int
+com_asetemail(int p, param_list param)
{
- int p1, connected;
+ int p1, connected;
- ASSERT(parray[p].adminLevel >= ADMIN_ADMIN);
+ ASSERT(parray[p].adminLevel >= ADMIN_ADMIN);
- if (!FindPlayer(p, param[0].val.word, &p1, &connected))
- return COM_OK;
+ if (!FindPlayer(p, param[0].val.word, &p1, &connected))
+ return COM_OK;
- if ((parray[p].adminLevel <= parray[p1].adminLevel) && !player_ishead(p)) {
- pprintf(p, "You can only set email addr for players below your adminlevel.\n");
- if (!connected)
- player_remove(p1);
- return COM_OK;
- }
- if (parray[p1].emailAddress)
- rfree(parray[p1].emailAddress);
- if (param[1].type == TYPE_NULL) {
- parray[p1].emailAddress = NULL;
- pprintf(p, "Email address for %s removed\n", parray[p1].name);
- } else {
- parray[p1].emailAddress = xstrdup(param[1].val.word);
- pprintf(p, "Email address of %s changed to \"%s\".\n", parray[p1].name, param[1].val.word);
- }
- player_save(p1);
- if (connected) {
- if (param[1].type == TYPE_NULL) {
- pprintf_prompt(p1, "\n\n%s has removed your email address.\n\n", parray[p].name);
- } else {
- pprintf_prompt(p1, "\n\n%s has changed your email address.\n\n", parray[p].name);
- }
- } else {
- player_remove(p1);
- }
- return COM_OK;
+ if ((parray[p].adminLevel <= parray[p1].adminLevel) &&
+ !player_ishead(p)) {
+ pprintf(p, "You can only set email addr for players below "
+ "your adminlevel.\n");
+
+ if (!connected)
+ player_remove(p1);
+ return COM_OK;
+ }
+
+ if (parray[p1].emailAddress)
+ rfree(parray[p1].emailAddress);
+
+ if (param[1].type == TYPE_NULL) {
+ parray[p1].emailAddress = NULL;
+ pprintf(p, "Email address for %s removed\n", parray[p1].name);
+ } else {
+ parray[p1].emailAddress = xstrdup(param[1].val.word);
+ pprintf(p, "Email address of %s changed to \"%s\".\n",
+ parray[p1].name,
+ param[1].val.word);
+ }
+
+ player_save(p1);
+
+ if (connected) {
+ if (param[1].type == TYPE_NULL) {
+ pprintf_prompt(p1, "\n\n%s has removed your email "
+ "address.\n\n", parray[p].name);
+ } else {
+ pprintf_prompt(p1, "\n\n%s has changed your email "
+ "address.\n\n", parray[p].name);
+ }
+ } else {
+ player_remove(p1);
+ }
+
+ return COM_OK;
}
/*