fix dlen
[citadel.git] / textclient / citadel_ipc.c
index e5788ad4c6b5152e25ca7f4b09d9c718b9cb6724..3b3cb45939e4aab085fb14f92f786734643b1e58 100644 (file)
@@ -1,12 +1,6 @@
 // Copyright (c) 1987-2022 by the citadel.org team
 //
-// This program is open source software.  Use, duplication, and/or
-// disclosure are subject to the GNU General Purpose License version 3.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// This program is open source software.  Use, duplication, or disclosure is subject to the GNU General Public License version 3.
 
 #include "textclient.h"
 
@@ -488,11 +482,11 @@ int CtdlIPCGotoRoom(CtdlIPC * ipc, const char *room, const char *passwd, struct
                rret[0]->RRlastread = extract_long(cret, 6);
                rret[0]->RRismailbox = extract_int(cret, 7);
                rret[0]->RRaide = extract_int(cret, 8);
-               rret[0]->RRnewmail = extract_long(cret, 9);
+               // position 9 is no longer used
                rret[0]->RRfloor = extract_int(cret, 10);
                rret[0]->RRcurrentview = extract_int(cret, 11);
                rret[0]->RRdefaultview = extract_int(cret, 12);
-               /* position 13 is a trash folder flag ... irrelevant in this client */
+               // position 13 is a trash folder flag ... irrelevant in this client
                rret[0]->RRflags2 = extract_int(cret, 14);
        }
        else {
@@ -671,7 +665,7 @@ int CtdlIPCGetSingleMessage(CtdlIPC * ipc, long msgnum, int headers, int as_mime
                                        if (!strncasecmp(bbb, "Content-type:", 13)) {
                                                extract_token(mret[0]->content_type, bbb, 0, '\n', sizeof mret[0]->content_type);
                                                strcpy(mret[0]->content_type, &mret[0]->content_type[13]);
-                                               striplt(mret[0]->content_type);
+                                               string_trim(mret[0]->content_type);
 
                                                /* strip out ";charset=" portion.  FIXME do something with
                                                 * the charset (like... convert it) instead of just throwing
@@ -685,12 +679,12 @@ int CtdlIPCGetSingleMessage(CtdlIPC * ipc, long msgnum, int headers, int as_mime
                                        if (!strncasecmp(bbb, "X-Citadel-MSG4-Partnum:", 23)) {
                                                extract_token(mret[0]->mime_chosen, bbb, 0, '\n', sizeof mret[0]->mime_chosen);
                                                strcpy(mret[0]->mime_chosen, &mret[0]->mime_chosen[23]);
-                                               striplt(mret[0]->mime_chosen);
+                                               string_trim(mret[0]->mime_chosen);
                                        }
                                        if (!strncasecmp(bbb, "Content-transfer-encoding:", 26)) {
                                                extract_token(encoding, bbb, 0, '\n', sizeof encoding);
                                                strcpy(encoding, &encoding[26]);
-                                               striplt(encoding);
+                                               string_trim(encoding);
                                        }
                                        remove_token(bbb, 0, '\n');
                                } while ((bbb[0] != 0) && (bbb[0] != '\n'));
@@ -1672,7 +1666,7 @@ int CtdlIPCIdentifySoftware(CtdlIPC * ipc, int developerid, int clientid,
                developerid = 8;
                clientid = 0;
                revision = CLIENT_VERSION - 600;
-               software_name = "Citadel (libcitadel)";
+               software_name = "Citadel text client";
        }
        if (!hostname)
                return -2;
@@ -1903,8 +1897,6 @@ int CtdlIPCAideGetUserParameters(CtdlIPC * ipc, const char *who, struct ctdluser
                extract_token(uret[0]->fullname, cret, 0, '|', sizeof uret[0]->fullname);
                extract_token(uret[0]->password, cret, 1, '|', sizeof uret[0]->password);
                uret[0]->flags = extract_int(cret, 2);
-               uret[0]->timescalled = extract_long(cret, 3);
-               uret[0]->posted = extract_long(cret, 4);
                uret[0]->axlevel = extract_int(cret, 5);
                uret[0]->usernum = extract_long(cret, 6);
                uret[0]->lastcall = extract_long(cret, 7);
@@ -1928,9 +1920,8 @@ int CtdlIPCAideSetUserParameters(CtdlIPC * ipc, const struct ctdluser *uret, cha
        if (!aaa)
                return -1;
 
-       sprintf(aaa, "ASUP %s|%s|%d|%ld|%ld|%d|%ld|%ld|%d",
-               uret->fullname, uret->password, uret->flags, uret->timescalled,
-               uret->posted, uret->axlevel, uret->usernum, uret->lastcall, uret->USuserpurge);
+       sprintf(aaa, "ASUP %s|%s|%d|0|0|%d|%ld|%ld|%d",
+               uret->fullname, uret->password, uret->flags, uret->axlevel, uret->usernum, uret->lastcall, uret->USuserpurge);
        ret = CtdlIPCGenericCommand(ipc, aaa, NULL, 0, NULL, NULL, cret);
        free(aaa);
        return ret;
@@ -2670,7 +2661,7 @@ int CtdlIPCGenericCommand(CtdlIPC * ipc,
                                ret = -ret;
                        }       /* else who knows?  DANGER WILL ROBINSON */
                        break;
-               case 8: /* START_CHAT_MODE */
+               case 8: /* SEND_THEN_RECV */
                        if (!strncasecmp(command, "CHAT", 4)) {
                                /* Don't call chatmode with generic! */
                                CtdlIPC_putline(ipc, "/quit");