/*
* Text client functions for reading and writing of messages
*
- * Copyright (c) 1987-2018 by the citadel.org team
+ * Copyright (c) 1987-2019 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
struct parts *last_message_parts = NULL; /* Parts from last msg */
-
void ka_sigcatch(int signum)
{
alarm(S_KEEPALIVE);
}
-
/*
* add a newline to the buffer...
*/
strcpy(qend, &qend[2]);
}
+
/*
* Read a message from the server
*/
return (fr);
}
+
/*
* replace string function for the built-in editor
*/
scr_printf("<R>eplace made %d substitution(s).\n\n", substitutions);
}
+
/*
* Function to begin composing a new message
*/
return (0);
}
+
/*
* Do editing on a quoted file
*/
}
tfile = fopen(temp, "w");
while (fgets(buf, 128, qfile) != NULL) {
- if ((++line >= qstart) && (line <= qend))
+ if ((++line >= qstart) && (line <= qend)) {
fprintf(tfile, " >%s", buf);
+ }
}
fprintf(tfile, " \n");
fclose(qfile);
}
-
/*
- * List the URL's which were embedded in the previous message
+ * List the URLs which were embedded in the previous message
*/
void list_urls(CtdlIPC * ipc)
{
int rv;
if (num_urls == 0) {
- scr_printf("There were no URL's in the previous message.\n\n");
+ scr_printf("There were no URLs in the previous message.\n\n");
return;
}
snprintf(cmd, sizeof cmd, rc_url_cmd, urls[i - 1]);
rv = system(cmd);
- if (rv != 0)
- scr_printf("failed to '%s' by %d\n", cmd, rv);
scr_printf("\n");
}
for (num_msgs = 0; msg_arr[num_msgs]; num_msgs++);
}
- if (num_msgs == 0) { /* TODO look at this later */
- if (c == LastMessages)
+ if (num_msgs == 0) {
+ if (c == LastMessages) {
return;
+ }
scr_printf("*** There are no ");
if (c == NewMessages)
scr_printf("new ");
} /* end read routine */
-
-
/*
* View and edit a system message
*/
}
-
-
/*
- * Loads the contents of a file into memory. Caller must free the allocated
- * memory.
+ * Loads the contents of a file into memory. Caller must free the allocated memory.
*/
char *load_message_from_file(FILE * src)
{