mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 13:26:22 +00:00
add now option to /reconnect command
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
@@ -1936,11 +1936,13 @@ static const struct cmd_t command_defs[] = {
|
||||
CMD_TAGS(
|
||||
CMD_TAG_CONNECTION)
|
||||
CMD_SYN(
|
||||
"/reconnect <seconds>")
|
||||
"/reconnect <seconds>",
|
||||
"/reconnect now")
|
||||
CMD_DESC(
|
||||
"Set the reconnect attempt interval for when the connection is lost.")
|
||||
"Set the reconnect attempt interval for when the connection is lost or immediately trigger a reconnect.")
|
||||
CMD_ARGS(
|
||||
{ "<seconds>", "Number of seconds before attempting to reconnect, a value of 0 disables reconnect." })
|
||||
{ "<seconds>", "Number of seconds before attempting to reconnect, a value of 0 disables reconnect." },
|
||||
{ "now", "Immediately trigger a reconnect." })
|
||||
},
|
||||
|
||||
{ CMD_PREAMBLE("/autoping",
|
||||
|
||||
@@ -82,16 +82,17 @@
|
||||
#include "plugins/plugins.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui/window_list.h"
|
||||
#include "xmpp/xmpp.h"
|
||||
#include "xmpp/avatar.h"
|
||||
#include "xmpp/chat_session.h"
|
||||
#include "xmpp/connection.h"
|
||||
#include "xmpp/contact.h"
|
||||
#include "xmpp/roster_list.h"
|
||||
#include "xmpp/jid.h"
|
||||
#include "xmpp/muc.h"
|
||||
#include "xmpp/chat_session.h"
|
||||
#include "xmpp/avatar.h"
|
||||
#include "xmpp/roster_list.h"
|
||||
#include "xmpp/session.h"
|
||||
#include "xmpp/stanza.h"
|
||||
#include "xmpp/vcard_funcs.h"
|
||||
#include "xmpp/xmpp.h"
|
||||
|
||||
#ifdef HAVE_LIBOTR
|
||||
#include "otr/otr.h"
|
||||
@@ -6539,8 +6540,9 @@ cmd_reconnect(ProfWin* window, const char* const command, gchar** args)
|
||||
|
||||
int intval = 0;
|
||||
char* err_msg = NULL;
|
||||
gboolean res = strtoi_range(value, &intval, 0, INT_MAX, &err_msg);
|
||||
if (res) {
|
||||
if (g_strcmp0(value, "now") == 0) {
|
||||
session_reconnect_now();
|
||||
} else if (strtoi_range(value, &intval, 0, INT_MAX, &err_msg)) {
|
||||
prefs_set_reconnect(intval);
|
||||
if (intval == 0) {
|
||||
cons_show("Reconnect disabled.", intval);
|
||||
|
||||
Reference in New Issue
Block a user