1 // These utility functions loosely make up a Citadel protocol client library.
3 // Copyright (c) 2016-2022 by the citadel.org team
5 // This program is open source software. Use, duplication, or
6 // disclosure are subject to the GNU General Public License v3.
10 // Delete one or more messages from the connected Citadel server.
11 // This function expects the session to already be "in" the room from which the messages will be deleted.
12 void ctdl_delete_msgs(struct ctdlsession *c, long *msgnums, int num_msgs) {
16 if ((c == NULL) || (msgnums == NULL) || (num_msgs < 1)) {
23 sprintf(&buf[strlen(buf)], "%ld", msgnums[i]);
24 if ((((i + 1) % 50) == 0) || (i == num_msgs - 1)) // delete up to 50 messages with one server command
26 syslog(LOG_DEBUG, "%s", buf);
27 ctdl_printf(c, "%s", buf);
28 ctdl_readline(c, buf, sizeof(buf));
29 syslog(LOG_DEBUG, "%s", buf);
34 } while (++i < num_msgs);