From ccfce1854b9c2547d9b87ce07185d68b0df76d9e Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 30 Sep 2014 09:23:26 -0400 Subject: [PATCH] Revert "sys/time.h no longer needed on modern systems" This reverts commit ebc64e2caae8740dd047e5317de2172eb3f44fc3. --- 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, 52 insertions(+), 26 deletions(-) diff --git a/citadel/modules/xmpp/xmpp_messages.c b/citadel/modules/xmpp/xmpp_messages.c index 7992d4de4..b2e2dadf4 100644 --- a/citadel/modules/xmpp/xmpp_messages.c +++ b/citadel/modules/xmpp/xmpp_messages.c @@ -1,15 +1,22 @@ /* * Handle messages sent and received using XMPP (Jabber) protocol * - * Copyright (c) 2007-2014 by Art Cancro + * Copyright (c) 2007-2010 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" @@ -118,11 +125,8 @@ 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 053994a34..9191f8f65 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-2014 by Art Cancro + * Copyright (c) 2007-2010 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,6 +58,7 @@ #include "serv_xmpp.h" + /* * Indicate the presence of another user to the client * (used in several places) @@ -65,14 +66,13 @@ void xmpp_indicate_presence(char *presence_jid) { XPrint(HKEY("presence"), - XCLOSED, - XPROPERTY("from", presence_jid, strlen(presence_jid)), - XPROPERTY("to", XMPP->client_jid, strlen(XMPP->client_jid)), - TYPE_ARGEND - ); + 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 82e60647e..e7fcc0c8a 100644 --- a/citadel/modules/xmpp/xmpp_query_namespace.c +++ b/citadel/modules/xmpp/xmpp_query_namespace.c @@ -1,14 +1,21 @@ /* * Handle type situations (namespace queries) * - * Copyright (c) 2007-2014 by Art Cancro + * Copyright (c) 2007-2009 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" @@ -54,12 +61,13 @@ */ void xmpp_roster_item(struct CitContext *cptr) { + struct CitContext *CCC=CC; + XPrint(HKEY("item"), 0, - 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 - ); + 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); XPrint(HKEY("group"), XCLOSED, XCFGBODY(c_humannode), diff --git a/webcit/configure.ac b/webcit/configure.ac index f17cc5819..1bdca0631 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 unistd.h iconv.h xlocale.h) +AC_CHECK_HEADERS(fcntl.h limits.h sys/time.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 44878c757..fb34a4cef 100644 --- a/webcit/sysdep.c +++ b/webcit/sysdep.c @@ -1,7 +1,7 @@ /* * WebCit "system dependent" code. * - * Copyright (c) 1996-2014 by the citadel.org team + * Copyright (c) 1996-2012 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,7 +25,18 @@ #include #include #include -#include + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + #include #include #include diff --git a/webcit/webcit.h b/webcit/webcit.h index 19fe3722d..6a8d03400 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1987-2014 by the citadel.org team + * Copyright (c) 1987-2013 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,6 +25,9 @@ #include #include #include +#ifdef HAVE_SYS_TIME_H +#include +#endif #include #ifdef HAVE_LIMITS_H #include -- 2.30.2