diff --git a/Makefile.am b/Makefile.am index c3f487fc..0437c58f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,7 +11,7 @@ profanity_SOURCES = src/command.c src/contact.c src/history.c src/xmpp.h \ src/muc.h src/stanza.c src/stanza.h src/parser.c src/parser.h \ src/theme.c src/theme.h src/window.c src/window.h src/xdg_base.c \ src/xdg_base.h src/files.c src/files.h src/accounts.c src/accounts.h \ - src/jid.h src/jid.c src/capabilities.h src/capabilities.c src/xmpp_iq.c + src/jid.h src/jid.c src/xmpp_caps.c src/xmpp_iq.c TESTS = tests/testsuite check_PROGRAMS = tests/testsuite diff --git a/src/capabilities.h b/src/capabilities.h deleted file mode 100644 index 59b63730..00000000 --- a/src/capabilities.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * capabilities.h - * - * Copyright (C) 2012, 2013 James Booth - * - * This file is part of Profanity. - * - * Profanity 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. - * - * Profanity 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 Profanity. If not, see . - * - */ - -#ifndef CAPABILITIES_H -#define CAPABILITIES_H - -#include -#include - -typedef struct capabilities_t { - char *client; -} Capabilities; - -void caps_init(void); -void caps_add(const char * const caps_str, const char * const client); -gboolean caps_contains(const char * const caps_str); -Capabilities* caps_get(const char * const caps_str); -char* caps_create_sha1_str(xmpp_stanza_t * const query); -xmpp_stanza_t* caps_create_query_response_stanza(xmpp_ctx_t * const ctx); -void caps_close(void); - -#endif diff --git a/src/profanity.c b/src/profanity.c index 35998adf..9ee3775f 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -30,7 +30,6 @@ #include #include "accounts.h" -#include "capabilities.h" #include "chat_log.h" #include "chat_session.h" #include "command.h" diff --git a/src/windows.c b/src/windows.c index 01fe4b7a..290bf6a1 100644 --- a/src/windows.c +++ b/src/windows.c @@ -44,7 +44,6 @@ #include #endif -#include "capabilities.h" #include "chat_log.h" #include "chat_session.h" #include "command.h" diff --git a/src/xmpp.h b/src/xmpp.h index c10291e2..87bf41f8 100644 --- a/src/xmpp.h +++ b/src/xmpp.h @@ -55,6 +55,11 @@ typedef enum { #define JABBER_PRIORITY_MIN -128 #define JABBER_PRIORITY_MAX 127 +typedef struct capabilities_t { + char *client; +} Capabilities; + +// connection functions void jabber_init(const int disable_tls); jabber_conn_status_t jabber_connect_with_details(const char * const jid, const char * const passwd, const char * const altdomain); @@ -84,6 +89,16 @@ void jabber_free_resources(void); void jabber_restart(void); void jabber_set_autoping(int seconds); +// iq functions void iq_add_handlers(xmpp_conn_t * const conn, xmpp_ctx_t * const ctx); +// caps functions +void caps_init(void); +void caps_add(const char * const caps_str, const char * const client); +gboolean caps_contains(const char * const caps_str); +Capabilities* caps_get(const char * const caps_str); +char* caps_create_sha1_str(xmpp_stanza_t * const query); +xmpp_stanza_t* caps_create_query_response_stanza(xmpp_ctx_t * const ctx); +void caps_close(void); + #endif diff --git a/src/capabilities.c b/src/xmpp_caps.c similarity index 99% rename from src/capabilities.c rename to src/xmpp_caps.c index ec146554..ff3e044b 100644 --- a/src/capabilities.c +++ b/src/xmpp_caps.c @@ -1,5 +1,5 @@ /* - * capabilities.c + * xmpp_caps.c * * Copyright (C) 2012, 2013 James Booth * @@ -29,8 +29,8 @@ #include "config.h" #include "common.h" -#include "capabilities.h" #include "stanza.h" +#include "xmpp.h" static GHashTable *capabilities; diff --git a/src/xmpp_conn.c b/src/xmpp_conn.c index a1a751bd..c0dd7a61 100644 --- a/src/xmpp_conn.c +++ b/src/xmpp_conn.c @@ -26,7 +26,6 @@ #include -#include "capabilities.h" #include "chat_session.h" #include "common.h" #include "contact_list.h" diff --git a/src/xmpp_iq.c b/src/xmpp_iq.c index ec6482f4..a6329d96 100644 --- a/src/xmpp_iq.c +++ b/src/xmpp_iq.c @@ -25,7 +25,6 @@ #include -#include "capabilities.h" #include "common.h" #include "config.h" #include "contact_list.h"