mirror of
https://github.com/irssi/irssi.git
synced 2025-04-26 13:01:11 -05:00
Rename cap_* funcs to irc_cap_*
Some systems often "namespace" cap_ for themselves, and so irssi's usage can conflict with their own. Bump ABI for this.
This commit is contained in:
parent
795e7ec162
commit
a634b34ba4
@ -6,7 +6,7 @@
|
|||||||
#define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */
|
#define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */
|
||||||
#define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */
|
#define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */
|
||||||
|
|
||||||
#define IRSSI_ABI_VERSION 18
|
#define IRSSI_ABI_VERSION 19
|
||||||
|
|
||||||
#define DEFAULT_SERVER_ADD_PORT 6667
|
#define DEFAULT_SERVER_ADD_PORT 6667
|
||||||
#define DEFAULT_SERVER_ADD_TLS_PORT 6697
|
#define DEFAULT_SERVER_ADD_TLS_PORT 6697
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "irc-cap.h"
|
#include "irc-cap.h"
|
||||||
#include "irc-servers.h"
|
#include "irc-servers.h"
|
||||||
|
|
||||||
int cap_toggle (IRC_SERVER_REC *server, char *cap, int enable)
|
int irc_cap_toggle (IRC_SERVER_REC *server, char *cap, int enable)
|
||||||
{
|
{
|
||||||
if (cap == NULL || *cap == '\0')
|
if (cap == NULL || *cap == '\0')
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -65,7 +65,7 @@ int cap_toggle (IRC_SERVER_REC *server, char *cap, int enable)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cap_finish_negotiation (IRC_SERVER_REC *server)
|
void irc_cap_finish_negotiation (IRC_SERVER_REC *server)
|
||||||
{
|
{
|
||||||
if (server->cap_complete)
|
if (server->cap_complete)
|
||||||
return;
|
return;
|
||||||
@ -130,7 +130,7 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add
|
|||||||
}
|
}
|
||||||
/* Malformed request, terminate the negotiation */
|
/* Malformed request, terminate the negotiation */
|
||||||
else {
|
else {
|
||||||
cap_finish_negotiation(server);
|
irc_cap_finish_negotiation(server);
|
||||||
g_warn_if_reached();
|
g_warn_if_reached();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -177,7 +177,7 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add
|
|||||||
if (multiline == FALSE) {
|
if (multiline == FALSE) {
|
||||||
/* No CAP has been requested */
|
/* No CAP has been requested */
|
||||||
if (server->cap_queue == NULL) {
|
if (server->cap_queue == NULL) {
|
||||||
cap_finish_negotiation(server);
|
irc_cap_finish_negotiation(server);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cmd = g_string_new("CAP REQ :");
|
cmd = g_string_new("CAP REQ :");
|
||||||
@ -204,7 +204,7 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add
|
|||||||
signal_emit("server cap req", 2, server, cmd->str + sizeof("CAP REQ :") - 1);
|
signal_emit("server cap req", 2, server, cmd->str + sizeof("CAP REQ :") - 1);
|
||||||
irc_send_cmd_now(server, cmd->str);
|
irc_send_cmd_now(server, cmd->str);
|
||||||
} else {
|
} else {
|
||||||
cap_finish_negotiation(server);
|
irc_cap_finish_negotiation(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_string_free(cmd, TRUE);
|
g_string_free(cmd, TRUE);
|
||||||
@ -233,7 +233,7 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add
|
|||||||
* negotiation, unless sasl was requested. In this case we must not terminate the negotiation
|
* negotiation, unless sasl was requested. In this case we must not terminate the negotiation
|
||||||
* until the sasl handshake is over. */
|
* until the sasl handshake is over. */
|
||||||
if (got_sasl == FALSE)
|
if (got_sasl == FALSE)
|
||||||
cap_finish_negotiation(server);
|
irc_cap_finish_negotiation(server);
|
||||||
}
|
}
|
||||||
else if (!g_ascii_strcasecmp(evt, "NAK")) {
|
else if (!g_ascii_strcasecmp(evt, "NAK")) {
|
||||||
g_warning("The server answered with a NAK to our CAP request, this should not happen");
|
g_warning("The server answered with a NAK to our CAP request, this should not happen");
|
||||||
@ -302,7 +302,7 @@ void irc_cap_init (void)
|
|||||||
signal_add_first("event 410", (SIGNAL_FUNC) event_invalid_cap);
|
signal_add_first("event 410", (SIGNAL_FUNC) event_invalid_cap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cap_deinit (void)
|
void irc_cap_deinit (void)
|
||||||
{
|
{
|
||||||
signal_remove("event cap", (SIGNAL_FUNC) event_cap);
|
signal_remove("event cap", (SIGNAL_FUNC) event_cap);
|
||||||
signal_remove("event 410", (SIGNAL_FUNC) event_invalid_cap);
|
signal_remove("event 410", (SIGNAL_FUNC) event_invalid_cap);
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
/* this is prefixed as to not conflict with an AIX/i function in their stdlib */
|
/* this is prefixed as to not conflict with an AIX/i function in their stdlib */
|
||||||
void irc_cap_init(void);
|
void irc_cap_init(void);
|
||||||
void cap_deinit(void);
|
void irc_cap_deinit(void);
|
||||||
int cap_toggle (IRC_SERVER_REC *server, char *cap, int enable);
|
int irc_cap_toggle (IRC_SERVER_REC *server, char *cap, int enable);
|
||||||
void cap_finish_negotiation (IRC_SERVER_REC *server);
|
void irc_cap_finish_negotiation (IRC_SERVER_REC *server);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -131,7 +131,7 @@ void irc_core_deinit(void)
|
|||||||
signal_emit("chat protocol deinit", 1, chat_protocol_find("IRC"));
|
signal_emit("chat protocol deinit", 1, chat_protocol_find("IRC"));
|
||||||
|
|
||||||
sasl_deinit();
|
sasl_deinit();
|
||||||
cap_deinit();
|
irc_cap_deinit();
|
||||||
irc_expandos_deinit();
|
irc_expandos_deinit();
|
||||||
netsplit_deinit();
|
netsplit_deinit();
|
||||||
lag_deinit();
|
lag_deinit();
|
||||||
|
@ -236,9 +236,9 @@ static void server_init(IRC_SERVER_REC *server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (conn->sasl_mechanism != SASL_MECHANISM_NONE)
|
if (conn->sasl_mechanism != SASL_MECHANISM_NONE)
|
||||||
cap_toggle(server, "sasl", TRUE);
|
irc_cap_toggle(server, "sasl", TRUE);
|
||||||
|
|
||||||
cap_toggle(server, "multi-prefix", TRUE);
|
irc_cap_toggle(server, "multi-prefix", TRUE);
|
||||||
|
|
||||||
irc_send_cmd_now(server, "CAP LS");
|
irc_send_cmd_now(server, "CAP LS");
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ static gboolean sasl_timeout(IRC_SERVER_REC *server)
|
|||||||
{
|
{
|
||||||
/* The authentication timed out, we can't do much beside terminating it */
|
/* The authentication timed out, we can't do much beside terminating it */
|
||||||
irc_send_cmd_now(server, "AUTHENTICATE *");
|
irc_send_cmd_now(server, "AUTHENTICATE *");
|
||||||
cap_finish_negotiation(server);
|
irc_cap_finish_negotiation(server);
|
||||||
|
|
||||||
server->sasl_timeout = 0;
|
server->sasl_timeout = 0;
|
||||||
server->sasl_success = FALSE;
|
server->sasl_success = FALSE;
|
||||||
@ -96,7 +96,7 @@ static void sasl_fail(IRC_SERVER_REC *server, const char *data, const char *from
|
|||||||
signal_emit("server sasl failure", 2, server, error);
|
signal_emit("server sasl failure", 2, server, error);
|
||||||
|
|
||||||
/* Terminate the negotiation */
|
/* Terminate the negotiation */
|
||||||
cap_finish_negotiation(server);
|
irc_cap_finish_negotiation(server);
|
||||||
|
|
||||||
g_free(params);
|
g_free(params);
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ static void sasl_already(IRC_SERVER_REC *server, const char *data, const char *f
|
|||||||
signal_emit("server sasl success", 1, server);
|
signal_emit("server sasl success", 1, server);
|
||||||
|
|
||||||
/* We're already authenticated, do nothing */
|
/* We're already authenticated, do nothing */
|
||||||
cap_finish_negotiation(server);
|
irc_cap_finish_negotiation(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sasl_success(IRC_SERVER_REC *server, const char *data, const char *from)
|
static void sasl_success(IRC_SERVER_REC *server, const char *data, const char *from)
|
||||||
@ -122,7 +122,7 @@ static void sasl_success(IRC_SERVER_REC *server, const char *data, const char *f
|
|||||||
signal_emit("server sasl success", 1, server);
|
signal_emit("server sasl success", 1, server);
|
||||||
|
|
||||||
/* The authentication succeeded, time to finish the CAP negotiation */
|
/* The authentication succeeded, time to finish the CAP negotiation */
|
||||||
cap_finish_negotiation(server);
|
irc_cap_finish_negotiation(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -263,7 +263,7 @@ static void sasl_step_complete(IRC_SERVER_REC *server, GString *data)
|
|||||||
static void sasl_step_fail(IRC_SERVER_REC *server)
|
static void sasl_step_fail(IRC_SERVER_REC *server)
|
||||||
{
|
{
|
||||||
irc_send_cmd_now(server, "AUTHENTICATE *");
|
irc_send_cmd_now(server, "AUTHENTICATE *");
|
||||||
cap_finish_negotiation(server);
|
irc_cap_finish_negotiation(server);
|
||||||
|
|
||||||
sasl_timeout_stop(server);
|
sasl_timeout_stop(server);
|
||||||
|
|
||||||
|
@ -155,6 +155,6 @@ irc_server_cap_toggle(server, cap, enable)
|
|||||||
char *cap
|
char *cap
|
||||||
int enable
|
int enable
|
||||||
CODE:
|
CODE:
|
||||||
RETVAL = cap_toggle(server, cap, enable);
|
RETVAL = irc_cap_toggle(server, cap, enable);
|
||||||
OUTPUT:
|
OUTPUT:
|
||||||
RETVAL
|
RETVAL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user