From 8d8f2f290d5d78d130d2db7c6fad90af2f031877 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 13:56:11 +0100 Subject: [PATCH 01/13] Moved chat state handling code to chat_state.c --- src/chat_state.c | 37 +++++++++++++++++++++++++++++++++++++ src/chat_state.h | 3 +++ src/event/client_events.h | 2 ++ src/profanity.c | 35 ----------------------------------- src/profanity.h | 5 ----- src/ui/inputwin.c | 5 +++-- 6 files changed, 45 insertions(+), 42 deletions(-) diff --git a/src/chat_state.c b/src/chat_state.c index b0e08fd5..cac73817 100644 --- a/src/chat_state.c +++ b/src/chat_state.c @@ -33,11 +33,14 @@ */ #include +#include #include #include "chat_state.h" #include "chat_session.h" +#include "window_list.h" +#include "ui/win_types.h" #include "xmpp/xmpp.h" #include "config/preferences.h" @@ -149,6 +152,40 @@ chat_state_gone(const char *const barejid, ChatState *state) } } +void +chat_state_idle(void) +{ + jabber_conn_status_t status = connection_get_status(); + if (status == JABBER_CONNECTED) { + GSList *recipients = wins_get_chat_recipients(); + GSList *curr = recipients; + + while (curr) { + char *barejid = curr->data; + ProfChatWin *chatwin = wins_get_chat(barejid); + chat_state_handle_idle(chatwin->barejid, chatwin->state); + curr = g_slist_next(curr); + } + + if (recipients) { + g_slist_free(recipients); + } + } +} + +void +chat_state_activity(void) +{ + jabber_conn_status_t status = connection_get_status(); + ProfWin *current = wins_get_current(); + + if ((status == JABBER_CONNECTED) && (current->type == WIN_CHAT)) { + ProfChatWin *chatwin = (ProfChatWin*)current; + assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK); + chat_state_handle_typing(chatwin->barejid, chatwin->state); + } +} + static void _send_if_supported(const char *const barejid, void (*send_func)(const char *const)) { diff --git a/src/chat_state.h b/src/chat_state.h index c9e8fa58..393598ba 100644 --- a/src/chat_state.h +++ b/src/chat_state.h @@ -53,6 +53,9 @@ typedef struct prof_chat_state_t { ChatState* chat_state_new(void); void chat_state_free(ChatState *state); +void chat_state_idle(void); +void chat_state_activity(void); + void chat_state_handle_idle(const char *const barejid, ChatState *state); void chat_state_handle_typing(const char *const barejid, ChatState *state); void chat_state_active(ChatState *state); diff --git a/src/event/client_events.h b/src/event/client_events.h index ffce00fd..39bb1372 100644 --- a/src/event/client_events.h +++ b/src/event/client_events.h @@ -35,6 +35,8 @@ #ifndef CLIENT_EVENTS_H #define CLIENT_EVENTS_H +#include "xmpp/xmpp.h" + jabber_conn_status_t cl_ev_connect_jid(const char *const jid, const char *const passwd, const char *const altdomain, const int port, const char *const tls_policy); jabber_conn_status_t cl_ev_connect_account(ProfAccount *account); diff --git a/src/profanity.c b/src/profanity.c index 950c28e9..f5540d3a 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -44,7 +44,6 @@ #include #include #include -#include #include @@ -145,40 +144,6 @@ prof_set_quit(void) force_quit = TRUE; } -void -prof_handle_idle(void) -{ - jabber_conn_status_t status = connection_get_status(); - if (status == JABBER_CONNECTED) { - GSList *recipients = wins_get_chat_recipients(); - GSList *curr = recipients; - - while (curr) { - char *barejid = curr->data; - ProfChatWin *chatwin = wins_get_chat(barejid); - chat_state_handle_idle(chatwin->barejid, chatwin->state); - curr = g_slist_next(curr); - } - - if (recipients) { - g_slist_free(recipients); - } - } -} - -void -prof_handle_activity(void) -{ - jabber_conn_status_t status = connection_get_status(); - ProfWin *current = wins_get_current(); - - if ((status == JABBER_CONNECTED) && (current->type == WIN_CHAT)) { - ProfChatWin *chatwin = (ProfChatWin*)current; - assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK); - chat_state_handle_typing(chatwin->barejid, chatwin->state); - } -} - static void _connect_default(const char *const account) { diff --git a/src/profanity.h b/src/profanity.h index ecc4cd13..ef1f2ea1 100644 --- a/src/profanity.h +++ b/src/profanity.h @@ -37,13 +37,8 @@ #include -#include "resource.h" -#include "xmpp/xmpp.h" - void prof_run(char *log_level, char *account_name); -void prof_handle_idle(void); -void prof_handle_activity(void); gboolean prof_process_input(char *inp); void prof_set_quit(void); diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index e8db673c..10035d37 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -54,6 +54,7 @@ #endif #include "command/cmd_ac.h" +#include "chat_state.h" #include "common.h" #include "config/accounts.h" #include "config/preferences.h" @@ -164,7 +165,7 @@ inp_readline(void) rl_line_buffer[0] != '/' && rl_line_buffer[0] != '\0' && rl_line_buffer[0] != '\n') { - prof_handle_activity(); + chat_state_activity(); } ui_reset_idle_time(); @@ -174,7 +175,7 @@ inp_readline(void) inp_nonblocking(TRUE); } else { inp_nonblocking(FALSE); - prof_handle_idle(); + chat_state_idle(); } if (inp_line) { From 0649aad80d9d76e793801e105e021a7175bb64a1 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 14:08:30 +0100 Subject: [PATCH 02/13] Move event timeout to connection module --- src/config/scripts.c | 2 +- src/profanity.c | 2 +- src/xmpp/connection.c | 8 +++++++- src/xmpp/connection.h | 1 + src/xmpp/session.c | 11 ++--------- src/xmpp/xmpp.h | 2 +- tests/unittests/xmpp/stub_xmpp.c | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/config/scripts.c b/src/config/scripts.c index d40c72a1..03ed6b99 100644 --- a/src/config/scripts.c +++ b/src/config/scripts.c @@ -159,7 +159,7 @@ scripts_exec(const char *const script) while ((read = getline(&line, &len, scriptfile)) != -1) { ProfWin *win = wins_get_current(); cmd_process_input(win, line); - session_process_events(10); + session_process_events(); ui_update(); } diff --git a/src/profanity.c b/src/profanity.c index f5540d3a..ed534d11 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -129,7 +129,7 @@ prof_run(char *log_level, char *account_name) #endif plugins_run_timed(); notify_remind(); - session_process_events(10); + session_process_events(); iq_autoping_check(); ui_update(); #ifdef HAVE_GTK diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index e9ad22b9..c590b7ba 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -90,6 +90,12 @@ connection_init(void) conn.available_resources = g_hash_table_new_full(g_str_hash, g_str_equal, free, (GDestroyNotify)resource_destroy); } +void +connection_check_events(void) +{ + xmpp_run_once(conn.xmpp_ctx, 10); +} + void connection_shutdown(void) { @@ -191,7 +197,7 @@ connection_disconnect(void) xmpp_disconnect(conn.xmpp_conn); while (conn.conn_status == JABBER_DISCONNECTING) { - session_process_events(10); + session_process_events(); } if (conn.xmpp_conn) { diff --git a/src/xmpp/connection.h b/src/xmpp/connection.h index b7250d14..ef997a29 100644 --- a/src/xmpp/connection.h +++ b/src/xmpp/connection.h @@ -39,6 +39,7 @@ void connection_init(void); void connection_shutdown(void); +void connection_check_events(void); jabber_conn_status_t connection_connect(const char *const fulljid, const char *const passwd, const char *const altdomain, int port, const char *const tls_policy); diff --git a/src/xmpp/session.c b/src/xmpp/session.c index faffe653..6dc94aef 100644 --- a/src/xmpp/session.c +++ b/src/xmpp/session.c @@ -38,13 +38,6 @@ #include #include -#ifdef HAVE_LIBMESODE -#include -#endif -#ifdef HAVE_LIBSTROPHE -#include -#endif - #include "chat_session.h" #include "common.h" #include "config/preferences.h" @@ -235,7 +228,7 @@ session_shutdown(void) } void -session_process_events(int millis) +session_process_events(void) { int reconnect_sec; @@ -245,7 +238,7 @@ session_process_events(int millis) case JABBER_CONNECTED: case JABBER_CONNECTING: case JABBER_DISCONNECTING: - xmpp_run_once(connection_get_ctx(), millis); + connection_check_events(); break; case JABBER_DISCONNECTED: reconnect_sec = prefs_get_reconnect(); diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index f9f8d409..b883c139 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -109,7 +109,7 @@ jabber_conn_status_t session_connect_with_details(const char *const jid, const c jabber_conn_status_t session_connect_with_account(const ProfAccount *const account); void session_disconnect(void); void session_shutdown(void); -void session_process_events(int millis); +void session_process_events(void); char* session_get_account_name(void); jabber_conn_status_t connection_get_status(void); diff --git a/tests/unittests/xmpp/stub_xmpp.c b/tests/unittests/xmpp/stub_xmpp.c index 6efcb783..064d002f 100644 --- a/tests/unittests/xmpp/stub_xmpp.c +++ b/tests/unittests/xmpp/stub_xmpp.c @@ -26,7 +26,7 @@ jabber_conn_status_t session_connect_with_account(const ProfAccount * const acco void session_disconnect(void) {} void session_shutdown(void) {} -void session_process_events(int millis) {} +void session_process_events(void) {} const char * connection_get_fulljid(void) { return (char *)mock(); From 25a6252a28d730126a9c20ba3172e2be285d794f Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 14:23:55 +0100 Subject: [PATCH 03/13] Moved chat_session.c --- Makefile.am | 8 ++++---- src/chat_state.c | 2 +- src/command/cmd_defs.c | 2 +- src/command/cmd_funcs.c | 2 +- src/event/client_events.c | 2 +- src/event/server_events.c | 2 +- src/otr/otr.c | 2 +- src/profanity.c | 2 +- src/ui/chatwin.c | 2 +- src/ui/core.c | 2 +- src/ui/titlebar.c | 2 +- src/{ => xmpp}/chat_session.c | 0 src/{ => xmpp}/chat_session.h | 4 ++-- tests/unittests/helpers.c | 2 +- tests/unittests/test_chat_session.c | 4 ++-- tests/unittests/test_cmd_disconnect.c | 2 +- tests/unittests/test_server_events.c | 2 +- tests/unittests/unittests.c | 2 +- 18 files changed, 22 insertions(+), 22 deletions(-) rename src/{ => xmpp}/chat_session.c (100%) rename src/{ => xmpp}/chat_session.h (97%) diff --git a/Makefile.am b/Makefile.am index bcd964a1..2491ee6d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,8 @@ core_sources = \ src/contact.c src/contact.h src/log.c src/common.c \ src/log.h src/profanity.c src/common.h \ - src/profanity.h src/chat_session.c \ - src/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \ + src/profanity.h src/xmpp/chat_session.c \ + src/xmpp/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \ src/chat_state.h src/chat_state.c \ src/resource.c src/resource.h \ src/roster_list.c src/roster_list.h \ @@ -59,8 +59,8 @@ core_sources = \ unittest_sources = \ src/contact.c src/contact.h src/common.c \ src/log.h src/profanity.c src/common.h \ - src/profanity.h src/chat_session.c \ - src/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \ + src/profanity.h src/xmpp/chat_session.c \ + src/xmpp/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \ src/resource.c src/resource.h \ src/chat_state.h src/chat_state.c \ src/roster_list.c src/roster_list.h \ diff --git a/src/chat_state.c b/src/chat_state.c index cac73817..836d313f 100644 --- a/src/chat_state.c +++ b/src/chat_state.c @@ -38,7 +38,7 @@ #include #include "chat_state.h" -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "window_list.h" #include "ui/win_types.h" #include "xmpp/xmpp.h" diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 34f840ed..9f1f31ff 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -48,7 +48,7 @@ #include -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "command/cmd_defs.h" #include "command/cmd_funcs.h" #include "command/cmd_ac.h" diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 65982541..8d1d27a9 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -49,7 +49,7 @@ #include #include -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "command/cmd_funcs.h" #include "command/cmd_defs.h" #include "command/cmd_ac.h" diff --git a/src/event/client_events.c b/src/event/client_events.c index 65843c44..ebbdd1ed 100644 --- a/src/event/client_events.c +++ b/src/event/client_events.c @@ -42,7 +42,7 @@ #include "window_list.h" #include "xmpp/xmpp.h" #include "roster_list.h" -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "plugins/plugins.h" #ifdef HAVE_LIBOTR #include "otr/otr.h" diff --git a/src/event/server_events.c b/src/event/server_events.c index c73bcbdd..0d511836 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -38,7 +38,7 @@ #include #include -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "log.h" #include "muc.h" #include "config/preferences.h" diff --git a/src/otr/otr.c b/src/otr/otr.c index b3ce4e5f..c9769d35 100644 --- a/src/otr/otr.c +++ b/src/otr/otr.c @@ -47,7 +47,7 @@ #include "ui/ui.h" #include "xmpp/xmpp.h" #include "config/preferences.h" -#include "chat_session.h" +#include "xmpp/chat_session.h" #define PRESENCE_ONLINE 1 #define PRESENCE_OFFLINE 0 diff --git a/src/profanity.c b/src/profanity.c index ed534d11..5799568c 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -48,7 +48,7 @@ #include #include "profanity.h" -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "chat_state.h" #include "config/accounts.h" #include "config/preferences.h" diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index 25df09c4..b1de9489 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -38,7 +38,7 @@ #include #include -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "window_list.h" #include "roster_list.h" #include "log.h" diff --git a/src/ui/core.c b/src/ui/core.c index df759ca6..9ee3c4c3 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -54,7 +54,7 @@ #include #endif -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "command/cmd_defs.h" #include "command/cmd_ac.h" #include "common.h" diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c index a2817698..3381f99e 100644 --- a/src/ui/titlebar.c +++ b/src/ui/titlebar.c @@ -47,7 +47,7 @@ #include "window_list.h" #include "ui/window.h" #include "roster_list.h" -#include "chat_session.h" +#include "xmpp/chat_session.h" static WINDOW *win; static contact_presence_t current_presence; diff --git a/src/chat_session.c b/src/xmpp/chat_session.c similarity index 100% rename from src/chat_session.c rename to src/xmpp/chat_session.c diff --git a/src/chat_session.h b/src/xmpp/chat_session.h similarity index 97% rename from src/chat_session.h rename to src/xmpp/chat_session.h index 604d2319..705799a1 100644 --- a/src/chat_session.h +++ b/src/xmpp/chat_session.h @@ -32,8 +32,8 @@ * */ -#ifndef CHAT_SESSION_H -#define CHAT_SESSION_H +#ifndef XMPP_CHAT_SESSION_H +#define XMPP_CHAT_SESSION_H #include diff --git a/tests/unittests/helpers.c b/tests/unittests/helpers.c index 9cabb1e4..1494d803 100644 --- a/tests/unittests/helpers.c +++ b/tests/unittests/helpers.c @@ -10,7 +10,7 @@ #include "common.h" #include "helpers.h" #include "config/preferences.h" -#include "chat_session.h" +#include "xmpp/chat_session.h" void create_config_dir(void **state) { diff --git a/tests/unittests/test_chat_session.c b/tests/unittests/test_chat_session.c index b5e1f7b6..fd934737 100644 --- a/tests/unittests/test_chat_session.c +++ b/tests/unittests/test_chat_session.c @@ -5,7 +5,7 @@ #include #include -#include "chat_session.h" +#include "xmpp/chat_session.h" void returns_false_when_chat_session_does_not_exist(void **state) { @@ -48,4 +48,4 @@ void removes_chat_session(void **state) ChatSession *session = chat_session_get(barejid); assert_null(session); -} \ No newline at end of file +} diff --git a/tests/unittests/test_cmd_disconnect.c b/tests/unittests/test_cmd_disconnect.c index 9bf78a7a..bfd81b48 100644 --- a/tests/unittests/test_cmd_disconnect.c +++ b/tests/unittests/test_cmd_disconnect.c @@ -5,7 +5,7 @@ #include #include -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "command/cmd_funcs.h" #include "xmpp/xmpp.h" #include "roster_list.h" diff --git a/tests/unittests/test_server_events.c b/tests/unittests/test_server_events.c index b565dd9f..a5ef365e 100644 --- a/tests/unittests/test_server_events.c +++ b/tests/unittests/test_server_events.c @@ -8,7 +8,7 @@ #include "event/server_events.h" #include "roster_list.h" -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "config/preferences.h" #include "ui/ui.h" #include "ui/stub_ui.h" diff --git a/tests/unittests/unittests.c b/tests/unittests/unittests.c index 91fb3cb2..ea479a94 100644 --- a/tests/unittests/unittests.c +++ b/tests/unittests/unittests.c @@ -8,7 +8,7 @@ #include #include "config.h" -#include "chat_session.h" +#include "xmpp/chat_session.h" #include "helpers.h" #include "test_autocomplete.h" #include "test_chat_session.h" From 310abd401d9706cb633308cfa2c78317c720d417 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 14:28:25 +0100 Subject: [PATCH 04/13] Moved chat_state.c --- Makefile.am | 4 ++-- src/profanity.c | 2 +- src/ui/inputwin.c | 2 +- src/ui/win_types.h | 2 +- src/ui/window.h | 2 +- src/{ => xmpp}/chat_state.c | 0 src/{ => xmpp}/chat_state.h | 0 7 files changed, 6 insertions(+), 6 deletions(-) rename src/{ => xmpp}/chat_state.c (100%) rename src/{ => xmpp}/chat_state.h (100%) diff --git a/Makefile.am b/Makefile.am index 2491ee6d..6311cef6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ core_sources = \ src/log.h src/profanity.c src/common.h \ src/profanity.h src/xmpp/chat_session.c \ src/xmpp/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \ - src/chat_state.h src/chat_state.c \ + src/xmpp/chat_state.h src/xmpp/chat_state.c \ src/resource.c src/resource.h \ src/roster_list.c src/roster_list.h \ src/xmpp/xmpp.h src/xmpp/capabilities.c src/xmpp/session.c \ @@ -62,7 +62,7 @@ unittest_sources = \ src/profanity.h src/xmpp/chat_session.c \ src/xmpp/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \ src/resource.c src/resource.h \ - src/chat_state.h src/chat_state.c \ + src/xmpp/chat_state.h src/xmpp/chat_state.c \ src/roster_list.c src/roster_list.h \ src/xmpp/xmpp.h src/xmpp/form.c \ src/ui/ui.h \ diff --git a/src/profanity.c b/src/profanity.c index 5799568c..383753e3 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -49,7 +49,7 @@ #include "profanity.h" #include "xmpp/chat_session.h" -#include "chat_state.h" +#include "xmpp/chat_state.h" #include "config/accounts.h" #include "config/preferences.h" #include "config/theme.h" diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 10035d37..65e33c9f 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -54,7 +54,7 @@ #endif #include "command/cmd_ac.h" -#include "chat_state.h" +#include "xmpp/chat_state.h" #include "common.h" #include "config/accounts.h" #include "config/preferences.h" diff --git a/src/ui/win_types.h b/src/ui/win_types.h index e06e4cc6..b523ef2f 100644 --- a/src/ui/win_types.h +++ b/src/ui/win_types.h @@ -46,7 +46,7 @@ #endif #include "ui/buffer.h" -#include "chat_state.h" +#include "xmpp/chat_state.h" #include "tools/autocomplete.h" #define LAYOUT_SPLIT_MEMCHECK 12345671 diff --git a/src/ui/window.h b/src/ui/window.h index b3b86570..6faacb46 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -44,7 +44,7 @@ #include "ui/ui.h" #include "ui/buffer.h" #include "xmpp/xmpp.h" -#include "chat_state.h" +#include "xmpp/chat_state.h" #ifdef HAVE_NCURSESW_NCURSES_H #include diff --git a/src/chat_state.c b/src/xmpp/chat_state.c similarity index 100% rename from src/chat_state.c rename to src/xmpp/chat_state.c diff --git a/src/chat_state.h b/src/xmpp/chat_state.h similarity index 100% rename from src/chat_state.h rename to src/xmpp/chat_state.h From 9cff37352a0200dbe0acb1b6a9e5810ee33743ea Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 14:51:39 +0100 Subject: [PATCH 05/13] Make header defines consistent --- src/command/cmd_ac.h | 4 ++-- src/command/cmd_defs.h | 4 ++-- src/command/cmd_funcs.h | 4 ++-- src/config/account.h | 4 ++-- src/config/accounts.h | 4 ++-- src/config/conflists.h | 5 +++++ src/config/preferences.h | 4 ++-- src/config/scripts.h | 5 +++++ src/config/theme.h | 4 ++-- src/config/tlscerts.h | 4 ++-- src/event/client_events.h | 4 ++-- src/event/server_events.h | 4 ++-- src/otr/otr.h | 4 ++-- src/otr/otrlib.h | 4 ++-- src/pgp/gpg.h | 4 ++-- src/plugins/api.h | 4 ++-- src/plugins/autocompleters.h | 4 ++-- src/plugins/c_api.h | 5 +++++ src/plugins/c_plugins.h | 4 ++-- src/plugins/callbacks.h | 4 ++-- src/plugins/disco.h | 4 ++-- src/plugins/plugins.h | 4 ++-- src/plugins/profapi.h | 4 ++-- src/plugins/python_api.h | 4 ++-- src/plugins/python_plugins.h | 4 ++-- src/plugins/settings.h | 4 ++-- src/plugins/themes.h | 4 ++-- src/tools/autocomplete.h | 4 ++-- src/tools/parser.h | 4 ++-- src/tools/tinyurl.h | 4 ++-- src/tray.h | 4 ++-- src/xmpp/chat_state.h | 4 ++-- src/xmpp/form.h | 4 ++-- 33 files changed, 75 insertions(+), 60 deletions(-) diff --git a/src/command/cmd_ac.h b/src/command/cmd_ac.h index 79b1806c..bdfd8b80 100644 --- a/src/command/cmd_ac.h +++ b/src/command/cmd_ac.h @@ -32,8 +32,8 @@ * */ -#ifndef CMD_AC_H -#define CMD_AC_H +#ifndef COMMAND_CMD_AC_H +#define COMMAND_CMD_AC_H #include "config/preferences.h" #include "command/cmd_funcs.h" diff --git a/src/command/cmd_defs.h b/src/command/cmd_defs.h index 3d4f3fad..3f07693b 100644 --- a/src/command/cmd_defs.h +++ b/src/command/cmd_defs.h @@ -32,8 +32,8 @@ * */ -#ifndef CMD_DEFS_H -#define CMD_DEFS_H +#ifndef COMMAND_CMD_DEFS_H +#define COMMAND_CMD_DEFS_H #include diff --git a/src/command/cmd_funcs.h b/src/command/cmd_funcs.h index c91fd9c6..4d0f4a86 100644 --- a/src/command/cmd_funcs.h +++ b/src/command/cmd_funcs.h @@ -32,8 +32,8 @@ * */ -#ifndef CMD_FUNCS_H -#define CMD_FUNCS_H +#ifndef COMMAND_CMD_FUNCS_H +#define COMMAND_CMD_FUNCS_H #include "ui/win_types.h" diff --git a/src/config/account.h b/src/config/account.h index e268d77d..09166752 100644 --- a/src/config/account.h +++ b/src/config/account.h @@ -32,8 +32,8 @@ * */ -#ifndef ACCOUNT_H -#define ACCOUNT_H +#ifndef CONFIG_ACCOUNT_H +#define CONFIG_ACCOUNT_H #include "common.h" diff --git a/src/config/accounts.h b/src/config/accounts.h index 4bc8fc14..7524c65e 100644 --- a/src/config/accounts.h +++ b/src/config/accounts.h @@ -32,8 +32,8 @@ * */ -#ifndef ACCOUNTS_H -#define ACCOUNTS_H +#ifndef CONFIG_ACCOUNTS_H +#define CONFIG_ACCOUNTS_H #define MAX_PASSWORD_SIZE 64 diff --git a/src/config/conflists.h b/src/config/conflists.h index d1f3f211..5fb280e1 100644 --- a/src/config/conflists.h +++ b/src/config/conflists.h @@ -32,9 +32,14 @@ * */ +#ifndef CONFIG_CONFLISTS_H +#define CONFIG_CONFLISTS_H + #include gboolean conf_string_list_add(GKeyFile *keyfile, const char *const group, const char *const key, const char *const item); gboolean conf_string_list_remove(GKeyFile *keyfile, const char *const group, const char *const key, const char *const item); + +#endif diff --git a/src/config/preferences.h b/src/config/preferences.h index 5174d076..621b1760 100644 --- a/src/config/preferences.h +++ b/src/config/preferences.h @@ -32,8 +32,8 @@ * */ -#ifndef PREFERENCES_H -#define PREFERENCES_H +#ifndef CONFIG_PREFERENCES_H +#define CONFIG_PREFERENCES_H #include "config.h" diff --git a/src/config/scripts.h b/src/config/scripts.h index de4bde69..aa2ba3d7 100644 --- a/src/config/scripts.h +++ b/src/config/scripts.h @@ -32,9 +32,14 @@ * */ +#ifndef CONFIG_SCRIPTS_H +#define CONFIG_SCRIPTS_H + #include void scripts_init(void); GSList* scripts_list(void); GSList* scripts_read(const char *const script); gboolean scripts_exec(const char *const script); + +#endif diff --git a/src/config/theme.h b/src/config/theme.h index 20868ffc..c8e740b2 100644 --- a/src/config/theme.h +++ b/src/config/theme.h @@ -32,8 +32,8 @@ * */ -#ifndef THEME_H -#define THEME_H +#ifndef CONFIG_THEME_H +#define CONFIG_THEME_H #include "config.h" diff --git a/src/config/tlscerts.h b/src/config/tlscerts.h index 8e9bdfa4..0001fc28 100644 --- a/src/config/tlscerts.h +++ b/src/config/tlscerts.h @@ -32,8 +32,8 @@ * */ -#ifndef TLSCERTS_H -#define TLSCERTS_H +#ifndef CONFIG_TLSCERTS_H +#define CONFIG_TLSCERTS_H typedef struct tls_cert_t { int version; diff --git a/src/event/client_events.h b/src/event/client_events.h index 39bb1372..876a0d54 100644 --- a/src/event/client_events.h +++ b/src/event/client_events.h @@ -32,8 +32,8 @@ * */ -#ifndef CLIENT_EVENTS_H -#define CLIENT_EVENTS_H +#ifndef EVENT_CLIENT_EVENTS_H +#define EVENT_CLIENT_EVENTS_H #include "xmpp/xmpp.h" diff --git a/src/event/server_events.h b/src/event/server_events.h index ace049ad..7f60c3a5 100644 --- a/src/event/server_events.h +++ b/src/event/server_events.h @@ -32,8 +32,8 @@ * */ -#ifndef SERVER_EVENTS_H -#define SERVER_EVENTS_H +#ifndef EVENT_SERVER_EVENTS_H +#define EVENT_SERVER_EVENTS_H #include "xmpp/xmpp.h" diff --git a/src/otr/otr.h b/src/otr/otr.h index be8af6d4..0853f4fc 100644 --- a/src/otr/otr.h +++ b/src/otr/otr.h @@ -32,8 +32,8 @@ * */ -#ifndef OTR_H -#define OTR_H +#ifndef OTR_OTR_H +#define OTR_OTR_H #include #include diff --git a/src/otr/otrlib.h b/src/otr/otrlib.h index b669ee20..1031f8c1 100644 --- a/src/otr/otrlib.h +++ b/src/otr/otrlib.h @@ -32,8 +32,8 @@ * */ -#ifndef OTRLIB_H -#define OTRLIB_H +#ifndef OTR_OTRLIB_H +#define OTR_OTRLIB_H OtrlPolicy otrlib_policy(void); diff --git a/src/pgp/gpg.h b/src/pgp/gpg.h index e2616b98..038578ef 100644 --- a/src/pgp/gpg.h +++ b/src/pgp/gpg.h @@ -32,8 +32,8 @@ * */ -#ifndef GPG_H -#define GPG_H +#ifndef PGP_GPG_H +#define PGP_GPG_H typedef struct pgp_key_t { char *id; diff --git a/src/plugins/api.h b/src/plugins/api.h index 126facb5..db1417cf 100644 --- a/src/plugins/api.h +++ b/src/plugins/api.h @@ -32,8 +32,8 @@ * */ -#ifndef API_H -#define API_H +#ifndef PLUGINS_API_H +#define PLUGINS_API_H #include "plugins/callbacks.h" diff --git a/src/plugins/autocompleters.h b/src/plugins/autocompleters.h index 08b06962..15580514 100644 --- a/src/plugins/autocompleters.h +++ b/src/plugins/autocompleters.h @@ -32,8 +32,8 @@ * */ -#ifndef AUTOCOMPLETERS_H -#define AUTOCOMPLETERS_H +#ifndef PLUGINS_AUTOCOMPLETERS_H +#define PLUGINS_AUTOCOMPLETERS_H #include diff --git a/src/plugins/c_api.h b/src/plugins/c_api.h index 2f541e2f..40281fcf 100644 --- a/src/plugins/c_api.h +++ b/src/plugins/c_api.h @@ -32,6 +32,9 @@ * */ +#ifndef PLUGINS_C_API_H +#define PLUGINS_C_API_H + #include void c_api_init(void); @@ -39,3 +42,5 @@ void c_api_init(void); void c_command_callback(PluginCommand *command, gchar **args); void c_timed_callback(PluginTimedFunction *timed_function); void c_window_callback(PluginWindowCallback *window_callback, char *tag, char *line); + +#endif diff --git a/src/plugins/c_plugins.h b/src/plugins/c_plugins.h index a042fbc1..80c3ffe7 100644 --- a/src/plugins/c_plugins.h +++ b/src/plugins/c_plugins.h @@ -32,8 +32,8 @@ * */ -#ifndef C_PLUGINS_H -#define C_PLUGINS_H +#ifndef PLUGINS_C_PLUGINS_H +#define PLUGINS_C_PLUGINS_H #include "plugins/plugins.h" diff --git a/src/plugins/callbacks.h b/src/plugins/callbacks.h index 8620e47b..4fea2151 100644 --- a/src/plugins/callbacks.h +++ b/src/plugins/callbacks.h @@ -32,8 +32,8 @@ * */ -#ifndef CALLBACKS_H -#define CALLBACKS_H +#ifndef PLUGINS_CALLBACKS_H +#define PLUGINS_CALLBACKS_H #include diff --git a/src/plugins/disco.h b/src/plugins/disco.h index 2f7799ab..0fb3f628 100644 --- a/src/plugins/disco.h +++ b/src/plugins/disco.h @@ -32,8 +32,8 @@ * */ -#ifndef DISCO_H -#define DISCO_H +#ifndef PLUGINS_DISCO_H +#define PLUGINS_DISCO_H void disco_add_feature(char *feature); GList* disco_get_features(void); diff --git a/src/plugins/plugins.h b/src/plugins/plugins.h index c5cc56c2..4a324a5f 100644 --- a/src/plugins/plugins.h +++ b/src/plugins/plugins.h @@ -32,8 +32,8 @@ * */ -#ifndef PLUGINS_H -#define PLUGINS_H +#ifndef PLUGINS_PLUGINS_H +#define PLUGINS_PLUGINS_H #include "command/cmd_defs.h" diff --git a/src/plugins/profapi.h b/src/plugins/profapi.h index cde726f7..1e2e8b01 100644 --- a/src/plugins/profapi.h +++ b/src/plugins/profapi.h @@ -32,8 +32,8 @@ * */ -#ifndef PROF_API_H -#define PROF_API_H +#ifndef PLUGINS_PROF_API_H +#define PLUGINS_PROF_API_H #define prof_register_command(command_name, min_args, max_args, synopsis, description, arguments, examples, callback) _prof_register_command(__FILE__, command_name, min_args, max_args, synopsis, description, arguments, examples, callback) #define prof_register_timed(callback, interval_seconds) _prof_register_timed(__FILE__, callback, interval_seconds) diff --git a/src/plugins/python_api.h b/src/plugins/python_api.h index 27c17a3d..335821d0 100644 --- a/src/plugins/python_api.h +++ b/src/plugins/python_api.h @@ -32,8 +32,8 @@ * */ -#ifndef PYTHON_API_H -#define PYTHON_API_H +#ifndef PLUGINS_PYTHON_API_H +#define PLUGINS_PYTHON_API_H void python_env_init(void); void python_init_prof(void); diff --git a/src/plugins/python_plugins.h b/src/plugins/python_plugins.h index dda73405..f0ac48a5 100644 --- a/src/plugins/python_plugins.h +++ b/src/plugins/python_plugins.h @@ -32,8 +32,8 @@ * */ -#ifndef PYTHON_PLUGINS_H -#define PYTHON_PLUGINS_H +#ifndef PLUGINS_PYTHON_PLUGINS_H +#define PLUGINS_PYTHON_PLUGINS_H #include "plugins/plugins.h" diff --git a/src/plugins/settings.h b/src/plugins/settings.h index 2c91b0c9..09913243 100644 --- a/src/plugins/settings.h +++ b/src/plugins/settings.h @@ -32,8 +32,8 @@ * */ -#ifndef PLUGIN_SETTINGS_H -#define PLUGIN_SETTINGS_H +#ifndef PLUGINS_SETTINGS_H +#define PLUGINS_SETTINGS_H void plugin_settings_init(void); void plugin_settings_close(void); diff --git a/src/plugins/themes.h b/src/plugins/themes.h index 9c3c4a8c..398eb9e3 100644 --- a/src/plugins/themes.h +++ b/src/plugins/themes.h @@ -32,8 +32,8 @@ * */ -#ifndef PLUGIN_THEMES_H -#define PLUGIN_THEMES_H +#ifndef PLUGINS_THEMES_H +#define PLUGINS_THEMES_H void plugin_themes_init(void); void plugin_themes_close(void); diff --git a/src/tools/autocomplete.h b/src/tools/autocomplete.h index 72652b5b..7c2a2f4a 100644 --- a/src/tools/autocomplete.h +++ b/src/tools/autocomplete.h @@ -32,8 +32,8 @@ * */ -#ifndef AUTOCOMPLETE_H -#define AUTOCOMPLETE_H +#ifndef TOOLS_AUTOCOMPLETE_H +#define TOOLS_AUTOCOMPLETE_H #include diff --git a/src/tools/parser.h b/src/tools/parser.h index babc874e..b5ce5383 100644 --- a/src/tools/parser.h +++ b/src/tools/parser.h @@ -32,8 +32,8 @@ * */ -#ifndef PARSER_H -#define PARSER_H +#ifndef TOOLS_PARSER_H +#define TOOLS_PARSER_H #include diff --git a/src/tools/tinyurl.h b/src/tools/tinyurl.h index 62acfeab..e30d9773 100644 --- a/src/tools/tinyurl.h +++ b/src/tools/tinyurl.h @@ -32,8 +32,8 @@ * */ -#ifndef TINYURL_H -#define TINYURL_H +#ifndef TOOLS_TINYURL_H +#define TOOLS_TINYURL_H #include diff --git a/src/tray.h b/src/tray.h index 76173cfe..1f8f13d8 100644 --- a/src/tray.h +++ b/src/tray.h @@ -32,8 +32,8 @@ * */ -#ifndef PROFANITY_TRAY_H -#define PROFANITY_TRAY_H +#ifndef TRAY_H +#define TRAY_H void tray_init(void); void tray_update(void); diff --git a/src/xmpp/chat_state.h b/src/xmpp/chat_state.h index 393598ba..8fcfabf5 100644 --- a/src/xmpp/chat_state.h +++ b/src/xmpp/chat_state.h @@ -32,8 +32,8 @@ * */ -#ifndef CHAT_STATE_H -#define CHAT_STATE_H +#ifndef XMPP_CHAT_STATE_H +#define XMPP_CHAT_STATE_H #include diff --git a/src/xmpp/form.h b/src/xmpp/form.h index 8ae8e75a..f9740d68 100644 --- a/src/xmpp/form.h +++ b/src/xmpp/form.h @@ -32,8 +32,8 @@ * */ -#ifndef FORM_H -#define FORM_H +#ifndef XMPP_FORM_H +#define XMPP_FORM_H #include "xmpp/xmpp.h" From c23506f453c36c9133d1f176624541ef84385ced Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 14:55:32 +0100 Subject: [PATCH 06/13] Moved contact.c --- Makefile.am | 4 ++-- src/command/cmd_defs.c | 2 +- src/command/cmd_funcs.c | 2 +- src/muc.c | 2 +- src/muc.h | 2 +- src/otr/otr.c | 2 +- src/profanity.c | 2 +- src/roster_list.c | 2 +- src/roster_list.h | 2 +- src/ui/core.c | 2 +- src/ui/rosterwin.c | 2 +- src/ui/window.h | 2 +- src/{ => xmpp}/contact.c | 0 src/{ => xmpp}/contact.h | 4 ++-- tests/unittests/test_autocomplete.c | 2 +- tests/unittests/test_contact.c | 2 +- tests/unittests/test_roster_list.c | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) rename src/{ => xmpp}/contact.c (100%) rename src/{ => xmpp}/contact.h (98%) diff --git a/Makefile.am b/Makefile.am index 6311cef6..263161a2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ core_sources = \ - src/contact.c src/contact.h src/log.c src/common.c \ + src/xmpp/contact.c src/xmpp/contact.h src/log.c src/common.c \ src/log.h src/profanity.c src/common.h \ src/profanity.h src/xmpp/chat_session.c \ src/xmpp/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \ @@ -57,7 +57,7 @@ core_sources = \ src/tray.h src/tray.c unittest_sources = \ - src/contact.c src/contact.h src/common.c \ + src/xmpp/contact.c src/xmpp/contact.h src/common.c \ src/log.h src/profanity.c src/common.h \ src/profanity.h src/xmpp/chat_session.c \ src/xmpp/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \ diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 9f1f31ff..d390a64a 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -58,7 +58,7 @@ #include "config/theme.h" #include "config/tlscerts.h" #include "config/scripts.h" -#include "contact.h" +#include "xmpp/contact.h" #include "roster_list.h" #include "jid.h" #include "log.h" diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 8d1d27a9..f661e6a9 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -60,7 +60,7 @@ #include "config/theme.h" #include "config/tlscerts.h" #include "config/scripts.h" -#include "contact.h" +#include "xmpp/contact.h" #include "roster_list.h" #include "jid.h" #include "log.h" diff --git a/src/muc.c b/src/muc.c index 3cab42ec..642e71f4 100644 --- a/src/muc.c +++ b/src/muc.c @@ -38,7 +38,7 @@ #include -#include "contact.h" +#include "xmpp/contact.h" #include "common.h" #include "jid.h" #include "tools/autocomplete.h" diff --git a/src/muc.h b/src/muc.h index f93a0908..a2482fd9 100644 --- a/src/muc.h +++ b/src/muc.h @@ -37,7 +37,7 @@ #include -#include "contact.h" +#include "xmpp/contact.h" #include "jid.h" #include "tools/autocomplete.h" #include "ui/win_types.h" diff --git a/src/otr/otr.c b/src/otr/otr.c index c9769d35..2ece01f3 100644 --- a/src/otr/otr.c +++ b/src/otr/otr.c @@ -43,7 +43,7 @@ #include "log.h" #include "roster_list.h" #include "window_list.h" -#include "contact.h" +#include "xmpp/contact.h" #include "ui/ui.h" #include "xmpp/xmpp.h" #include "config/preferences.h" diff --git a/src/profanity.c b/src/profanity.c index 383753e3..057fbf84 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -56,7 +56,7 @@ #include "config/scripts.h" #include "command/cmd_defs.h" #include "common.h" -#include "contact.h" +#include "xmpp/contact.h" #include "roster_list.h" #include "config/tlscerts.h" #include "log.h" diff --git a/src/roster_list.c b/src/roster_list.c index a78ff066..4044a09e 100644 --- a/src/roster_list.c +++ b/src/roster_list.c @@ -41,7 +41,7 @@ #include "roster_list.h" #include "resource.h" -#include "contact.h" +#include "xmpp/contact.h" #include "jid.h" #include "tools/autocomplete.h" #include "config/preferences.h" diff --git a/src/roster_list.h b/src/roster_list.h index 59945353..1b695b76 100644 --- a/src/roster_list.h +++ b/src/roster_list.h @@ -38,7 +38,7 @@ #include #include "resource.h" -#include "contact.h" +#include "xmpp/contact.h" typedef enum { ROSTER_ORD_NAME, diff --git a/src/ui/core.c b/src/ui/core.c index 9ee3c4c3..a1b14904 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -60,7 +60,7 @@ #include "common.h" #include "config/preferences.h" #include "config/theme.h" -#include "contact.h" +#include "xmpp/contact.h" #include "roster_list.h" #include "jid.h" #include "log.h" diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c index d75e2186..c8c0ae52 100644 --- a/src/ui/rosterwin.c +++ b/src/ui/rosterwin.c @@ -36,7 +36,7 @@ #include #include -#include "contact.h" +#include "xmpp/contact.h" #include "ui/ui.h" #include "ui/window.h" #include "window_list.h" diff --git a/src/ui/window.h b/src/ui/window.h index 6faacb46..3334c708 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -39,7 +39,7 @@ #include -#include "contact.h" +#include "xmpp/contact.h" #include "muc.h" #include "ui/ui.h" #include "ui/buffer.h" diff --git a/src/contact.c b/src/xmpp/contact.c similarity index 100% rename from src/contact.c rename to src/xmpp/contact.c diff --git a/src/contact.h b/src/xmpp/contact.h similarity index 98% rename from src/contact.h rename to src/xmpp/contact.h index 14122b40..6a13d01e 100644 --- a/src/contact.h +++ b/src/xmpp/contact.h @@ -32,8 +32,8 @@ * */ -#ifndef CONTACT_H -#define CONTACT_H +#ifndef XMPP_CONTACT_H +#define XMPP_CONTACT_H #include "resource.h" #include "tools/autocomplete.h" diff --git a/tests/unittests/test_autocomplete.c b/tests/unittests/test_autocomplete.c index f6ef8653..2fd68b51 100644 --- a/tests/unittests/test_autocomplete.c +++ b/tests/unittests/test_autocomplete.c @@ -5,7 +5,7 @@ #include #include -#include "contact.h" +#include "xmpp/contact.h" #include "tools/autocomplete.h" void clear_empty(void **state) diff --git a/tests/unittests/test_contact.c b/tests/unittests/test_contact.c index cad88907..127ca5cf 100644 --- a/tests/unittests/test_contact.c +++ b/tests/unittests/test_contact.c @@ -6,7 +6,7 @@ #include #include -#include "contact.h" +#include "xmpp/contact.h" void contact_in_group(void **state) { diff --git a/tests/unittests/test_roster_list.c b/tests/unittests/test_roster_list.c index 9df23495..4056c8ea 100644 --- a/tests/unittests/test_roster_list.c +++ b/tests/unittests/test_roster_list.c @@ -6,7 +6,7 @@ #include #include -#include "contact.h" +#include "xmpp/contact.h" #include "roster_list.h" void empty_list_when_none_added(void **state) From 1c5efaeb58f40122e6c860a6785c0b99496af8d6 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 14:59:28 +0100 Subject: [PATCH 07/13] Moved jid.c --- Makefile.am | 4 ++-- src/command/cmd_defs.c | 2 +- src/command/cmd_funcs.c | 2 +- src/config/account.c | 2 +- src/config/accounts.c | 2 +- src/muc.c | 2 +- src/muc.h | 2 +- src/roster_list.c | 2 +- src/ui/core.c | 2 +- src/{ => xmpp}/jid.c | 0 src/{ => xmpp}/jid.h | 4 ++-- tests/unittests/test_jid.c | 4 ++-- 12 files changed, 14 insertions(+), 14 deletions(-) rename src/{ => xmpp}/jid.c (100%) rename src/{ => xmpp}/jid.h (98%) diff --git a/Makefile.am b/Makefile.am index 263161a2..cbfe82c5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ core_sources = \ src/xmpp/contact.c src/xmpp/contact.h src/log.c src/common.c \ src/log.h src/profanity.c src/common.h \ src/profanity.h src/xmpp/chat_session.c \ - src/xmpp/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \ + src/xmpp/chat_session.h src/muc.c src/muc.h src/xmpp/jid.h src/xmpp/jid.c \ src/xmpp/chat_state.h src/xmpp/chat_state.c \ src/resource.c src/resource.h \ src/roster_list.c src/roster_list.h \ @@ -60,7 +60,7 @@ unittest_sources = \ src/xmpp/contact.c src/xmpp/contact.h src/common.c \ src/log.h src/profanity.c src/common.h \ src/profanity.h src/xmpp/chat_session.c \ - src/xmpp/chat_session.h src/muc.c src/muc.h src/jid.h src/jid.c \ + src/xmpp/chat_session.h src/muc.c src/muc.h src/xmpp/jid.h src/xmpp/jid.c \ src/resource.c src/resource.h \ src/xmpp/chat_state.h src/xmpp/chat_state.c \ src/roster_list.c src/roster_list.h \ diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index d390a64a..852a3cf8 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -60,7 +60,7 @@ #include "config/scripts.h" #include "xmpp/contact.h" #include "roster_list.h" -#include "jid.h" +#include "xmpp/jid.h" #include "log.h" #include "muc.h" #include "plugins/plugins.h" diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index f661e6a9..b9f9cb14 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -62,7 +62,7 @@ #include "config/scripts.h" #include "xmpp/contact.h" #include "roster_list.h" -#include "jid.h" +#include "xmpp/jid.h" #include "log.h" #include "muc.h" #ifdef HAVE_LIBOTR diff --git a/src/config/account.c b/src/config/account.c index 14751081..0a2c9132 100644 --- a/src/config/account.c +++ b/src/config/account.c @@ -38,7 +38,7 @@ #include -#include "jid.h" +#include "xmpp/jid.h" #include "config/account.h" #include "common.h" #include "log.h" diff --git a/src/config/accounts.c b/src/config/accounts.c index aa3dfbb0..c504b5d3 100644 --- a/src/config/accounts.c +++ b/src/config/accounts.c @@ -43,7 +43,7 @@ #include "common.h" #include "config/account.h" #include "config/conflists.h" -#include "jid.h" +#include "xmpp/jid.h" #include "log.h" #include "tools/autocomplete.h" #include "xmpp/xmpp.h" diff --git a/src/muc.c b/src/muc.c index 642e71f4..884ddd34 100644 --- a/src/muc.c +++ b/src/muc.c @@ -40,7 +40,7 @@ #include "xmpp/contact.h" #include "common.h" -#include "jid.h" +#include "xmpp/jid.h" #include "tools/autocomplete.h" #include "ui/ui.h" #include "window_list.h" diff --git a/src/muc.h b/src/muc.h index a2482fd9..7bacb18d 100644 --- a/src/muc.h +++ b/src/muc.h @@ -38,7 +38,7 @@ #include #include "xmpp/contact.h" -#include "jid.h" +#include "xmpp/jid.h" #include "tools/autocomplete.h" #include "ui/win_types.h" diff --git a/src/roster_list.c b/src/roster_list.c index 4044a09e..816eed27 100644 --- a/src/roster_list.c +++ b/src/roster_list.c @@ -42,7 +42,7 @@ #include "roster_list.h" #include "resource.h" #include "xmpp/contact.h" -#include "jid.h" +#include "xmpp/jid.h" #include "tools/autocomplete.h" #include "config/preferences.h" diff --git a/src/ui/core.c b/src/ui/core.c index a1b14904..d90d1aa6 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -62,7 +62,7 @@ #include "config/theme.h" #include "xmpp/contact.h" #include "roster_list.h" -#include "jid.h" +#include "xmpp/jid.h" #include "log.h" #include "muc.h" #ifdef HAVE_LIBOTR diff --git a/src/jid.c b/src/xmpp/jid.c similarity index 100% rename from src/jid.c rename to src/xmpp/jid.c diff --git a/src/jid.h b/src/xmpp/jid.h similarity index 98% rename from src/jid.h rename to src/xmpp/jid.h index d74a6d3f..d82c3add 100644 --- a/src/jid.h +++ b/src/xmpp/jid.h @@ -32,8 +32,8 @@ * */ -#ifndef JID_H -#define JID_H +#ifndef XMPP_JID_H +#define XMPP_JID_H #include diff --git a/tests/unittests/test_jid.c b/tests/unittests/test_jid.c index ff5f4c9a..b7f6ea22 100644 --- a/tests/unittests/test_jid.c +++ b/tests/unittests/test_jid.c @@ -4,7 +4,7 @@ #include #include -#include "jid.h" +#include "xmpp/jid.h" void create_jid_from_null_returns_null(void **state) { @@ -182,4 +182,4 @@ void returns_barejid_when_fulljid_not_exists(void **state) char *result = jid_fulljid_or_barejid(jid); assert_string_equal("localpart@domainpart", result); -} \ No newline at end of file +} From 2af0d38e3d9b766ec1fd1bd85edd899d01047a2b Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 15:02:43 +0100 Subject: [PATCH 08/13] Moved muc.c --- Makefile.am | 4 ++-- src/command/cmd_ac.c | 2 +- src/command/cmd_defs.c | 2 +- src/command/cmd_funcs.c | 2 +- src/event/server_events.c | 2 +- src/profanity.c | 2 +- src/ui/console.c | 2 +- src/ui/core.c | 2 +- src/ui/inputwin.c | 2 +- src/ui/notifier.c | 2 +- src/ui/ui.h | 2 +- src/ui/window.h | 2 +- src/{ => xmpp}/muc.c | 0 src/{ => xmpp}/muc.h | 4 ++-- tests/unittests/test_cmd_bookmark.c | 2 +- tests/unittests/test_cmd_join.c | 2 +- tests/unittests/test_muc.c | 2 +- tests/unittests/test_server_events.c | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) rename src/{ => xmpp}/muc.c (100%) rename src/{ => xmpp}/muc.h (99%) diff --git a/Makefile.am b/Makefile.am index cbfe82c5..36af73cd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ core_sources = \ src/xmpp/contact.c src/xmpp/contact.h src/log.c src/common.c \ src/log.h src/profanity.c src/common.h \ src/profanity.h src/xmpp/chat_session.c \ - src/xmpp/chat_session.h src/muc.c src/muc.h src/xmpp/jid.h src/xmpp/jid.c \ + src/xmpp/chat_session.h src/xmpp/muc.c src/xmpp/muc.h src/xmpp/jid.h src/xmpp/jid.c \ src/xmpp/chat_state.h src/xmpp/chat_state.c \ src/resource.c src/resource.h \ src/roster_list.c src/roster_list.h \ @@ -60,7 +60,7 @@ unittest_sources = \ src/xmpp/contact.c src/xmpp/contact.h src/common.c \ src/log.h src/profanity.c src/common.h \ src/profanity.h src/xmpp/chat_session.c \ - src/xmpp/chat_session.h src/muc.c src/muc.h src/xmpp/jid.h src/xmpp/jid.c \ + src/xmpp/chat_session.h src/xmpp/muc.c src/xmpp/muc.h src/xmpp/jid.h src/xmpp/jid.c \ src/resource.c src/resource.h \ src/xmpp/chat_state.h src/xmpp/chat_state.c \ src/roster_list.c src/roster_list.h \ diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index 69e350bc..2c8c02dd 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -46,7 +46,7 @@ #include "command/cmd_funcs.h" #include "config/preferences.h" #include "config/scripts.h" -#include "muc.h" +#include "xmpp/muc.h" #include "xmpp/xmpp.h" #include "roster_list.h" #include "window_list.h" diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 852a3cf8..5ade93e3 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -62,7 +62,7 @@ #include "roster_list.h" #include "xmpp/jid.h" #include "log.h" -#include "muc.h" +#include "xmpp/muc.h" #include "plugins/plugins.h" #include "profanity.h" #include "tools/autocomplete.h" diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index b9f9cb14..d7f4c8dc 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -64,7 +64,7 @@ #include "roster_list.h" #include "xmpp/jid.h" #include "log.h" -#include "muc.h" +#include "xmpp/muc.h" #ifdef HAVE_LIBOTR #include "otr/otr.h" #endif diff --git a/src/event/server_events.c b/src/event/server_events.c index 0d511836..a12e5a37 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -40,7 +40,7 @@ #include "xmpp/chat_session.h" #include "log.h" -#include "muc.h" +#include "xmpp/muc.h" #include "config/preferences.h" #include "config/account.h" #include "config/scripts.h" diff --git a/src/profanity.c b/src/profanity.c index 057fbf84..8dec09cf 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -60,7 +60,7 @@ #include "roster_list.h" #include "config/tlscerts.h" #include "log.h" -#include "muc.h" +#include "xmpp/muc.h" #include "plugins/plugins.h" #ifdef HAVE_LIBOTR #include "otr/otr.h" diff --git a/src/ui/console.c b/src/ui/console.c index 3e987dbe..182e365f 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -46,7 +46,7 @@ #include "command/cmd_defs.h" #include "common.h" #include "log.h" -#include "muc.h" +#include "xmpp/muc.h" #include "roster_list.h" #include "config/preferences.h" #include "config/theme.h" diff --git a/src/ui/core.c b/src/ui/core.c index d90d1aa6..cef4cc22 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -64,7 +64,7 @@ #include "roster_list.h" #include "xmpp/jid.h" #include "log.h" -#include "muc.h" +#include "xmpp/muc.h" #ifdef HAVE_LIBOTR #include "otr/otr.h" #endif diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 65e33c9f..4cd8f3e1 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -60,7 +60,7 @@ #include "config/preferences.h" #include "config/theme.h" #include "log.h" -#include "muc.h" +#include "xmpp/muc.h" #include "profanity.h" #include "roster_list.h" #include "ui/ui.h" diff --git a/src/ui/notifier.c b/src/ui/notifier.c index 355c06c2..f992729a 100644 --- a/src/ui/notifier.c +++ b/src/ui/notifier.c @@ -46,7 +46,7 @@ #endif #include "log.h" -#include "muc.h" +#include "xmpp/muc.h" #include "ui/ui.h" #include "window_list.h" #include "config/preferences.h" diff --git a/src/ui/ui.h b/src/ui/ui.h index 65209659..3e4292c9 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -39,7 +39,7 @@ #include "command/cmd_funcs.h" #include "ui/win_types.h" -#include "muc.h" +#include "xmpp/muc.h" #include "config/tlscerts.h" #include "config/account.h" #ifdef HAVE_LIBOTR diff --git a/src/ui/window.h b/src/ui/window.h index 3334c708..c570e6c7 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -40,7 +40,7 @@ #include #include "xmpp/contact.h" -#include "muc.h" +#include "xmpp/muc.h" #include "ui/ui.h" #include "ui/buffer.h" #include "xmpp/xmpp.h" diff --git a/src/muc.c b/src/xmpp/muc.c similarity index 100% rename from src/muc.c rename to src/xmpp/muc.c diff --git a/src/muc.h b/src/xmpp/muc.h similarity index 99% rename from src/muc.h rename to src/xmpp/muc.h index 7bacb18d..b5d9a38b 100644 --- a/src/muc.h +++ b/src/xmpp/muc.h @@ -32,8 +32,8 @@ * */ -#ifndef MUC_H -#define MUC_H +#ifndef XMPP_MUC_H +#define XMPP_MUC_H #include diff --git a/tests/unittests/test_cmd_bookmark.c b/tests/unittests/test_cmd_bookmark.c index 5b17c6e0..f7a2cc4b 100644 --- a/tests/unittests/test_cmd_bookmark.c +++ b/tests/unittests/test_cmd_bookmark.c @@ -11,7 +11,7 @@ #include "ui/ui.h" #include "ui/stub_ui.h" -#include "muc.h" +#include "xmpp/muc.h" #include "common.h" #include "command/cmd_funcs.h" diff --git a/tests/unittests/test_cmd_join.c b/tests/unittests/test_cmd_join.c index 709b4145..dc24a009 100644 --- a/tests/unittests/test_cmd_join.c +++ b/tests/unittests/test_cmd_join.c @@ -14,7 +14,7 @@ #include "config/accounts.h" #include "command/cmd_funcs.h" -#include "muc.h" +#include "xmpp/muc.h" #define CMD_JOIN "/join" diff --git a/tests/unittests/test_muc.c b/tests/unittests/test_muc.c index e3b7f9b0..888ce039 100644 --- a/tests/unittests/test_muc.c +++ b/tests/unittests/test_muc.c @@ -4,7 +4,7 @@ #include #include -#include "muc.h" +#include "xmpp/muc.h" void muc_before_test(void **state) { diff --git a/tests/unittests/test_server_events.c b/tests/unittests/test_server_events.c index a5ef365e..86f8515e 100644 --- a/tests/unittests/test_server_events.c +++ b/tests/unittests/test_server_events.c @@ -12,7 +12,7 @@ #include "config/preferences.h" #include "ui/ui.h" #include "ui/stub_ui.h" -#include "muc.h" +#include "xmpp/muc.h" void console_shows_online_presence_when_set_online(void **state) { From cc32bb773811cbdc098f27ce32cb389e6a0163a9 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 15:05:24 +0100 Subject: [PATCH 09/13] Moved resource.c --- Makefile.am | 4 ++-- src/profanity.c | 2 +- src/roster_list.c | 2 +- src/roster_list.h | 2 +- src/{ => xmpp}/resource.c | 4 ++-- src/{ => xmpp}/resource.h | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) rename src/{ => xmpp}/resource.c (98%) rename src/{ => xmpp}/resource.h (97%) diff --git a/Makefile.am b/Makefile.am index 36af73cd..30184358 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ core_sources = \ src/profanity.h src/xmpp/chat_session.c \ src/xmpp/chat_session.h src/xmpp/muc.c src/xmpp/muc.h src/xmpp/jid.h src/xmpp/jid.c \ src/xmpp/chat_state.h src/xmpp/chat_state.c \ - src/resource.c src/resource.h \ + src/xmpp/resource.c src/xmpp/resource.h \ src/roster_list.c src/roster_list.h \ src/xmpp/xmpp.h src/xmpp/capabilities.c src/xmpp/session.c \ src/xmpp/connection.h src/xmpp/connection.c \ @@ -61,7 +61,7 @@ unittest_sources = \ src/log.h src/profanity.c src/common.h \ src/profanity.h src/xmpp/chat_session.c \ src/xmpp/chat_session.h src/xmpp/muc.c src/xmpp/muc.h src/xmpp/jid.h src/xmpp/jid.c \ - src/resource.c src/resource.h \ + src/xmpp/resource.c src/xmpp/resource.h \ src/xmpp/chat_state.h src/xmpp/chat_state.c \ src/roster_list.c src/roster_list.h \ src/xmpp/xmpp.h src/xmpp/form.c \ diff --git a/src/profanity.c b/src/profanity.c index 8dec09cf..5955ae72 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -68,7 +68,7 @@ #ifdef HAVE_LIBGPGME #include "pgp/gpg.h" #endif -#include "resource.h" +#include "xmpp/resource.h" #include "xmpp/xmpp.h" #include "ui/ui.h" #include "window_list.h" diff --git a/src/roster_list.c b/src/roster_list.c index 816eed27..789449c2 100644 --- a/src/roster_list.c +++ b/src/roster_list.c @@ -40,7 +40,7 @@ #include #include "roster_list.h" -#include "resource.h" +#include "xmpp/resource.h" #include "xmpp/contact.h" #include "xmpp/jid.h" #include "tools/autocomplete.h" diff --git a/src/roster_list.h b/src/roster_list.h index 1b695b76..70dd540f 100644 --- a/src/roster_list.h +++ b/src/roster_list.h @@ -37,7 +37,7 @@ #include -#include "resource.h" +#include "xmpp/resource.h" #include "xmpp/contact.h" typedef enum { diff --git a/src/resource.c b/src/xmpp/resource.c similarity index 98% rename from src/resource.c rename to src/xmpp/resource.c index 2c448882..6e6bc5f0 100644 --- a/src/resource.c +++ b/src/xmpp/resource.c @@ -36,8 +36,8 @@ #include #include -#include -#include +#include "common.h" +#include "xmpp/resource.h" Resource* resource_new(const char *const name, resource_presence_t presence, const char *const status, const int priority) diff --git a/src/resource.h b/src/xmpp/resource.h similarity index 97% rename from src/resource.h rename to src/xmpp/resource.h index c7b00c6a..22681013 100644 --- a/src/resource.h +++ b/src/xmpp/resource.h @@ -32,8 +32,8 @@ * */ -#ifndef RESOURCE_H -#define RESOURCE_H +#ifndef XMPP_RESOURCE_H +#define XMPP_RESOURCE_H #include "common.h" From 90b9b48ab957f72aba9db664104ec04df986877e Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 15:08:47 +0100 Subject: [PATCH 10/13] Moved roster_list.c --- Makefile.am | 4 ++-- src/command/cmd_ac.c | 2 +- src/command/cmd_defs.c | 2 +- src/command/cmd_funcs.c | 2 +- src/event/client_events.c | 2 +- src/event/server_events.c | 2 +- src/otr/otr.c | 2 +- src/profanity.c | 2 +- src/ui/chatwin.c | 2 +- src/ui/console.c | 2 +- src/ui/core.c | 2 +- src/ui/inputwin.c | 2 +- src/ui/rosterwin.c | 2 +- src/ui/titlebar.c | 2 +- src/ui/window.c | 2 +- src/window_list.c | 2 +- src/{ => xmpp}/roster_list.c | 0 src/{ => xmpp}/roster_list.h | 4 ++-- tests/unittests/test_cmd_disconnect.c | 2 +- tests/unittests/test_cmd_roster.c | 2 +- tests/unittests/test_roster_list.c | 2 +- tests/unittests/test_server_events.c | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) rename src/{ => xmpp}/roster_list.c (100%) rename src/{ => xmpp}/roster_list.h (98%) diff --git a/Makefile.am b/Makefile.am index 30184358..ea90905b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ core_sources = \ src/xmpp/chat_session.h src/xmpp/muc.c src/xmpp/muc.h src/xmpp/jid.h src/xmpp/jid.c \ src/xmpp/chat_state.h src/xmpp/chat_state.c \ src/xmpp/resource.c src/xmpp/resource.h \ - src/roster_list.c src/roster_list.h \ + src/xmpp/roster_list.c src/xmpp/roster_list.h \ src/xmpp/xmpp.h src/xmpp/capabilities.c src/xmpp/session.c \ src/xmpp/connection.h src/xmpp/connection.c \ src/xmpp/iq.c src/xmpp/message.c src/xmpp/presence.c src/xmpp/stanza.c \ @@ -63,7 +63,7 @@ unittest_sources = \ src/xmpp/chat_session.h src/xmpp/muc.c src/xmpp/muc.h src/xmpp/jid.h src/xmpp/jid.c \ src/xmpp/resource.c src/xmpp/resource.h \ src/xmpp/chat_state.h src/xmpp/chat_state.c \ - src/roster_list.c src/roster_list.h \ + src/xmpp/roster_list.c src/xmpp/roster_list.h \ src/xmpp/xmpp.h src/xmpp/form.c \ src/ui/ui.h \ src/otr/otr.h \ diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index 2c8c02dd..20993a5b 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -48,7 +48,7 @@ #include "config/scripts.h" #include "xmpp/muc.h" #include "xmpp/xmpp.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "window_list.h" #include "plugins/plugins.h" #include "command/cmd_ac.h" diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 5ade93e3..8babde06 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -59,7 +59,7 @@ #include "config/tlscerts.h" #include "config/scripts.h" #include "xmpp/contact.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "xmpp/jid.h" #include "log.h" #include "xmpp/muc.h" diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index d7f4c8dc..fbcd944b 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -61,7 +61,7 @@ #include "config/tlscerts.h" #include "config/scripts.h" #include "xmpp/contact.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "xmpp/jid.h" #include "log.h" #include "xmpp/muc.h" diff --git a/src/event/client_events.c b/src/event/client_events.c index ebbdd1ed..0107d496 100644 --- a/src/event/client_events.c +++ b/src/event/client_events.c @@ -41,7 +41,7 @@ #include "ui/ui.h" #include "window_list.h" #include "xmpp/xmpp.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "xmpp/chat_session.h" #include "plugins/plugins.h" #ifdef HAVE_LIBOTR diff --git a/src/event/server_events.c b/src/event/server_events.c index a12e5a37..090a0fca 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -44,7 +44,7 @@ #include "config/preferences.h" #include "config/account.h" #include "config/scripts.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "plugins/plugins.h" #include "window_list.h" #include "config/tlscerts.h" diff --git a/src/otr/otr.c b/src/otr/otr.c index 2ece01f3..bcf64e66 100644 --- a/src/otr/otr.c +++ b/src/otr/otr.c @@ -41,7 +41,7 @@ #include "otr/otr.h" #include "otr/otrlib.h" #include "log.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "window_list.h" #include "xmpp/contact.h" #include "ui/ui.h" diff --git a/src/profanity.c b/src/profanity.c index 5955ae72..691f39d7 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -57,7 +57,7 @@ #include "command/cmd_defs.h" #include "common.h" #include "xmpp/contact.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "config/tlscerts.h" #include "log.h" #include "xmpp/muc.h" diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index b1de9489..ca428821 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -40,7 +40,7 @@ #include "xmpp/chat_session.h" #include "window_list.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "log.h" #include "config/preferences.h" #include "ui/ui.h" diff --git a/src/ui/console.c b/src/ui/console.c index 182e365f..3122b2d6 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -47,7 +47,7 @@ #include "common.h" #include "log.h" #include "xmpp/muc.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "config/preferences.h" #include "config/theme.h" #include "ui/window.h" diff --git a/src/ui/core.c b/src/ui/core.c index cef4cc22..cca836f7 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -61,7 +61,7 @@ #include "config/preferences.h" #include "config/theme.h" #include "xmpp/contact.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "xmpp/jid.h" #include "log.h" #include "xmpp/muc.h" diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 4cd8f3e1..1f5c69cc 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -62,7 +62,7 @@ #include "log.h" #include "xmpp/muc.h" #include "profanity.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "ui/ui.h" #include "ui/statusbar.h" #include "ui/inputwin.h" diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c index c8c0ae52..06d34894 100644 --- a/src/ui/rosterwin.c +++ b/src/ui/rosterwin.c @@ -41,7 +41,7 @@ #include "ui/window.h" #include "window_list.h" #include "config/preferences.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" typedef enum { ROSTER_CONTACT, diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c index 3381f99e..67764221 100644 --- a/src/ui/titlebar.c +++ b/src/ui/titlebar.c @@ -46,7 +46,7 @@ #include "ui/inputwin.h" #include "window_list.h" #include "ui/window.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "xmpp/chat_session.h" static WINDOW *win; diff --git a/src/ui/window.c b/src/ui/window.c index 9e641dcd..9b210972 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -49,7 +49,7 @@ #include "config/theme.h" #include "config/preferences.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "ui/ui.h" #include "ui/window.h" #include "xmpp/xmpp.h" diff --git a/src/window_list.c b/src/window_list.c index 2d4de286..1e5ff426 100644 --- a/src/window_list.c +++ b/src/window_list.c @@ -41,7 +41,7 @@ #include #include "common.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "config/theme.h" #include "ui/ui.h" #include "ui/statusbar.h" diff --git a/src/roster_list.c b/src/xmpp/roster_list.c similarity index 100% rename from src/roster_list.c rename to src/xmpp/roster_list.c diff --git a/src/roster_list.h b/src/xmpp/roster_list.h similarity index 98% rename from src/roster_list.h rename to src/xmpp/roster_list.h index 70dd540f..843c2546 100644 --- a/src/roster_list.h +++ b/src/xmpp/roster_list.h @@ -32,8 +32,8 @@ * */ -#ifndef ROSTER_LIST_H -#define ROSTER_LIST_H +#ifndef XMPP_ROSTER_LIST_H +#define XMPP_ROSTER_LIST_H #include diff --git a/tests/unittests/test_cmd_disconnect.c b/tests/unittests/test_cmd_disconnect.c index bfd81b48..f5813fdb 100644 --- a/tests/unittests/test_cmd_disconnect.c +++ b/tests/unittests/test_cmd_disconnect.c @@ -8,7 +8,7 @@ #include "xmpp/chat_session.h" #include "command/cmd_funcs.h" #include "xmpp/xmpp.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "ui/stub_ui.h" diff --git a/tests/unittests/test_cmd_roster.c b/tests/unittests/test_cmd_roster.c index 6628147d..ecd9b2e2 100644 --- a/tests/unittests/test_cmd_roster.c +++ b/tests/unittests/test_cmd_roster.c @@ -10,7 +10,7 @@ #include "ui/stub_ui.h" #include "xmpp/xmpp.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "command/cmd_funcs.h" #define CMD_ROSTER "/roster" diff --git a/tests/unittests/test_roster_list.c b/tests/unittests/test_roster_list.c index 4056c8ea..c2c63a6b 100644 --- a/tests/unittests/test_roster_list.c +++ b/tests/unittests/test_roster_list.c @@ -7,7 +7,7 @@ #include #include "xmpp/contact.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" void empty_list_when_none_added(void **state) { diff --git a/tests/unittests/test_server_events.c b/tests/unittests/test_server_events.c index 86f8515e..9ab54cdb 100644 --- a/tests/unittests/test_server_events.c +++ b/tests/unittests/test_server_events.c @@ -7,7 +7,7 @@ #include #include "event/server_events.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "xmpp/chat_session.h" #include "config/preferences.h" #include "ui/ui.h" From 8f213f22e7a9ec761e6f6fd77bd8e582ba7c7280 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 15:10:58 +0100 Subject: [PATCH 11/13] Moved tray.c --- Makefile.am | 4 ++-- src/command/cmd_funcs.c | 2 +- src/profanity.c | 2 +- src/{ => ui}/tray.c | 0 src/{ => ui}/tray.h | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) rename src/{ => ui}/tray.c (100%) rename src/{ => ui}/tray.h (98%) diff --git a/Makefile.am b/Makefile.am index ea90905b..3a281c97 100644 --- a/Makefile.am +++ b/Makefile.am @@ -54,7 +54,7 @@ core_sources = \ src/plugins/themes.c src/plugins/themes.h \ src/plugins/settings.c src/plugins/settings.h \ src/plugins/disco.c src/plugins/disco.h \ - src/tray.h src/tray.c + src/ui/tray.h src/ui/tray.c unittest_sources = \ src/xmpp/contact.c src/xmpp/contact.h src/common.c \ @@ -93,7 +93,7 @@ unittest_sources = \ src/window_list.c src/window_list.h \ src/event/server_events.c src/event/server_events.h \ src/event/client_events.c src/event/client_events.h \ - src/tray.h src/tray.c \ + src/ui/tray.h src/ui/tray.c \ tests/unittests/xmpp/stub_xmpp.c \ tests/unittests/ui/stub_ui.c \ tests/unittests/log/stub_log.c \ diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index fbcd944b..b65c33f1 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -81,7 +81,7 @@ #include "window_list.h" #include "event/client_events.h" #ifdef HAVE_GTK -#include "tray.h" +#include "ui/tray.h" #endif #include "tools/http_upload.h" #ifdef HAVE_PYTHON diff --git a/src/profanity.c b/src/profanity.c index 691f39d7..456cae3b 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -38,7 +38,7 @@ #endif #ifdef HAVE_GTK -#include "tray.h" +#include "ui/tray.h" #endif #include #include diff --git a/src/tray.c b/src/ui/tray.c similarity index 100% rename from src/tray.c rename to src/ui/tray.c diff --git a/src/tray.h b/src/ui/tray.h similarity index 98% rename from src/tray.h rename to src/ui/tray.h index 1f8f13d8..f33176e7 100644 --- a/src/tray.h +++ b/src/ui/tray.h @@ -32,8 +32,8 @@ * */ -#ifndef TRAY_H -#define TRAY_H +#ifndef UI_TRAY_H +#define UI_TRAY_H void tray_init(void); void tray_update(void); From 5bc38b6bc2bdf135d7f483c204ce75a51a7126b5 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 15:14:46 +0100 Subject: [PATCH 12/13] Moved window_list.c --- Makefile.am | 4 ++-- src/command/cmd_ac.c | 2 +- src/command/cmd_defs.c | 2 +- src/command/cmd_funcs.c | 2 +- src/config/scripts.c | 2 +- src/event/client_events.c | 2 +- src/event/server_events.c | 2 +- src/otr/otr.c | 2 +- src/otr/otrlibv4.c | 2 +- src/plugins/api.c | 2 +- src/plugins/callbacks.c | 2 +- src/profanity.c | 2 +- src/{ => ui}/window_list.c | 0 src/{ => ui}/window_list.h | 4 ++-- src/xmpp/chat_state.c | 2 +- src/xmpp/iq.c | 2 +- src/xmpp/muc.c | 2 +- tests/unittests/test_cmd_otr.c | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) rename src/{ => ui}/window_list.c (100%) rename src/{ => ui}/window_list.h (98%) diff --git a/Makefile.am b/Makefile.am index 3a281c97..55723688 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ core_sources = \ src/ui/titlebar.h src/ui/statusbar.h src/ui/inputwin.h \ src/ui/console.c src/ui/notifier.c \ src/ui/win_types.h \ - src/window_list.c src/window_list.h \ + src/ui/window_list.c src/ui/window_list.h \ src/ui/rosterwin.c src/ui/occupantswin.c \ src/ui/buffer.c src/ui/buffer.h \ src/ui/chatwin.c \ @@ -90,7 +90,7 @@ unittest_sources = \ src/plugins/themes.c src/plugins/themes.h \ src/plugins/settings.c src/plugins/settings.h \ src/plugins/disco.c src/plugins/disco.h \ - src/window_list.c src/window_list.h \ + src/ui/window_list.c src/ui/window_list.h \ src/event/server_events.c src/event/server_events.h \ src/event/client_events.c src/event/client_events.h \ src/ui/tray.h src/ui/tray.c \ diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index 20993a5b..b1273bc9 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -49,7 +49,7 @@ #include "xmpp/muc.h" #include "xmpp/xmpp.h" #include "xmpp/roster_list.h" -#include "window_list.h" +#include "ui/window_list.h" #include "plugins/plugins.h" #include "command/cmd_ac.h" diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 8babde06..fa55ec83 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -70,7 +70,7 @@ #include "tools/tinyurl.h" #include "xmpp/xmpp.h" #include "ui/ui.h" -#include "window_list.h" +#include "ui/window_list.h" #ifdef HAVE_LIBOTR #include "otr/otr.h" diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index b65c33f1..f68f725d 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -78,7 +78,7 @@ #include "tools/tinyurl.h" #include "xmpp/xmpp.h" #include "ui/ui.h" -#include "window_list.h" +#include "ui/window_list.h" #include "event/client_events.h" #ifdef HAVE_GTK #include "ui/tray.h" diff --git a/src/config/scripts.c b/src/config/scripts.c index 03ed6b99..04c4c1cd 100644 --- a/src/config/scripts.c +++ b/src/config/scripts.c @@ -42,7 +42,7 @@ #include "common.h" #include "log.h" -#include "window_list.h" +#include "ui/window_list.h" #include "command/cmd_defs.h" #include "ui/ui.h" #include "xmpp/xmpp.h" diff --git a/src/event/client_events.c b/src/event/client_events.c index 0107d496..4829133c 100644 --- a/src/event/client_events.c +++ b/src/event/client_events.c @@ -39,7 +39,7 @@ #include "log.h" #include "ui/ui.h" -#include "window_list.h" +#include "ui/window_list.h" #include "xmpp/xmpp.h" #include "xmpp/roster_list.h" #include "xmpp/chat_session.h" diff --git a/src/event/server_events.c b/src/event/server_events.c index 090a0fca..4adb3a2d 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -46,7 +46,7 @@ #include "config/scripts.h" #include "xmpp/roster_list.h" #include "plugins/plugins.h" -#include "window_list.h" +#include "ui/window_list.h" #include "config/tlscerts.h" #include "profanity.h" #include "event/client_events.h" diff --git a/src/otr/otr.c b/src/otr/otr.c index bcf64e66..27bd171b 100644 --- a/src/otr/otr.c +++ b/src/otr/otr.c @@ -42,7 +42,7 @@ #include "otr/otrlib.h" #include "log.h" #include "xmpp/roster_list.h" -#include "window_list.h" +#include "ui/window_list.h" #include "xmpp/contact.h" #include "ui/ui.h" #include "xmpp/xmpp.h" diff --git a/src/otr/otrlibv4.c b/src/otr/otrlibv4.c index 1b11668b..74166808 100644 --- a/src/otr/otrlibv4.c +++ b/src/otr/otrlibv4.c @@ -37,7 +37,7 @@ #include #include "ui/ui.h" -#include "window_list.h" +#include "ui/window_list.h" #include "log.h" #include "otr/otr.h" #include "otr/otrlib.h" diff --git a/src/plugins/api.c b/src/plugins/api.c index e0abeceb..a0e69043 100644 --- a/src/plugins/api.c +++ b/src/plugins/api.c @@ -50,7 +50,7 @@ #include "ui/ui.h" #include "config/theme.h" #include "command/cmd_defs.h" -#include "window_list.h" +#include "ui/window_list.h" #include "common.h" void diff --git a/src/plugins/callbacks.c b/src/plugins/callbacks.c index bfe8a3c6..0bcdd34b 100644 --- a/src/plugins/callbacks.c +++ b/src/plugins/callbacks.c @@ -41,7 +41,7 @@ #include "plugins/plugins.h" #include "tools/autocomplete.h" #include "tools/parser.h" -#include "window_list.h" +#include "ui/window_list.h" #include "ui/ui.h" diff --git a/src/profanity.c b/src/profanity.c index 456cae3b..68f6bbb0 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -71,7 +71,7 @@ #include "xmpp/resource.h" #include "xmpp/xmpp.h" #include "ui/ui.h" -#include "window_list.h" +#include "ui/window_list.h" #include "event/client_events.h" #include "config/tlscerts.h" diff --git a/src/window_list.c b/src/ui/window_list.c similarity index 100% rename from src/window_list.c rename to src/ui/window_list.c diff --git a/src/window_list.h b/src/ui/window_list.h similarity index 98% rename from src/window_list.h rename to src/ui/window_list.h index ac8aa2fe..0f319ac8 100644 --- a/src/window_list.h +++ b/src/ui/window_list.h @@ -32,8 +32,8 @@ * */ -#ifndef WINDOW_LIST_H -#define WINDOW_LIST_H +#ifndef UI_WINDOW_LIST_H +#define UI_WINDOW_LIST_H #include "ui/ui.h" diff --git a/src/xmpp/chat_state.c b/src/xmpp/chat_state.c index 836d313f..66c24265 100644 --- a/src/xmpp/chat_state.c +++ b/src/xmpp/chat_state.c @@ -39,7 +39,7 @@ #include "chat_state.h" #include "xmpp/chat_session.h" -#include "window_list.h" +#include "ui/window_list.h" #include "ui/win_types.h" #include "xmpp/xmpp.h" #include "config/preferences.h" diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index 954faf5d..c5f75ed0 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -54,7 +54,7 @@ #include "muc.h" #include "profanity.h" #include "ui/ui.h" -#include "window_list.h" +#include "ui/window_list.h" #include "config/preferences.h" #include "event/server_events.h" #include "xmpp/capabilities.h" diff --git a/src/xmpp/muc.c b/src/xmpp/muc.c index 884ddd34..83766c80 100644 --- a/src/xmpp/muc.c +++ b/src/xmpp/muc.c @@ -43,7 +43,7 @@ #include "xmpp/jid.h" #include "tools/autocomplete.h" #include "ui/ui.h" -#include "window_list.h" +#include "ui/window_list.h" #include "muc.h" typedef struct _muc_room_t { diff --git a/tests/unittests/test_cmd_otr.c b/tests/unittests/test_cmd_otr.c index ab03e7d4..c1a46fc1 100644 --- a/tests/unittests/test_cmd_otr.c +++ b/tests/unittests/test_cmd_otr.c @@ -17,7 +17,7 @@ #include "command/cmd_defs.h" #include "command/cmd_funcs.h" -#include "window_list.h" +#include "ui/window_list.h" #include "xmpp/xmpp.h" #include "ui/ui.h" From 0a57c4de78f8a3cd4efb631a79b000b42f16fc15 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 24 Jul 2016 15:43:51 +0100 Subject: [PATCH 13/13] Tidy headers --- src/command/cmd_ac.c | 12 +++++------ src/command/cmd_defs.c | 18 ++++++++-------- src/command/cmd_funcs.c | 40 ++++++++++++++++++++---------------- src/common.c | 4 +--- src/config/account.c | 4 ++-- src/config/accounts.c | 4 ++-- src/config/scripts.c | 2 +- src/config/theme.c | 1 + src/config/tlscerts.c | 2 +- src/config/tlscerts.h | 2 ++ src/event/client_events.c | 6 ++++-- src/event/server_events.c | 13 ++++++------ src/log.c | 1 - src/log.h | 2 +- src/otr/otr.c | 12 +++++------ src/otr/otrlibv3.c | 4 ++-- src/otr/otrlibv4.c | 4 ++-- src/pgp/gpg.c | 2 +- src/plugins/api.c | 8 ++++---- src/plugins/c_plugins.c | 2 +- src/plugins/callbacks.c | 3 +-- src/plugins/plugins.c | 7 +++---- src/plugins/python_api.c | 2 +- src/plugins/python_plugins.c | 1 - src/plugins/settings.c | 2 +- src/plugins/themes.c | 2 +- src/profanity.c | 30 +++++++++++++++------------ src/profanity.h | 1 + src/tools/http_upload.c | 6 +++--- src/tools/http_upload.h | 1 + src/ui/buffer.h | 4 ++-- src/ui/console.c | 10 ++++----- src/ui/core.c | 28 +++++++++++++------------ src/ui/inputwin.c | 14 ++++++------- src/ui/mucconfwin.c | 2 +- src/ui/mucwin.c | 6 +++--- src/ui/notifier.c | 8 +++++--- src/ui/occupantswin.c | 4 ++-- src/ui/privwin.c | 5 ++--- src/ui/rosterwin.c | 6 +++--- src/ui/statusbar.c | 2 +- src/ui/titlebar.c | 2 +- src/ui/tray.c | 4 ++-- src/ui/ui.h | 5 +++-- src/ui/win_types.h | 3 ++- src/ui/window.c | 3 ++- src/ui/window.h | 14 ++++++------- src/ui/window_list.c | 8 ++++---- src/ui/xmlwin.c | 2 +- src/xmpp/blocking.c | 1 + src/xmpp/bookmark.c | 7 ++++--- src/xmpp/capabilities.c | 3 ++- src/xmpp/capabilities.h | 1 + src/xmpp/chat_session.c | 4 ++-- src/xmpp/chat_state.c | 6 +++--- src/xmpp/connection.c | 1 + src/xmpp/contact.c | 4 ++-- src/xmpp/contact.h | 2 +- src/xmpp/form.c | 1 + src/xmpp/form.h | 5 +++-- src/xmpp/iq.c | 23 +++++++++++---------- src/xmpp/jid.c | 3 +-- src/xmpp/message.c | 17 +++++++-------- src/xmpp/muc.c | 6 +++--- src/xmpp/muc.h | 4 ++-- src/xmpp/presence.c | 11 +++++----- src/xmpp/roster.c | 12 +++++------ src/xmpp/roster_list.c | 6 +++--- src/xmpp/session.c | 10 ++++----- src/xmpp/session.h | 11 +--------- src/xmpp/stanza.c | 4 ++-- src/xmpp/stanza.h | 1 + src/xmpp/xmpp.h | 5 +++-- 73 files changed, 247 insertions(+), 229 deletions(-) diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index b1273bc9..afc642e4 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -41,17 +41,17 @@ #include #include "common.h" -#include "tools/parser.h" -#include "ui/win_types.h" -#include "command/cmd_funcs.h" #include "config/preferences.h" #include "config/scripts.h" +#include "command/cmd_ac.h" +#include "command/cmd_funcs.h" +#include "tools/parser.h" +#include "plugins/plugins.h" +#include "ui/win_types.h" +#include "ui/window_list.h" #include "xmpp/muc.h" #include "xmpp/xmpp.h" #include "xmpp/roster_list.h" -#include "ui/window_list.h" -#include "plugins/plugins.h" -#include "command/cmd_ac.h" #ifdef HAVE_LIBGPGME #include "pgp/gpg.h" diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index fa55ec83..14afd7c2 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -48,29 +48,29 @@ #include -#include "xmpp/chat_session.h" +#include "profanity.h" +#include "log.h" +#include "common.h" #include "command/cmd_defs.h" #include "command/cmd_funcs.h" #include "command/cmd_ac.h" -#include "common.h" #include "config/accounts.h" #include "config/preferences.h" #include "config/theme.h" #include "config/tlscerts.h" #include "config/scripts.h" -#include "xmpp/contact.h" -#include "xmpp/roster_list.h" -#include "xmpp/jid.h" -#include "log.h" -#include "xmpp/muc.h" #include "plugins/plugins.h" -#include "profanity.h" #include "tools/autocomplete.h" #include "tools/parser.h" #include "tools/tinyurl.h" -#include "xmpp/xmpp.h" #include "ui/ui.h" #include "ui/window_list.h" +#include "xmpp/xmpp.h" +#include "xmpp/contact.h" +#include "xmpp/roster_list.h" +#include "xmpp/jid.h" +#include "xmpp/chat_session.h" +#include "xmpp/muc.h" #ifdef HAVE_LIBOTR #include "otr/otr.h" diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index f68f725d..26b22c4f 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -49,41 +49,45 @@ #include #include -#include "xmpp/chat_session.h" +#include "profanity.h" +#include "log.h" +#include "common.h" #include "command/cmd_funcs.h" #include "command/cmd_defs.h" #include "command/cmd_ac.h" -#include "common.h" #include "config/accounts.h" #include "config/account.h" #include "config/preferences.h" #include "config/theme.h" #include "config/tlscerts.h" #include "config/scripts.h" -#include "xmpp/contact.h" -#include "xmpp/roster_list.h" -#include "xmpp/jid.h" -#include "log.h" -#include "xmpp/muc.h" -#ifdef HAVE_LIBOTR -#include "otr/otr.h" -#endif -#ifdef HAVE_LIBGPGME -#include "pgp/gpg.h" -#endif -#include "profanity.h" -#include "plugins/plugins.h" +#include "event/client_events.h" +#include "tools/http_upload.h" #include "tools/autocomplete.h" #include "tools/parser.h" #include "tools/tinyurl.h" -#include "xmpp/xmpp.h" +#include "plugins/plugins.h" #include "ui/ui.h" #include "ui/window_list.h" -#include "event/client_events.h" +#include "xmpp/xmpp.h" +#include "xmpp/contact.h" +#include "xmpp/roster_list.h" +#include "xmpp/jid.h" +#include "xmpp/muc.h" +#include "xmpp/chat_session.h" + +#ifdef HAVE_LIBOTR +#include "otr/otr.h" +#endif + +#ifdef HAVE_LIBGPGME +#include "pgp/gpg.h" +#endif + #ifdef HAVE_GTK #include "ui/tray.h" #endif -#include "tools/http_upload.h" + #ifdef HAVE_PYTHON #include "plugins/python_plugins.h" #endif diff --git a/src/common.c b/src/common.c index c12f184f..b7868c79 100644 --- a/src/common.c +++ b/src/common.c @@ -53,11 +53,9 @@ #include #endif -#include "tools/p_sha1.h" - #include "log.h" #include "common.h" - +#include "tools/p_sha1.h" struct curl_data_t { diff --git a/src/config/account.c b/src/config/account.c index 0a2c9132..879759f5 100644 --- a/src/config/account.c +++ b/src/config/account.c @@ -38,10 +38,10 @@ #include -#include "xmpp/jid.h" -#include "config/account.h" #include "common.h" #include "log.h" +#include "config/account.h" +#include "xmpp/jid.h" ProfAccount* account_new(const gchar *const name, const gchar *const jid, diff --git a/src/config/accounts.c b/src/config/accounts.c index c504b5d3..7f852e6f 100644 --- a/src/config/accounts.c +++ b/src/config/accounts.c @@ -41,12 +41,12 @@ #include "accounts.h" #include "common.h" +#include "log.h" #include "config/account.h" #include "config/conflists.h" -#include "xmpp/jid.h" -#include "log.h" #include "tools/autocomplete.h" #include "xmpp/xmpp.h" +#include "xmpp/jid.h" static gchar *accounts_loc; static GKeyFile *accounts; diff --git a/src/config/scripts.c b/src/config/scripts.c index 04c4c1cd..14f05f29 100644 --- a/src/config/scripts.c +++ b/src/config/scripts.c @@ -42,9 +42,9 @@ #include "common.h" #include "log.h" -#include "ui/window_list.h" #include "command/cmd_defs.h" #include "ui/ui.h" +#include "ui/window_list.h" #include "xmpp/xmpp.h" void diff --git a/src/config/theme.c b/src/config/theme.c index 6c47b9f0..0ba9c786 100644 --- a/src/config/theme.c +++ b/src/config/theme.c @@ -38,6 +38,7 @@ #include #include + #ifdef HAVE_NCURSESW_NCURSES_H #include #elif HAVE_NCURSES_H diff --git a/src/config/tlscerts.c b/src/config/tlscerts.c index ba59acfc..b51f5ff9 100644 --- a/src/config/tlscerts.c +++ b/src/config/tlscerts.c @@ -38,9 +38,9 @@ #include #include -#include "config/tlscerts.h" #include "log.h" #include "common.h" +#include "config/tlscerts.h" #include "tools/autocomplete.h" static gchar *tlscerts_loc; diff --git a/src/config/tlscerts.h b/src/config/tlscerts.h index 0001fc28..76b2a344 100644 --- a/src/config/tlscerts.h +++ b/src/config/tlscerts.h @@ -35,6 +35,8 @@ #ifndef CONFIG_TLSCERTS_H #define CONFIG_TLSCERTS_H +#include + typedef struct tls_cert_t { int version; char *serialnumber; diff --git a/src/event/client_events.c b/src/event/client_events.c index 4829133c..dd9c4432 100644 --- a/src/event/client_events.c +++ b/src/event/client_events.c @@ -38,15 +38,17 @@ #include #include "log.h" -#include "ui/ui.h" +#include "plugins/plugins.h" #include "ui/window_list.h" +#include "ui/ui.h" #include "xmpp/xmpp.h" #include "xmpp/roster_list.h" #include "xmpp/chat_session.h" -#include "plugins/plugins.h" + #ifdef HAVE_LIBOTR #include "otr/otr.h" #endif + #ifdef HAVE_LIBGPGME #include "pgp/gpg.h" #endif diff --git a/src/event/server_events.c b/src/event/server_events.c index 4adb3a2d..b8154b8e 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -38,22 +38,23 @@ #include #include -#include "xmpp/chat_session.h" +#include "profanity.h" #include "log.h" -#include "xmpp/muc.h" #include "config/preferences.h" +#include "config/tlscerts.h" #include "config/account.h" #include "config/scripts.h" -#include "xmpp/roster_list.h" +#include "event/client_events.h" #include "plugins/plugins.h" #include "ui/window_list.h" -#include "config/tlscerts.h" -#include "profanity.h" -#include "event/client_events.h" +#include "xmpp/muc.h" +#include "xmpp/chat_session.h" +#include "xmpp/roster_list.h" #ifdef HAVE_LIBOTR #include "otr/otr.h" #endif + #ifdef HAVE_LIBGPGME #include "pgp/gpg.h" #endif diff --git a/src/log.c b/src/log.c index 5e4e86da..363c1be7 100644 --- a/src/log.c +++ b/src/log.c @@ -44,7 +44,6 @@ #include "glib/gstdio.h" #include "log.h" - #include "common.h" #include "config/preferences.h" #include "xmpp/xmpp.h" diff --git a/src/log.h b/src/log.h index 531e44da..b065a448 100644 --- a/src/log.h +++ b/src/log.h @@ -35,7 +35,7 @@ #ifndef LOG_H #define LOG_H -#include "glib.h" +#include // log levels typedef enum { diff --git a/src/otr/otr.c b/src/otr/otr.c index 27bd171b..343bdcbc 100644 --- a/src/otr/otr.c +++ b/src/otr/otr.c @@ -38,16 +38,16 @@ #include #include +#include "log.h" +#include "config/preferences.h" #include "otr/otr.h" #include "otr/otrlib.h" -#include "log.h" -#include "xmpp/roster_list.h" -#include "ui/window_list.h" -#include "xmpp/contact.h" #include "ui/ui.h" -#include "xmpp/xmpp.h" -#include "config/preferences.h" +#include "ui/window_list.h" #include "xmpp/chat_session.h" +#include "xmpp/roster_list.h" +#include "xmpp/contact.h" +#include "xmpp/xmpp.h" #define PRESENCE_ONLINE 1 #define PRESENCE_OFFLINE 0 diff --git a/src/otr/otrlibv3.c b/src/otr/otrlibv3.c index 81b9cc5b..4f7a6135 100644 --- a/src/otr/otrlibv3.c +++ b/src/otr/otrlibv3.c @@ -35,10 +35,10 @@ #include #include -#include "ui/ui.h" -#include "window_list.h" #include "otr/otr.h" #include "otr/otrlib.h" +#include "ui/ui.h" +#include "ui/window_list.h" OtrlPolicy otrlib_policy(void) diff --git a/src/otr/otrlibv4.c b/src/otr/otrlibv4.c index 74166808..ab39e81c 100644 --- a/src/otr/otrlibv4.c +++ b/src/otr/otrlibv4.c @@ -36,11 +36,11 @@ #include #include -#include "ui/ui.h" -#include "ui/window_list.h" #include "log.h" #include "otr/otr.h" #include "otr/otrlib.h" +#include "ui/ui.h" +#include "ui/window_list.h" static GTimer *timer; static unsigned int current_interval; diff --git a/src/pgp/gpg.c b/src/pgp/gpg.c index b757abca..fb1f2db1 100644 --- a/src/pgp/gpg.c +++ b/src/pgp/gpg.c @@ -44,9 +44,9 @@ #include #include -#include "pgp/gpg.h" #include "log.h" #include "common.h" +#include "pgp/gpg.h" #include "tools/autocomplete.h" #include "ui/ui.h" diff --git a/src/plugins/api.c b/src/plugins/api.c index a0e69043..8ac4856f 100644 --- a/src/plugins/api.c +++ b/src/plugins/api.c @@ -38,7 +38,11 @@ #include +#include "profanity.h" #include "log.h" +#include "common.h" +#include "config/theme.h" +#include "command/cmd_defs.h" #include "event/server_events.h" #include "event/client_events.h" #include "plugins/callbacks.h" @@ -46,12 +50,8 @@ #include "plugins/themes.h" #include "plugins/settings.h" #include "plugins/disco.h" -#include "profanity.h" #include "ui/ui.h" -#include "config/theme.h" -#include "command/cmd_defs.h" #include "ui/window_list.h" -#include "common.h" void api_cons_alert(void) diff --git a/src/plugins/c_plugins.c b/src/plugins/c_plugins.c index b9fc74e9..c7f8fcdb 100644 --- a/src/plugins/c_plugins.c +++ b/src/plugins/c_plugins.c @@ -39,8 +39,8 @@ #include -#include "config/preferences.h" #include "log.h" +#include "config/preferences.h" #include "plugins/api.h" #include "plugins/callbacks.h" #include "plugins/plugins.h" diff --git a/src/plugins/callbacks.c b/src/plugins/callbacks.c index 0bcdd34b..40a35400 100644 --- a/src/plugins/callbacks.c +++ b/src/plugins/callbacks.c @@ -41,9 +41,8 @@ #include "plugins/plugins.h" #include "tools/autocomplete.h" #include "tools/parser.h" -#include "ui/window_list.h" - #include "ui/ui.h" +#include "ui/window_list.h" static GHashTable *p_commands = NULL; static GHashTable *p_timed_functions = NULL; diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index a90940e0..8e9b2d37 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -35,11 +35,10 @@ #include #include +#include "log.h" #include "config.h" #include "common.h" #include "config/preferences.h" -#include "log.h" -#include "xmpp/xmpp.h" #include "plugins/callbacks.h" #include "plugins/autocompleters.h" #include "plugins/api.h" @@ -47,6 +46,8 @@ #include "plugins/themes.h" #include "plugins/settings.h" #include "plugins/disco.h" +#include "ui/ui.h" +#include "xmpp/xmpp.h" #ifdef HAVE_PYTHON #include "plugins/python_plugins.h" @@ -58,8 +59,6 @@ #include "plugins/c_api.h" #endif -#include "ui/ui.h" - static GHashTable *plugins; void diff --git a/src/plugins/python_api.c b/src/plugins/python_api.c index ef6b9ccd..13b1f665 100644 --- a/src/plugins/python_api.c +++ b/src/plugins/python_api.c @@ -41,12 +41,12 @@ #include +#include "log.h" #include "plugins/api.h" #include "plugins/python_api.h" #include "plugins/python_plugins.h" #include "plugins/callbacks.h" #include "plugins/autocompleters.h" -#include "log.h" static char* _python_plugin_name(void); diff --git a/src/plugins/python_plugins.c b/src/plugins/python_plugins.c index 40046200..dc1c17f9 100644 --- a/src/plugins/python_plugins.c +++ b/src/plugins/python_plugins.c @@ -35,7 +35,6 @@ #include #include "config.h" - #include "config/preferences.h" #include "plugins/api.h" #include "plugins/callbacks.h" diff --git a/src/plugins/settings.c b/src/plugins/settings.c index d75152a8..df32b379 100644 --- a/src/plugins/settings.c +++ b/src/plugins/settings.c @@ -38,8 +38,8 @@ #include #include -#include "config/theme.h" #include "common.h" +#include "config/theme.h" static GKeyFile *settings; diff --git a/src/plugins/themes.c b/src/plugins/themes.c index 60e1f11a..cfa718cc 100644 --- a/src/plugins/themes.c +++ b/src/plugins/themes.c @@ -35,8 +35,8 @@ #include #include -#include "config/theme.h" #include "common.h" +#include "config/theme.h" static GKeyFile *themes; diff --git a/src/profanity.c b/src/profanity.c index 68f6bbb0..7d90c1c9 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -40,6 +40,7 @@ #ifdef HAVE_GTK #include "ui/tray.h" #endif + #include #include #include @@ -48,32 +49,35 @@ #include #include "profanity.h" -#include "xmpp/chat_session.h" -#include "xmpp/chat_state.h" +#include "common.h" +#include "log.h" +#include "config/tlscerts.h" #include "config/accounts.h" #include "config/preferences.h" #include "config/theme.h" +#include "config/tlscerts.h" #include "config/scripts.h" #include "command/cmd_defs.h" -#include "common.h" +#include "plugins/plugins.h" +#include "event/client_events.h" +#include "ui/ui.h" +#include "ui/window_list.h" +#include "xmpp/resource.h" +#include "xmpp/xmpp.h" +#include "xmpp/muc.h" +#include "xmpp/chat_session.h" +#include "xmpp/chat_state.h" #include "xmpp/contact.h" #include "xmpp/roster_list.h" -#include "config/tlscerts.h" -#include "log.h" -#include "xmpp/muc.h" -#include "plugins/plugins.h" + #ifdef HAVE_LIBOTR #include "otr/otr.h" #endif + #ifdef HAVE_LIBGPGME #include "pgp/gpg.h" #endif -#include "xmpp/resource.h" -#include "xmpp/xmpp.h" -#include "ui/ui.h" -#include "ui/window_list.h" -#include "event/client_events.h" -#include "config/tlscerts.h" + static void _check_autoaway(void); static void _init(char *log_level); diff --git a/src/profanity.h b/src/profanity.h index ef1f2ea1..94d7ef45 100644 --- a/src/profanity.h +++ b/src/profanity.h @@ -36,6 +36,7 @@ #define PROFANITY_H #include +#include void prof_run(char *log_level, char *account_name); diff --git a/src/tools/http_upload.c b/src/tools/http_upload.c index 835618ca..80b46c87 100644 --- a/src/tools/http_upload.c +++ b/src/tools/http_upload.c @@ -45,11 +45,11 @@ #include #include "profanity.h" +#include "event/client_events.h" +#include "tools/http_upload.h" +#include "config/preferences.h" #include "ui/ui.h" #include "ui/window.h" -#include "tools/http_upload.h" -#include "event/client_events.h" -#include "config/preferences.h" #define FALLBACK_MIMETYPE "application/octet-stream" #define FALLBACK_CONTENTTYPE_HEADER "Content-Type: application/octet-stream" diff --git a/src/tools/http_upload.h b/src/tools/http_upload.h index e3d6cb8a..217c1321 100644 --- a/src/tools/http_upload.h +++ b/src/tools/http_upload.h @@ -41,6 +41,7 @@ #include #include + #include "ui/win_types.h" typedef struct http_upload_t { diff --git a/src/ui/buffer.h b/src/ui/buffer.h index e37f58fa..19b7bfb7 100644 --- a/src/ui/buffer.h +++ b/src/ui/buffer.h @@ -35,11 +35,11 @@ #ifndef UI_BUFFER_H #define UI_BUFFER_H +#include + #include "config.h" #include "config/theme.h" -#include - typedef struct delivery_receipt_t { char *id; gboolean received; diff --git a/src/ui/console.c b/src/ui/console.c index 3122b2d6..600bbdf3 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -43,18 +43,18 @@ #include #endif -#include "command/cmd_defs.h" #include "common.h" #include "log.h" -#include "xmpp/muc.h" -#include "xmpp/roster_list.h" #include "config/preferences.h" #include "config/theme.h" -#include "ui/window.h" -#include "window_list.h" +#include "command/cmd_defs.h" +#include "ui/window_list.h" #include "ui/ui.h" +#include "ui/window.h" #include "ui/statusbar.h" #include "xmpp/xmpp.h" +#include "xmpp/muc.h" +#include "xmpp/roster_list.h" #ifdef HAVE_GIT_VERSION #include "gitversion.h" diff --git a/src/ui/core.c b/src/ui/core.c index cca836f7..2dad71fb 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -44,38 +44,40 @@ #include #include +#include + #ifdef HAVE_LIBXSS #include #endif -#include + #ifdef HAVE_NCURSESW_NCURSES_H #include #elif HAVE_NCURSES_H #include #endif -#include "xmpp/chat_session.h" +#include "log.h" +#include "common.h" #include "command/cmd_defs.h" #include "command/cmd_ac.h" -#include "common.h" #include "config/preferences.h" #include "config/theme.h" -#include "xmpp/contact.h" -#include "xmpp/roster_list.h" -#include "xmpp/jid.h" -#include "log.h" -#include "xmpp/muc.h" -#ifdef HAVE_LIBOTR -#include "otr/otr.h" -#endif #include "ui/ui.h" #include "ui/titlebar.h" #include "ui/statusbar.h" #include "ui/inputwin.h" #include "ui/window.h" -#include "window_list.h" +#include "ui/window_list.h" #include "xmpp/xmpp.h" -#include "plugins/plugins.h" +#include "xmpp/muc.h" +#include "xmpp/chat_session.h" +#include "xmpp/contact.h" +#include "xmpp/roster_list.h" +#include "xmpp/jid.h" + +#ifdef HAVE_LIBOTR +#include "otr/otr.h" +#endif static char *win_title; static int inp_size; diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 1f5c69cc..fdfdb0ac 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -53,22 +53,22 @@ #include #endif -#include "command/cmd_ac.h" -#include "xmpp/chat_state.h" +#include "profanity.h" +#include "log.h" #include "common.h" +#include "command/cmd_ac.h" #include "config/accounts.h" #include "config/preferences.h" #include "config/theme.h" -#include "log.h" -#include "xmpp/muc.h" -#include "profanity.h" -#include "xmpp/roster_list.h" #include "ui/ui.h" #include "ui/statusbar.h" #include "ui/inputwin.h" #include "ui/window.h" -#include "window_list.h" +#include "ui/window_list.h" #include "xmpp/xmpp.h" +#include "xmpp/muc.h" +#include "xmpp/roster_list.h" +#include "xmpp/chat_state.h" static WINDOW *inp_win; static int pad_start = 0; diff --git a/src/ui/mucconfwin.c b/src/ui/mucconfwin.c index a52f2378..b31bb928 100644 --- a/src/ui/mucconfwin.c +++ b/src/ui/mucconfwin.c @@ -38,7 +38,7 @@ #include "ui/ui.h" #include "ui/window.h" #include "ui/win_types.h" -#include "window_list.h" +#include "ui/window_list.h" static void _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field); diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index 08e9bb38..3f773431 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -38,12 +38,12 @@ #include #include -#include "ui/win_types.h" -#include "window_list.h" #include "log.h" #include "config/preferences.h" -#include "ui/window.h" #include "plugins/plugins.h" +#include "ui/window.h" +#include "ui/win_types.h" +#include "ui/window_list.h" void mucwin_role_change(ProfMucWin *mucwin, const char *const role, const char *const actor, const char *const reason) diff --git a/src/ui/notifier.c b/src/ui/notifier.c index f992729a..4c7bc8df 100644 --- a/src/ui/notifier.c +++ b/src/ui/notifier.c @@ -38,19 +38,21 @@ #include #include + #ifdef HAVE_LIBNOTIFY #include #endif + #ifdef PLATFORM_CYGWIN #include #endif #include "log.h" -#include "xmpp/muc.h" -#include "ui/ui.h" -#include "window_list.h" #include "config/preferences.h" +#include "ui/ui.h" +#include "ui/window_list.h" #include "xmpp/xmpp.h" +#include "xmpp/muc.h" static GTimer *remind_timer; diff --git a/src/ui/occupantswin.c b/src/ui/occupantswin.c index efa8146c..716ddda7 100644 --- a/src/ui/occupantswin.c +++ b/src/ui/occupantswin.c @@ -34,10 +34,10 @@ #include +#include "config/preferences.h" #include "ui/ui.h" #include "ui/window.h" -#include "window_list.h" -#include "config/preferences.h" +#include "ui/window_list.h" static void _occuptantswin_occupant(ProfLayoutSplit *layout, Occupant *occupant, gboolean showjid) diff --git a/src/ui/privwin.c b/src/ui/privwin.c index 716adf2d..1caf4845 100644 --- a/src/ui/privwin.c +++ b/src/ui/privwin.c @@ -36,12 +36,11 @@ #include #include +#include "config/preferences.h" #include "ui/win_types.h" #include "ui/window.h" #include "ui/titlebar.h" -#include "window_list.h" -#include "config/preferences.h" - +#include "ui/window_list.h" void privwin_incoming_msg(ProfPrivateWin *privatewin, const char *const message, GDateTime *timestamp) diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c index 06d34894..690677cd 100644 --- a/src/ui/rosterwin.c +++ b/src/ui/rosterwin.c @@ -36,12 +36,12 @@ #include #include -#include "xmpp/contact.h" +#include "config/preferences.h" #include "ui/ui.h" #include "ui/window.h" -#include "window_list.h" -#include "config/preferences.h" +#include "ui/window_list.h" #include "xmpp/roster_list.h" +#include "xmpp/contact.h" typedef enum { ROSTER_CONTACT, diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c index 36017168..af165908 100644 --- a/src/ui/statusbar.c +++ b/src/ui/statusbar.c @@ -45,10 +45,10 @@ #endif #include "config/theme.h" +#include "config/preferences.h" #include "ui/ui.h" #include "ui/statusbar.h" #include "ui/inputwin.h" -#include "config/preferences.h" #define TIME_CHECK 60000000 diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c index 67764221..701c01c2 100644 --- a/src/ui/titlebar.c +++ b/src/ui/titlebar.c @@ -44,7 +44,7 @@ #include "ui/ui.h" #include "ui/titlebar.h" #include "ui/inputwin.h" -#include "window_list.h" +#include "ui/window_list.h" #include "ui/window.h" #include "xmpp/roster_list.h" #include "xmpp/chat_session.h" diff --git a/src/ui/tray.c b/src/ui/tray.c index 9011bec9..8471f039 100644 --- a/src/ui/tray.c +++ b/src/ui/tray.c @@ -39,10 +39,10 @@ #include #include -#include "tray.h" -#include "window_list.h" #include "log.h" #include "config/preferences.h" +#include "ui/tray.h" +#include "ui/window_list.h" static gboolean gtk_ready = FALSE; static GtkStatusIcon *prof_tray = NULL; diff --git a/src/ui/ui.h b/src/ui/ui.h index 3e4292c9..2683a32b 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -37,11 +37,12 @@ #include "config.h" +#include "config/tlscerts.h" +#include "config/account.h" #include "command/cmd_funcs.h" #include "ui/win_types.h" #include "xmpp/muc.h" -#include "config/tlscerts.h" -#include "config/account.h" + #ifdef HAVE_LIBOTR #include "otr/otr.h" #endif diff --git a/src/ui/win_types.h b/src/ui/win_types.h index b523ef2f..47bc7657 100644 --- a/src/ui/win_types.h +++ b/src/ui/win_types.h @@ -39,15 +39,16 @@ #include #include + #ifdef HAVE_NCURSESW_NCURSES_H #include #elif HAVE_NCURSES_H #include #endif +#include "tools/autocomplete.h" #include "ui/buffer.h" #include "xmpp/chat_state.h" -#include "tools/autocomplete.h" #define LAYOUT_SPLIT_MEMCHECK 12345671 #define PROFCHATWIN_MEMCHECK 22374522 diff --git a/src/ui/window.c b/src/ui/window.c index 9b210972..89e5f1ac 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -41,6 +41,7 @@ #include #include + #ifdef HAVE_NCURSESW_NCURSES_H #include #elif HAVE_NCURSES_H @@ -49,10 +50,10 @@ #include "config/theme.h" #include "config/preferences.h" -#include "xmpp/roster_list.h" #include "ui/ui.h" #include "ui/window.h" #include "xmpp/xmpp.h" +#include "xmpp/roster_list.h" #define CONS_WIN_TITLE "Profanity. Type /help for help information." #define XML_WIN_TITLE "XML Console" diff --git a/src/ui/window.h b/src/ui/window.h index c570e6c7..cc9ae8df 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -39,19 +39,19 @@ #include -#include "xmpp/contact.h" -#include "xmpp/muc.h" -#include "ui/ui.h" -#include "ui/buffer.h" -#include "xmpp/xmpp.h" -#include "xmpp/chat_state.h" - #ifdef HAVE_NCURSESW_NCURSES_H #include #elif HAVE_NCURSES_H #include #endif +#include "ui/ui.h" +#include "ui/buffer.h" +#include "xmpp/xmpp.h" +#include "xmpp/chat_state.h" +#include "xmpp/contact.h" +#include "xmpp/muc.h" + #define PAD_SIZE 1000 void win_move_to_end(ProfWin *window); diff --git a/src/ui/window_list.c b/src/ui/window_list.c index 1e5ff426..20994e34 100644 --- a/src/ui/window_list.c +++ b/src/ui/window_list.c @@ -41,14 +41,14 @@ #include #include "common.h" -#include "xmpp/roster_list.h" +#include "config/preferences.h" #include "config/theme.h" +#include "plugins/plugins.h" #include "ui/ui.h" #include "ui/statusbar.h" -#include "window_list.h" -#include "plugins/plugins.h" +#include "ui/window_list.h" #include "xmpp/xmpp.h" -#include "config/preferences.h" +#include "xmpp/roster_list.h" static GHashTable *windows; static int current; diff --git a/src/ui/xmlwin.c b/src/ui/xmlwin.c index 16246585..80870b46 100644 --- a/src/ui/xmlwin.c +++ b/src/ui/xmlwin.c @@ -36,7 +36,7 @@ #include #include "ui/win_types.h" -#include "window_list.h" +#include "ui/window_list.h" void xmlwin_show(ProfXMLWin *xmlwin, const char *const msg) diff --git a/src/xmpp/blocking.c b/src/xmpp/blocking.c index 39cfb65a..a5a920e4 100644 --- a/src/xmpp/blocking.c +++ b/src/xmpp/blocking.c @@ -38,6 +38,7 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c index 69c74b2e..940b7982 100644 --- a/src/xmpp/bookmark.c +++ b/src/xmpp/bookmark.c @@ -43,21 +43,22 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif #include "common.h" #include "log.h" -#include "muc.h" #include "event/server_events.h" +#include "plugins/plugins.h" +#include "ui/ui.h" #include "xmpp/connection.h" #include "xmpp/iq.h" #include "xmpp/stanza.h" #include "xmpp/xmpp.h" #include "xmpp/bookmark.h" -#include "ui/ui.h" -#include "plugins/plugins.h" +#include "xmpp/muc.h" #define BOOKMARK_TIMEOUT 5000 diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c index 2a8aff0e..4d9c0a36 100644 --- a/src/xmpp/capabilities.c +++ b/src/xmpp/capabilities.c @@ -47,17 +47,18 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif #include "common.h" #include "log.h" +#include "plugins/plugins.h" #include "xmpp/xmpp.h" #include "xmpp/stanza.h" #include "xmpp/form.h" #include "xmpp/capabilities.h" -#include "plugins/plugins.h" static gchar *cache_loc; static GKeyFile *cache; diff --git a/src/xmpp/capabilities.h b/src/xmpp/capabilities.h index d5d3d777..71fc06f1 100644 --- a/src/xmpp/capabilities.h +++ b/src/xmpp/capabilities.h @@ -40,6 +40,7 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif diff --git a/src/xmpp/chat_session.c b/src/xmpp/chat_session.c index 7e844871..61d7018c 100644 --- a/src/xmpp/chat_session.c +++ b/src/xmpp/chat_session.c @@ -38,10 +38,10 @@ #include -#include "chat_session.h" -#include "config/preferences.h" #include "log.h" +#include "config/preferences.h" #include "xmpp/xmpp.h" +#include "xmpp/chat_session.h" static GHashTable *sessions; diff --git a/src/xmpp/chat_state.c b/src/xmpp/chat_state.c index 66c24265..ad78c3b9 100644 --- a/src/xmpp/chat_state.c +++ b/src/xmpp/chat_state.c @@ -37,12 +37,12 @@ #include -#include "chat_state.h" -#include "xmpp/chat_session.h" +#include "config/preferences.h" #include "ui/window_list.h" #include "ui/win_types.h" #include "xmpp/xmpp.h" -#include "config/preferences.h" +#include "xmpp/chat_state.h" +#include "xmpp/chat_session.h" #define PAUSED_TIMEOUT 10.0 #define INACTIVE_TIMEOUT 30.0 diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index c590b7ba..8a963bb4 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -41,6 +41,7 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif diff --git a/src/xmpp/contact.c b/src/xmpp/contact.c index 000d7668..d50af5cd 100644 --- a/src/xmpp/contact.c +++ b/src/xmpp/contact.c @@ -38,10 +38,10 @@ #include -#include "contact.h" #include "common.h" -#include "resource.h" #include "tools/autocomplete.h" +#include "xmpp/resource.h" +#include "xmpp/contact.h" struct p_contact_t { char *barejid; diff --git a/src/xmpp/contact.h b/src/xmpp/contact.h index 6a13d01e..8e71faef 100644 --- a/src/xmpp/contact.h +++ b/src/xmpp/contact.h @@ -35,8 +35,8 @@ #ifndef XMPP_CONTACT_H #define XMPP_CONTACT_H -#include "resource.h" #include "tools/autocomplete.h" +#include "xmpp/resource.h" typedef struct p_contact_t *PContact; diff --git a/src/xmpp/form.c b/src/xmpp/form.c index bc0c9da9..3619f95b 100644 --- a/src/xmpp/form.c +++ b/src/xmpp/form.c @@ -40,6 +40,7 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif diff --git a/src/xmpp/form.h b/src/xmpp/form.h index f9740d68..5ce9ce31 100644 --- a/src/xmpp/form.h +++ b/src/xmpp/form.h @@ -35,15 +35,16 @@ #ifndef XMPP_FORM_H #define XMPP_FORM_H -#include "xmpp/xmpp.h" - #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif +#include "xmpp/xmpp.h" + DataForm* form_create(xmpp_stanza_t *const stanza); xmpp_stanza_t* form_create_submission(DataForm *form); char* form_get_form_type_field(DataForm *form); diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index c5f75ed0..3a29fbfc 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -46,30 +46,31 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif -#include "log.h" -#include "muc.h" #include "profanity.h" -#include "ui/ui.h" -#include "ui/window_list.h" +#include "log.h" #include "config/preferences.h" #include "event/server_events.h" +#include "plugins/plugins.h" +#include "tools/http_upload.h" +#include "ui/ui.h" +#include "ui/window_list.h" +#include "xmpp/xmpp.h" +#include "xmpp/connection.h" +#include "xmpp/session.h" +#include "xmpp/iq.h" #include "xmpp/capabilities.h" #include "xmpp/blocking.h" #include "xmpp/session.h" #include "xmpp/stanza.h" #include "xmpp/form.h" -#include "roster_list.h" -#include "xmpp/xmpp.h" -#include "xmpp/connection.h" -#include "xmpp/session.h" -#include "xmpp/iq.h" +#include "xmpp/roster_list.h" #include "xmpp/roster.h" -#include "plugins/plugins.h" -#include "tools/http_upload.h" +#include "xmpp/muc.h" typedef struct p_room_info_data_t { char *room; diff --git a/src/xmpp/jid.c b/src/xmpp/jid.c index 1fe5d8f5..fb4361d7 100644 --- a/src/xmpp/jid.c +++ b/src/xmpp/jid.c @@ -37,9 +37,8 @@ #include -#include "jid.h" - #include "common.h" +#include "xmpp/jid.h" Jid* jid_create(const gchar *const str) diff --git a/src/xmpp/message.c b/src/xmpp/message.c index 9b485954..fc314e30 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -40,26 +40,27 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif -#include "chat_session.h" -#include "config/preferences.h" -#include "log.h" -#include "muc.h" #include "profanity.h" -#include "ui/ui.h" +#include "log.h" +#include "config/preferences.h" #include "event/server_events.h" +#include "pgp/gpg.h" +#include "plugins/plugins.h" +#include "ui/ui.h" +#include "xmpp/chat_session.h" +#include "xmpp/muc.h" #include "xmpp/session.h" #include "xmpp/message.h" #include "xmpp/roster.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "xmpp/stanza.h" #include "xmpp/connection.h" #include "xmpp/xmpp.h" -#include "pgp/gpg.h" -#include "plugins/plugins.h" static int _message_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata); diff --git a/src/xmpp/muc.c b/src/xmpp/muc.c index 83766c80..b7c9884e 100644 --- a/src/xmpp/muc.c +++ b/src/xmpp/muc.c @@ -38,13 +38,13 @@ #include -#include "xmpp/contact.h" #include "common.h" -#include "xmpp/jid.h" #include "tools/autocomplete.h" #include "ui/ui.h" #include "ui/window_list.h" -#include "muc.h" +#include "xmpp/jid.h" +#include "xmpp/muc.h" +#include "xmpp/contact.h" typedef struct _muc_room_t { char *room; // e.g. test@conference.server diff --git a/src/xmpp/muc.h b/src/xmpp/muc.h index b5d9a38b..84be1dd2 100644 --- a/src/xmpp/muc.h +++ b/src/xmpp/muc.h @@ -37,10 +37,10 @@ #include -#include "xmpp/contact.h" -#include "xmpp/jid.h" #include "tools/autocomplete.h" #include "ui/win_types.h" +#include "xmpp/contact.h" +#include "xmpp/jid.h" typedef enum { MUC_ROLE_NONE, diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index eed95fe1..84f2873e 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -44,24 +44,25 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif +#include "profanity.h" +#include "log.h" #include "common.h" #include "config/preferences.h" -#include "log.h" -#include "muc.h" -#include "profanity.h" -#include "ui/ui.h" #include "event/server_events.h" +#include "plugins/plugins.h" +#include "ui/ui.h" #include "xmpp/connection.h" #include "xmpp/capabilities.h" #include "xmpp/session.h" #include "xmpp/stanza.h" #include "xmpp/iq.h" #include "xmpp/xmpp.h" -#include "plugins/plugins.h" +#include "xmpp/muc.h" static Autocomplete sub_requests_ac; diff --git a/src/xmpp/roster.c b/src/xmpp/roster.c index 0449499b..7955aef3 100644 --- a/src/xmpp/roster.c +++ b/src/xmpp/roster.c @@ -43,26 +43,26 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif -#include "log.h" -#include "plugins/plugins.h" #include "profanity.h" -#include "ui/ui.h" +#include "log.h" +#include "config/preferences.h" +#include "plugins/plugins.h" #include "event/server_events.h" #include "event/client_events.h" #include "tools/autocomplete.h" -#include "config/preferences.h" +#include "ui/ui.h" #include "xmpp/session.h" #include "xmpp/iq.h" #include "xmpp/connection.h" #include "xmpp/roster.h" -#include "roster_list.h" +#include "xmpp/roster_list.h" #include "xmpp/stanza.h" #include "xmpp/xmpp.h" -#include "plugins/plugins.h" // callback data for group commands typedef struct _group_data { diff --git a/src/xmpp/roster_list.c b/src/xmpp/roster_list.c index 789449c2..057146a2 100644 --- a/src/xmpp/roster_list.c +++ b/src/xmpp/roster_list.c @@ -39,12 +39,12 @@ #include #include -#include "roster_list.h" +#include "config/preferences.h" +#include "tools/autocomplete.h" +#include "xmpp/roster_list.h" #include "xmpp/resource.h" #include "xmpp/contact.h" #include "xmpp/jid.h" -#include "tools/autocomplete.h" -#include "config/preferences.h" typedef struct prof_roster_t { // contacts, indexed on barejid diff --git a/src/xmpp/session.c b/src/xmpp/session.c index 6dc94aef..5c9c3b4c 100644 --- a/src/xmpp/session.c +++ b/src/xmpp/session.c @@ -38,14 +38,11 @@ #include #include -#include "chat_session.h" +#include "profanity.h" +#include "log.h" #include "common.h" #include "config/preferences.h" -#include "jid.h" -#include "log.h" -#include "muc.h" #include "plugins/plugins.h" -#include "profanity.h" #include "event/server_events.h" #include "xmpp/bookmark.h" #include "xmpp/blocking.h" @@ -58,6 +55,9 @@ #include "xmpp/roster.h" #include "xmpp/stanza.h" #include "xmpp/xmpp.h" +#include "xmpp/muc.h" +#include "xmpp/chat_session.h" +#include "xmpp/jid.h" // for auto reconnect static struct { diff --git a/src/xmpp/session.h b/src/xmpp/session.h index dcd276b3..1bc67b63 100644 --- a/src/xmpp/session.h +++ b/src/xmpp/session.h @@ -35,16 +35,7 @@ #ifndef XMPP_SESSION_H #define XMPP_SESSION_H -#include "config.h" - -#ifdef HAVE_LIBMESODE -#include -#endif -#ifdef HAVE_LIBSTROPHE -#include -#endif - -#include "resource.h" +#include void session_login_success(gboolean secured); void session_login_failed(void); diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 9174bcd2..971b7bfc 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -47,6 +47,7 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif @@ -58,8 +59,7 @@ #include "xmpp/capabilities.h" #include "xmpp/connection.h" #include "xmpp/form.h" - -#include "muc.h" +#include "xmpp/muc.h" #if 0 xmpp_stanza_t* diff --git a/src/xmpp/stanza.h b/src/xmpp/stanza.h index 49be2d56..bc649107 100644 --- a/src/xmpp/stanza.h +++ b/src/xmpp/stanza.h @@ -40,6 +40,7 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index b883c139..c34ee60a 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -40,16 +40,17 @@ #ifdef HAVE_LIBMESODE #include #endif + #ifdef HAVE_LIBSTROPHE #include #endif #include "config/accounts.h" #include "config/tlscerts.h" -#include "contact.h" -#include "jid.h" #include "tools/autocomplete.h" #include "tools/http_upload.h" +#include "xmpp/contact.h" +#include "xmpp/jid.h" #define JABBER_PRIORITY_MIN -128 #define JABBER_PRIORITY_MAX 127