From 3144440e07822224c1967203c77ca3ef0f419e43 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 20 Dec 2018 17:38:53 -0500 Subject: [PATCH] cosmetic cleanup of files in xmpp directory --- citadel/modules/xmpp/serv_xmpp.c | 12 +++++------- citadel/modules/xmpp/xmpp_messages.c | 8 +------- citadel/modules/xmpp/xmpp_presence.c | 8 -------- citadel/modules/xmpp/xmpp_query_namespace.c | 1 - citadel/modules/xmpp/xmpp_sasl_service.c | 10 +++++++--- 5 files changed, 13 insertions(+), 26 deletions(-) diff --git a/citadel/modules/xmpp/serv_xmpp.c b/citadel/modules/xmpp/serv_xmpp.c index 2bbfcff1f..07188c2e9 100644 --- a/citadel/modules/xmpp/serv_xmpp.c +++ b/citadel/modules/xmpp/serv_xmpp.c @@ -67,7 +67,6 @@ struct xmpp_event *xmpp_queue = NULL; - #ifdef HAVE_XML_STOPPARSER /* Stop the parser if an entity declaration is hit. */ static void xmpp_entity_declaration(void *userData, const XML_Char *entityName, @@ -92,17 +91,17 @@ static inline int Ctdl_GetUtf8SequenceLength(const char *CharS, const char *Char int n = 0; unsigned char test = (1<<7); - if ((*CharS & 0xC0) != 0xC0) + if ((*CharS & 0xC0) != 0xC0) { return 1; + } - while ((n < 8) && - ((test & ((unsigned char)*CharS)) != 0)) - { + while ((n < 8) && ((test & ((unsigned char)*CharS)) != 0)) { test = test >> 1; n ++; } - if ((n > 6) || ((CharE - CharS) < n)) + if ((n > 6) || ((CharE - CharS) < n)) { n = 0; + } return n; } @@ -299,7 +298,6 @@ void xmpp_xml_start(void *data, const char *supplied_el, const char **attr) { } - void xmpp_xml_end(void *data, const char *supplied_el) { char el[256]; char *sep = NULL; diff --git a/citadel/modules/xmpp/xmpp_messages.c b/citadel/modules/xmpp/xmpp_messages.c index 8b8b43f6b..4fa690b35 100644 --- a/citadel/modules/xmpp/xmpp_messages.c +++ b/citadel/modules/xmpp/xmpp_messages.c @@ -5,18 +5,11 @@ * * 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" @@ -89,6 +82,7 @@ void xmpp_output_incoming_messages(void) { } } + /* * Client is sending a message. */ diff --git a/citadel/modules/xmpp/xmpp_presence.c b/citadel/modules/xmpp/xmpp_presence.c index 2d4980784..fef997639 100644 --- a/citadel/modules/xmpp/xmpp_presence.c +++ b/citadel/modules/xmpp/xmpp_presence.c @@ -58,7 +58,6 @@ #include "serv_xmpp.h" - /* * Indicate the presence of another user to the client * (used in several places) @@ -73,7 +72,6 @@ void xmpp_indicate_presence(char *presence_jid) } - /* * 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. @@ -221,7 +219,6 @@ void xmpp_presence_notify(char *presence_jid, int event_type) { } - void xmpp_fetch_mortuary_backend(long msgnum, void *userdata) { HashList *mortuary = (HashList *) userdata; struct CtdlMessage *msg; @@ -261,7 +258,6 @@ void xmpp_fetch_mortuary_backend(long msgnum, void *userdata) { } - /* * Fetch the "mortuary" - a list of dead buddies which we keep around forever * so we can remove them from any client's roster that still has them listed @@ -284,7 +280,6 @@ HashList *xmpp_fetch_mortuary(void) { } - /* * Fetch the "mortuary" - a list of dead buddies which we keep around forever * so we can remove them from any client's roster that still has them listed @@ -318,7 +313,6 @@ void xmpp_store_mortuary(HashList *mortuary) { } - /* * Upon logout we make an attempt to delete the whole roster, in order to * try to keep "ghost" buddies from remaining in the client-side roster. @@ -352,7 +346,6 @@ void xmpp_massacre_roster(void) } - /* * Stupidly, XMPP does not specify a way to tell the client to flush its client-side roster * and prepare to receive a new one. So instead we remember every buddy we've ever told the @@ -399,4 +392,3 @@ void xmpp_delete_old_buddies_who_no_longer_exist_from_the_client_roster(void) DeleteHash(&mortuary); free(cptr); } - diff --git a/citadel/modules/xmpp/xmpp_query_namespace.c b/citadel/modules/xmpp/xmpp_query_namespace.c index 8016a6357..0a8c3b7a3 100644 --- a/citadel/modules/xmpp/xmpp_query_namespace.c +++ b/citadel/modules/xmpp/xmpp_query_namespace.c @@ -94,7 +94,6 @@ void xmpp_iq_roster_query(void) } - /* * Client is doing a namespace query. These are all handled differently. */ diff --git a/citadel/modules/xmpp/xmpp_sasl_service.c b/citadel/modules/xmpp/xmpp_sasl_service.c index 1b2e98ae9..a6a6734f7 100644 --- a/citadel/modules/xmpp/xmpp_sasl_service.c +++ b/citadel/modules/xmpp/xmpp_sasl_service.c @@ -119,6 +119,7 @@ void xmpp_output_auth_mechs(void) { cprintf(""); } + /* * Here we go ... client is trying to authenticate. */ @@ -131,7 +132,9 @@ void xmpp_sasl_auth(char *sasl_auth_mech, char *authstring) { return; } - if (CC->logged_in) CtdlUserLogout(); /* Client may try to log in twice. Handle this. */ + if (CC->logged_in) { + CtdlUserLogout(); /* Client may try to log in twice. Handle this. */ + } if (CC->nologin) { cprintf(""); @@ -151,7 +154,6 @@ void xmpp_sasl_auth(char *sasl_auth_mech, char *authstring) { } - /* * Non-SASL authentication */ @@ -159,7 +161,9 @@ void xmpp_non_sasl_authenticate(char *iq_id, char *username, char *password) { int result; char xmlbuf[256]; - if (CC->logged_in) CtdlUserLogout(); /* Client may try to log in twice. Handle this. */ + if (CC->logged_in) { + CtdlUserLogout(); /* Client may try to log in twice. Handle this. */ + } result = CtdlLoginExistingUser(username); if (result == login_ok) { -- 2.30.2