diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-04-14 11:11:25 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-04-14 11:11:25 +0200 |
commit | 0c167fc5bee150acc900b0a9acdf770b4d5becbe (patch) | |
tree | e1a4fd639eda620d48c17e4044463a314aede81a /FICS | |
parent | dda96fced0146ecadd099fd57275f69055e540bc (diff) |
Reformatted com_sendmessage()
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/talkproc.c | 79 |
1 files changed, 44 insertions, 35 deletions
diff --git a/FICS/talkproc.c b/FICS/talkproc.c index e0b24ae..4ac787c 100644 --- a/FICS/talkproc.c +++ b/FICS/talkproc.c @@ -647,45 +647,54 @@ com_inchannel(int p, param_list param) } } -PUBLIC int com_sendmessage(int p, param_list param) +PUBLIC int +com_sendmessage(int p, param_list param) { - int p1, connected = 1; + int p1, connected = 1; - if (!parray[p].registered) { - pprintf(p, "You are not registered and cannot send messages.\n"); - return COM_OK; - } - if ((param[0].type == TYPE_NULL) || (param[1].type == TYPE_NULL)) { - pprintf(p, "No message sent.\n"); - return COM_OK; - } - if (!FindPlayer(p, param[0].val.word, &p1, &connected)) - return COM_OK; + if (!parray[p].registered) { + pprintf(p, "You are not registered and cannot send messages." + "\n"); + return COM_OK; + } - if (!parray[p1].registered) { - pprintf(p, "Player \"%s\" is unregistered and cannot receive messages.\n", - parray[p1].name); - return COM_OK; /* no need to removed */ - } + if (param[0].type == TYPE_NULL || param[1].type == TYPE_NULL) { + pprintf(p, "No message sent.\n"); + return COM_OK; + } - if ((player_censored(p1, p)) && (parray[p].adminLevel == 0)) { - pprintf(p, "Player \"%s\" is censoring you.\n", parray[p1].name); - if (!connected) - player_remove(p1); - return COM_OK; - } - if (player_add_message(p1, p, param[1].val.string)) { - pprintf(p, "Couldn't send message to %s. Message buffer full.\n", - parray[p1].name); - } else { - if (connected) { - pprintf(p1, "\n%s just sent you a message:\n", parray[p].name); - pprintf_prompt(p1, " %s\n", param[1].val.string); - } - } - if (!connected) - player_remove(p1); - return COM_OK; + if (!FindPlayer(p, param[0].val.word, &p1, &connected)) + return COM_OK; + + if (!parray[p1].registered) { + pprintf(p, "Player \"%s\" is unregistered and cannot receive " + "messages.\n", parray[p1].name); + return COM_OK; + } + + if (player_censored(p1, p) && parray[p].adminLevel == 0) { + pprintf(p, "Player \"%s\" is censoring you.\n", + parray[p1].name); + + if (!connected) + player_remove(p1); + return COM_OK; + } + + if (player_add_message(p1, p, param[1].val.string)) { + pprintf(p, "Couldn't send message to %s. " + "Message buffer full.\n", parray[p1].name); + } else { + if (connected) { + pprintf(p1, "\n%s just sent you a message:\n", + parray[p].name); + pprintf_prompt(p1, " %s\n", param[1].val.string); + } + } + + if (!connected) + player_remove(p1); + return COM_OK; } PUBLIC int |