1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Merge pull request #542 from LemonBoy/xs-add

Expose the CAP fields to the perl scripts.
This commit is contained in:
ailin-nemui 2016-09-22 17:10:33 +02:00 committed by GitHub
commit 31044ec004
3 changed files with 30 additions and 5 deletions

View File

@ -11,6 +11,9 @@ static void perl_irc_connect_fill_hash(HV *hv, IRC_SERVER_CONNECT_REC *conn)
static void perl_irc_server_fill_hash(HV *hv, IRC_SERVER_REC *server) static void perl_irc_server_fill_hash(HV *hv, IRC_SERVER_REC *server)
{ {
AV *av;
GSList *tmp;
perl_irc_connect_fill_hash(hv, server->connrec); perl_irc_connect_fill_hash(hv, server->connrec);
perl_server_fill_hash(hv, (SERVER_REC *) server); perl_server_fill_hash(hv, (SERVER_REC *) server);
@ -27,6 +30,18 @@ static void perl_irc_server_fill_hash(HV *hv, IRC_SERVER_REC *server)
(void) hv_store(hv, "max_modes_in_cmd", 16, newSViv(server->max_modes_in_cmd), 0); (void) hv_store(hv, "max_modes_in_cmd", 16, newSViv(server->max_modes_in_cmd), 0);
(void) hv_store(hv, "max_whois_in_cmd", 16, newSViv(server->max_whois_in_cmd), 0); (void) hv_store(hv, "max_whois_in_cmd", 16, newSViv(server->max_whois_in_cmd), 0);
(void) hv_store(hv, "isupport_sent", 13, newSViv(server->isupport_sent), 0); (void) hv_store(hv, "isupport_sent", 13, newSViv(server->isupport_sent), 0);
(void) hv_store(hv, "cap_complete", 12, newSViv(server->cap_complete), 0);
av = newAV();
for (tmp = server->cap_supported; tmp != NULL; tmp = tmp->next)
av_push(av, new_pv(tmp->data));
(void) hv_store(hv, "cap_supported", 13, newRV_noinc((SV*)av), 0);
av = newAV();
for (tmp = server->cap_active; tmp != NULL; tmp = tmp->next)
av_push(av, new_pv(tmp->data));
(void) hv_store(hv, "cap_active", 10, newRV_noinc((SV*)av), 0);
} }
static void perl_ban_fill_hash(HV *hv, BAN_REC *ban) static void perl_ban_fill_hash(HV *hv, BAN_REC *ban)

View File

@ -149,3 +149,12 @@ CODE:
OUTPUT: OUTPUT:
RETVAL RETVAL
int
irc_server_cap_toggle(server, cap, enable)
Irssi::Irc::Server server
char *cap
int enable
CODE:
RETVAL = cap_toggle(server, cap, enable);
OUTPUT:
RETVAL

View File

@ -6,6 +6,7 @@
#include "irc-queries.h" #include "irc-queries.h"
#include "irc-nicklist.h" #include "irc-nicklist.h"
#include "irc-masks.h" #include "irc-masks.h"
#include "irc-cap.h"
#include "bans.h" #include "bans.h"
#include "modes.h" #include "modes.h"