1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Move event timeout to connection module

This commit is contained in:
James Booth 2016-07-24 14:08:30 +01:00
parent 8d8f2f290d
commit 0649aad80d
7 changed files with 14 additions and 14 deletions

View File

@ -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();
}

View File

@ -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

View File

@ -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) {

View File

@ -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);

View File

@ -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();

View File

@ -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);

View File

@ -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();