diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-10 15:47:40 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-10 15:47:40 +0100 |
commit | 9d2d1c17c9dbe52f14f32accb6116cf53409676f (patch) | |
tree | 6580cf82bd3d9f64611014be988a7d49b73a3e01 /FICS/talkproc.c | |
parent | 2abeb3ff0cb09a8e342d94642af442c7893ae75b (diff) |
Reformatted com_mailmess()
Diffstat (limited to 'FICS/talkproc.c')
-rw-r--r-- | FICS/talkproc.c | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/FICS/talkproc.c b/FICS/talkproc.c index 559cfe5..ef96758 100644 --- a/FICS/talkproc.c +++ b/FICS/talkproc.c @@ -729,31 +729,34 @@ PUBLIC int com_clearmessages(int p, param_list param) return COM_OK; } -PUBLIC int com_mailmess(int p, param_list param) +PUBLIC int +com_mailmess(int p, param_list param) { - char *buffer[1000]; - char mdir[MAX_FILENAME_SIZE]; - char filename[MAX_FILENAME_SIZE]; - char subj[81], fname[MAX_FILENAME_SIZE]; - + char *buffer[1000]; + char filename[MAX_FILENAME_SIZE]; + char fname[MAX_FILENAME_SIZE]; + char mdir[MAX_FILENAME_SIZE]; + char subj[81]; + + if (!parray[p].registered) { + pprintf(p, "Only registered people can use the mailmess " + "command.\n"); + return COM_OK; + } - if (!parray[p].registered) { - pprintf(p, "Only registered people can use the mailmess command.\n"); - return COM_OK; - } - sprintf(filename, "%s.messages", parray[p].login); - sprintf(mdir, "%s/player_data/%c/", stats_dir, parray[p].login[0]); - - if (search_directory(mdir, filename, buffer, 1000)) { - sprintf(subj, "Your FICS messages from server %s", fics_hostname); - sprintf(fname, "%s/%s", mdir, filename); - mail_file_to_user (p, subj, fname); - pprintf(p, "Messages sent to %s\n", parray[p].emailAddress); - } else { - pprintf(p, "You have no messages.\n"); - } - return COM_OK; + sprintf(filename, "%s.messages", parray[p].login); + sprintf(mdir, "%s/player_data/%c/", stats_dir, parray[p].login[0]); + if (search_directory(mdir, filename, buffer, 1000)) { + sprintf(subj, "Your FICS messages from server %s", + fics_hostname); + sprintf(fname, "%s/%s", mdir, filename); + mail_file_to_user(p, subj, fname); + pprintf(p, "Messages sent to %s\n", parray[p].emailAddress); + } else { + pprintf(p, "You have no messages.\n"); + } + return COM_OK; } PUBLIC int com_znotify(int p, param_list param) |