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