From ebc64e2caae8740dd047e5317de2172eb3f44fc3 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 30 Sep 2014 09:22:37 -0400 Subject: [PATCH] sys/time.h no longer needed on modern systems --- citadel/modules/xmpp/xmpp_messages.c | 12 +++----- citadel/modules/xmpp/xmpp_presence.c | 12 ++++---- citadel/modules/xmpp/xmpp_query_namespace.c | 32 ++++++++------------- webcit/configure.ac | 2 +- webcit/sysdep.c | 15 ++-------- webcit/webcit.h | 5 +--- 6 files changed, 26 insertions(+), 52 deletions(-) diff --git a/citadel/modules/xmpp/xmpp_messages.c b/citadel/modules/xmpp/xmpp_messages.c index b2e2dadf4..7992d4de4 100644 --- a/citadel/modules/xmpp/xmpp_messages.c +++ b/citadel/modules/xmpp/xmpp_messages.c @@ -1,22 +1,15 @@ /* * Handle messages sent and received using XMPP (Jabber) protocol * - * Copyright (c) 2007-2010 by Art Cancro + * Copyright (c) 2007-2014 by Art Cancro * * 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. - * - * - * - * - * */ #include "sysdep.h" @@ -125,8 +118,11 @@ void xmpp_send_message(char *message_to, char *message_body) { XMPP->message_to[0] = 0; time(&CCC->lastidle); } + + void xmpp_end_message(void *data, const char *supplied_el, const char **attr) { + safestrncpy(XMPP->message_to, ChrPtr(XMPP->Message.to), sizeof(XMPP->message_to)); xmpp_send_message(XMPP->message_to, XMPP->message_body); XMPP->html_tag_level = 0; } diff --git a/citadel/modules/xmpp/xmpp_presence.c b/citadel/modules/xmpp/xmpp_presence.c index 9191f8f65..053994a34 100644 --- a/citadel/modules/xmpp/xmpp_presence.c +++ b/citadel/modules/xmpp/xmpp_presence.c @@ -1,7 +1,7 @@ /* * Handle XMPP presence exchanges * - * Copyright (c) 2007-2010 by Art Cancro + * Copyright (c) 2007-2014 by Art Cancro * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,7 +58,6 @@ #include "serv_xmpp.h" - /* * Indicate the presence of another user to the client * (used in several places) @@ -66,13 +65,14 @@ void xmpp_indicate_presence(char *presence_jid) { XPrint(HKEY("presence"), - XPROPERTY("from", presence_jid, strlen(presence_jid)), - XPROPERTY("to", XMPP->client_jid, strlen(XMPP->client_jid)), - TYPE_ARGEND); + XCLOSED, + XPROPERTY("from", presence_jid, strlen(presence_jid)), + XPROPERTY("to", XMPP->client_jid, strlen(XMPP->client_jid)), + TYPE_ARGEND + ); } - /* * Convenience function to determine whether any given session is 'visible' to any other given session, * and is capable of receiving instant messages from that session. diff --git a/citadel/modules/xmpp/xmpp_query_namespace.c b/citadel/modules/xmpp/xmpp_query_namespace.c index e7fcc0c8a..82e60647e 100644 --- a/citadel/modules/xmpp/xmpp_query_namespace.c +++ b/citadel/modules/xmpp/xmpp_query_namespace.c @@ -1,21 +1,14 @@ /* * Handle type situations (namespace queries) * - * Copyright (c) 2007-2009 by Art Cancro + * Copyright (c) 2007-2014 by Art Cancro * - * 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. - * - * - * - * + * 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. */ #include "sysdep.h" @@ -61,13 +54,12 @@ */ void xmpp_roster_item(struct CitContext *cptr) { - struct CitContext *CCC=CC; - XPrint(HKEY("item"), 0, - XCPROPERTY("subscription", "both"), - XPROPERTY("jid", CCC->cs_inet_email, strlen(CCC->cs_inet_email)), - XPROPERTY("name", cptr->user.fullname, strlen(cptr->user.fullname)), - TYPE_ARGEND); + XCPROPERTY("subscription", "both"), + XPROPERTY("jid", cptr->cs_inet_email, strlen(cptr->cs_inet_email)), + XPROPERTY("name", cptr->user.fullname, strlen(cptr->user.fullname)), + TYPE_ARGEND + ); XPrint(HKEY("group"), XCLOSED, XCFGBODY(c_humannode), diff --git a/webcit/configure.ac b/webcit/configure.ac index 1bdca0631..f17cc5819 100644 --- a/webcit/configure.ac +++ b/webcit/configure.ac @@ -137,7 +137,7 @@ dnl AC_FUNC_VPRINTF AC_REPLACE_FUNCS(snprintf) AC_CHECK_HEADER(CUnit/CUnit.h, [AC_DEFINE(ENABLE_TESTS, [], [whether we should compile the test-suite])]) -AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h iconv.h xlocale.h) +AC_CHECK_HEADERS(fcntl.h limits.h unistd.h iconv.h xlocale.h) dnl Checks for the zlib compression library. saved_CFLAGS="$CFLAGS" diff --git a/webcit/sysdep.c b/webcit/sysdep.c index fb34a4cef..44878c757 100644 --- a/webcit/sysdep.c +++ b/webcit/sysdep.c @@ -1,7 +1,7 @@ /* * WebCit "system dependent" code. * - * Copyright (c) 1996-2012 by the citadel.org team + * Copyright (c) 1996-2014 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. @@ -25,18 +25,7 @@ #include #include #include - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - +#include #include #include #include diff --git a/webcit/webcit.h b/webcit/webcit.h index 6a8d03400..19fe3722d 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1987-2013 by the citadel.org team + * Copyright (c) 1987-2014 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. @@ -25,9 +25,6 @@ #include #include #include -#ifdef HAVE_SYS_TIME_H -#include -#endif #include #ifdef HAVE_LIMITS_H #include -- 2.30.2