about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-07-24 14:08:30 +0100
committerJames Booth <boothj5@gmail.com>2016-07-24 14:08:30 +0100
commit0649aad80d9d76e793801e105e021a7175bb64a1 (patch)
tree0d850ced185cd7ad46b77ed025c524fac748231e /src
parent8d8f2f290d5d78d130d2db7c6fad90af2f031877 (diff)
downloadprofani-tty-0649aad80d9d76e793801e105e021a7175bb64a1.tar.gz
Move event timeout to connection module
Diffstat (limited to 'src')
-rw-r--r--src/config/scripts.c2
-rw-r--r--src/profanity.c2
-rw-r--r--src/xmpp/connection.c8
-rw-r--r--src/xmpp/connection.h1
-rw-r--r--src/xmpp/session.c11
-rw-r--r--src/xmpp/xmpp.h2
6 files changed, 13 insertions, 13 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
@@ -91,6 +91,12 @@ connection_init(void)
 }
 
 void
+connection_check_events(void)
+{
+    xmpp_run_once(conn.xmpp_ctx, 10);
+}
+
+void
 connection_shutdown(void)
 {
     connection_clear_data();
@@ -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 <string.h>
 #include <stdlib.h>
 
-#ifdef HAVE_LIBMESODE
-#include <mesode.h>
-#endif
-#ifdef HAVE_LIBSTROPHE
-#include <strophe.h>
-#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);