X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=textclient%2Fcitadel_ipc.c;h=123258f7681303685963de79ed357c2df0771304;hb=633eabfc5820a6cc3b3c45793243928d0fa9c099;hp=e67b29c5813cbdae3502fc3bdb7d1d70081a3f34;hpb=da6bb5e24252a0ff56d314a60081ae9ed31ab1a7;p=citadel.git diff --git a/textclient/citadel_ipc.c b/textclient/citadel_ipc.c index e67b29c58..123258f76 100644 --- a/textclient/citadel_ipc.c +++ b/textclient/citadel_ipc.c @@ -1,14 +1,12 @@ -/* - * Copyright (c) 1987-2018 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. - * - * 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. - */ +// Copyright (c) 1987-2020 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. #include "textclient.h" @@ -44,7 +42,7 @@ char *axdefs[] = { "New User", "Problem User", "Local User", - "Network User", + "Normal User", "Preferred User", "Admin", "Admin" @@ -622,6 +620,7 @@ int CtdlIPCGetSingleMessage(CtdlIPC * ipc, long msgnum, int headers, int as_mime strcpy(encoding, ""); strcpy(mret[0]->content_type, ""); + mret[0]->is_local = 0; sprintf(aaa, "MSG%d %ld|%d", as_mime, msgnum, headers); ret = CtdlIPCGenericCommand(ipc, aaa, NULL, 0, &bbb, &bbb_len, cret); if (ret / 100 == 1) { @@ -651,6 +650,8 @@ int CtdlIPCGetSingleMessage(CtdlIPC * ipc, long msgnum, int headers, int as_mime safestrncpy(mret[0]->references, &aaa[5], SIZ); else if (!strncasecmp(aaa, "time=", 5)) mret[0]->time = atol(&aaa[5]); + else if (!strncasecmp(aaa, "locl", 4)) + mret[0]->is_local = 1; /* Multipart/alternative prefix & suffix strings help * us to determine which part we want to download. @@ -1957,72 +1958,6 @@ int CtdlIPCEnterSystemMessage(CtdlIPC * ipc, const char *filename, const char *t } -/* HCHG */ -int CtdlIPCChangeHostname(CtdlIPC * ipc, const char *hostname, char *cret) -{ - int ret; - char *aaa; - - if (!cret) - return -2; - if (!hostname) - return -2; - - aaa = (char *) malloc(strlen(hostname) + 6); - if (!aaa) - return -1; - - sprintf(aaa, "HCHG %s", hostname); - ret = CtdlIPCGenericCommand(ipc, aaa, NULL, 0, NULL, NULL, cret); - free(aaa); - return ret; -} - - -/* RCHG */ -int CtdlIPCChangeRoomname(CtdlIPC * ipc, const char *roomname, char *cret) -{ - int ret; - char *aaa; - - if (!cret) - return -2; - if (!roomname) - return -2; - - aaa = (char *) malloc(strlen(roomname) + 6); - if (!aaa) - return -1; - - sprintf(aaa, "RCHG %s", roomname); - ret = CtdlIPCGenericCommand(ipc, aaa, NULL, 0, NULL, NULL, cret); - free(aaa); - return ret; -} - - -/* UCHG */ -int CtdlIPCChangeUsername(CtdlIPC * ipc, const char *username, char *cret) -{ - int ret; - char *aaa; - - if (!cret) - return -2; - if (!username) - return -2; - - aaa = (char *) malloc(strlen(username) + 6); - if (!aaa) - return -1; - - sprintf(aaa, "UCHG %s", username); - ret = CtdlIPCGenericCommand(ipc, aaa, NULL, 0, NULL, NULL, cret); - free(aaa); - return ret; -} - - /* TIME */ /* This function returns the actual server time reported, or 0 if error */ time_t CtdlIPCServerTime(CtdlIPC * ipc, char *cret)