#define CMD_RESTART "RESTART"
#define CMD_RPING "RPING"
#define CMD_RPONG "RPONG"
+#define CMD_SASL "SASL"
#define CMD_SERVER "SERVER"
#define CMD_SERVLIST "SERVLIST"
#define CMD_SERVSET "SERVSET"
#define TOK_RESTART "RESTART"
#define TOK_RPING "RI"
#define TOK_RPONG "RO"
+#define TOK_SASL "SASL"
#define TOK_SERVER "S"
#define TOK_SERVLIST "SERVSET"
#define TOK_SERVSET "SERVSET"
#define P10_RESTART TYPE(RESTART)
#define P10_RPING TYPE(RPING)
#define P10_RPONG TYPE(RPONG)
+#define P10_SASL TYPE(SASL)
#define P10_SERVER CMD_SERVER
#define P10_SERVLIST TYPE(SERVLIST)
#define P10_SERVSET TYPE(SERVSET)
safestrncpy(sident, who->ident, sizeof(shost));
safestrncpy(shost, host, sizeof(shost));
- } else if (IsHiddenHost(who) && (hhtype == 1) && who->handle_info && hhstr) {
+ } else if (IsHiddenHost(who) && ((hhtype == 1) || (hhtype == 3)) && who->handle_info && hhstr) {
snprintf(shost, sizeof(shost), "%s.%s", who->handle_info->handle, hhstr);
- } else if (IsHiddenHost(who) && (hhtype == 2) && who->crypthost[0]) {
+ } else if (IsHiddenHost(who) && ((hhtype == 2) || (hhtype == 3)) && who->crypthost[0]) {
safestrncpy(shost, who->crypthost, sizeof(shost));
} else
safestrncpy(shost, who->hostname, sizeof(shost));
putsock("%s " CMD_SNO " %d :%s", self->numeric, mask, buffer);
}
+void
+irc_sasl(struct server* dest, const char *identifier, const char *subcmd, const char *data)
+{
+ putsock("%s " P10_SASL " %s %s %s %s", self->numeric, dest->numeric, identifier, subcmd, data);
+}
+
static void send_burst(void);
static void
return 1;
}
+static CMD_FUNC(cmd_sasl)
+{
+ struct server *serv;
+
+ if (argc < 5)
+ return 0;
+
+ serv = GetServerH(origin);
+ if (!serv)
+ return 0;
+
+ call_sasl_input_func(serv, argv[2], argv[3], argv[4], (argc>5 ? argv[5] : NULL));
+
+ return 1;
+}
+
static CMD_FUNC(cmd_ping)
{
struct server *srv;
dict_insert(irc_func_dict, CMD_RPONG, cmd_dummy);
dict_insert(irc_func_dict, TOK_RPONG, cmd_dummy);
+ dict_insert(irc_func_dict, CMD_SASL, cmd_sasl);
+ dict_insert(irc_func_dict, TOK_SASL, cmd_sasl);
+
/* In P10, DESTRUCT doesn't do anything except be broadcast to servers.
* Apparently to obliterate channels from any servers that think they
* exist?