summaryrefslogtreecommitdiff
path: root/src/plugins/relay/irc
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/relay/irc')
-rw-r--r--src/plugins/relay/irc/relay-irc.c13
-rw-r--r--src/plugins/relay/irc/relay-irc.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c
index fea36430c..81f493c78 100644
--- a/src/plugins/relay/irc/relay-irc.c
+++ b/src/plugins/relay/irc/relay-irc.c
@@ -1430,6 +1430,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
weechat_hook_signal_send ("relay_client_auth_ok",
WEECHAT_HOOK_SIGNAL_POINTER,
client);
+ relay_client_set_status (client, RELAY_STATUS_CONNECTED);
}
free (password);
}
@@ -1904,6 +1905,18 @@ relay_irc_alloc_with_infolist (struct t_relay_client *client,
}
/*
+ * Returns the client initial status: it can be "waiting_auth" or "connected",
+ * depending if a password is expected or not.
+ */
+
+enum t_relay_status
+relay_irc_get_initial_status (struct t_relay_client *client)
+{
+ return (RELAY_IRC_DATA(client, password_ok)) ?
+ RELAY_STATUS_CONNECTED : RELAY_STATUS_WAITING_AUTH;
+}
+
+/*
* Frees relay data specific to IRC protocol.
*/
diff --git a/src/plugins/relay/irc/relay-irc.h b/src/plugins/relay/irc/relay-irc.h
index b0de0e786..095fc6691 100644
--- a/src/plugins/relay/irc/relay-irc.h
+++ b/src/plugins/relay/irc/relay-irc.h
@@ -21,6 +21,7 @@
#define WEECHAT_PLUGIN_RELAY_IRC_H
struct t_relay_client;
+enum t_relay_status;
#define RELAY_IRC_DATA(client, var) \
(((struct t_relay_irc_data *)client->protocol_data)->var)
@@ -69,6 +70,7 @@ extern void relay_irc_close_connection (struct t_relay_client *client);
extern void relay_irc_alloc (struct t_relay_client *client);
extern void relay_irc_alloc_with_infolist (struct t_relay_client *client,
struct t_infolist *infolist);
+extern enum t_relay_status relay_irc_get_initial_status (struct t_relay_client *client);
extern void relay_irc_free (struct t_relay_client *client);
extern int relay_irc_add_to_infolist (struct t_infolist_item *item,
struct t_relay_client *client);