X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fpaging.c;h=38b8b541d482befa0408e5231fb5bd773f966856;hb=fb6f6fa4ec4e3277e30d84326d48e6850822d318;hp=7c632fb9f14b435534b19da9ba1b30f53157b786;hpb=e935238cffe442d3fa0b530774bc4b3dab934bf7;p=citadel.git diff --git a/webcit/paging.c b/webcit/paging.c index 7c632fb9f..38b8b541d 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -1,21 +1,15 @@ /* * This module handles instant message related functions. * - * Copyright (c) 1996-2010 by the citadel.org team + * Copyright (c) 1996-2012 by the citadel.org team * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "webcit.h" @@ -29,8 +23,8 @@ void display_page(void) strcpy(recp, bstr("recp")); - output_headers(1, 1, 2, 0, 0, 0); - wc_printf("
\n"); + output_headers(1, 1, 1, 0, 0, 0); + wc_printf("
\n"); wc_printf("

"); wc_printf(_("Send instant message")); wc_printf("

"); @@ -55,15 +49,15 @@ void display_page(void) wc_printf("\">\n"); wc_printf(_("Enter message text:")); - wc_printf("
"); + wc_printf("
"); wc_printf("\n"); - wc_printf("
\n"); + wc_printf("
\n"); wc_printf("", _("Send message")); - wc_printf("
\n", _("Cancel")); + wc_printf("
\n", _("Cancel")); wc_printf("\n"); wc_printf("\n"); @@ -76,32 +70,23 @@ void display_page(void) void page_user(void) { char recp[256]; - char buf[256]; + StrBuf *Line; safestrncpy(recp, bstr("recp"), sizeof recp); if (!havebstr("send_button")) { - safestrncpy(WC->ImportantMessage, - _("Message was not sent."), - sizeof WC->ImportantMessage - ); + AppendImportantMessage(_("Message was not sent."), -1); } else { + Line = NewStrBuf(); serv_printf("SEXP %s|-", recp); - serv_getln(buf, sizeof buf); - - if (buf[0] == '4') { + StrBuf_ServGetln(Line); + if (GetServerStatusMsg(Line, NULL, 0, 0) == 4) { + char buf[256]; text_to_server(bstr("msgtext")); serv_puts("000"); stresc(buf, 256, recp, 0, 0); - snprintf(WC->ImportantMessage, - sizeof WC->ImportantMessage, - "%s%s.", - _("Message has been sent to "), - buf - ); - } - else { - safestrncpy(WC->ImportantMessage, &buf[4], sizeof WC->ImportantMessage); + AppendImportantMessage(buf, -1); + AppendImportantMessage(_("Message has been sent to "), -1); } }