about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorSteffen Jaeckel <jaeckel-floss@eyet-services.de>2022-12-27 22:53:18 +0100
committerSteffen Jaeckel <jaeckel-floss@eyet-services.de>2023-01-18 20:02:46 +0100
commita0aa26b6fa65ba625f4a6d3495a345c7120ff16d (patch)
tree551898690f72084567206cd95a325a6f16c577ab /src/xmpp
parenta45f05a45e7daceab95af4daa0f661874a3bd057 (diff)
downloadprofani-tty-a0aa26b6fa65ba625f4a6d3495a345c7120ff16d.tar.gz
add `now` option to `/reconnect` command
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/session.c10
-rw-r--r--src/xmpp/session.h1
2 files changed, 5 insertions, 6 deletions
diff --git a/src/xmpp/session.c b/src/xmpp/session.c
index 3bec1ab2..892cbbf2 100644
--- a/src/xmpp/session.c
+++ b/src/xmpp/session.c
@@ -96,8 +96,6 @@ static activity_state_t activity_state;
 static resource_presence_t saved_presence;
 static char* saved_status;
 
-static void _session_reconnect(void);
-
 static void _session_free_internals(void);
 static void _session_free_saved_details(void);
 
@@ -268,12 +266,12 @@ session_process_events(void)
         if ((reconnect_sec != 0) && reconnect_timer) {
             int elapsed_sec = g_timer_elapsed(reconnect_timer, NULL);
             if (elapsed_sec > reconnect_sec) {
-                _session_reconnect();
+                session_reconnect_now();
             }
         }
         break;
     case JABBER_RECONNECT:
-        _session_reconnect();
+        session_reconnect_now();
         break;
     default:
         break;
@@ -557,8 +555,8 @@ session_reconnect(gchar* altdomain, unsigned short altport)
     reconnect.altport = altport;
 }
 
-static void
-_session_reconnect(void)
+void
+session_reconnect_now(void)
 {
     // reconnect with account.
     ProfAccount* account = accounts_get_account(saved_account.name);
diff --git a/src/xmpp/session.h b/src/xmpp/session.h
index d8565fa4..e6facb93 100644
--- a/src/xmpp/session.h
+++ b/src/xmpp/session.h
@@ -47,5 +47,6 @@ void session_init_activity(void);
 void session_check_autoaway(void);
 
 void session_reconnect(gchar* altdomain, unsigned short altport);
+void session_reconnect_now(void);
 
 #endif