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 disclosure is subject to the GNU General Public License v3.
9 // Delete one or more messages from the connected Citadel server.
10 // This function expects the session to already be "in" the room from which the messages will be deleted.
11 void ctdl_delete_msgs(struct ctdlsession *c, long *msgnums, int num_msgs) {
15 if ((c == NULL) || (msgnums == NULL) || (num_msgs < 1)) {
22 sprintf(&buf[strlen(buf)], "%ld", msgnums[i]);
23 if ((((i + 1) % 50) == 0) || (i == num_msgs - 1)) { // delete up to 50 messages with one server command
24 syslog(LOG_DEBUG, "%s", buf);
25 ctdl_printf(c, "%s", buf);
26 ctdl_readline(c, buf, sizeof(buf));
27 syslog(LOG_DEBUG, "%s", buf);
32 } while (++i < num_msgs);