mirror of
https://github.com/irssi/irssi.git
synced 2026-08-16 23:22:16 +02:00
introduce the type Irssi::Irc::Client and signals to communicate with proxy
clients to allow for scripting parts of the irssi-proxy. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4882 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
73b18f2672
commit
f8461d39bc
13 changed files with 94 additions and 23 deletions
|
|
@ -100,6 +100,7 @@ irc_sources = \
|
|||
irc/Modes.xs \
|
||||
irc/Netsplit.xs \
|
||||
irc/Notifylist.xs \
|
||||
irc/Client.xs \
|
||||
irc/Makefile.PL.in \
|
||||
irc/typemap \
|
||||
irc/module.h
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ while (<STDIN>) {
|
|||
s/DCC_REC[^,]*/siobject/g;
|
||||
s/AUTOIGNORE_REC[^,]*/Irssi::Irc::Autoignore/g;
|
||||
s/NOTIFYLIST_REC[^,]*/Irssi::Irc::Notifylist/g;
|
||||
s/CLIENT_REC[^,]*/Irssi::Irc::Client/g;
|
||||
|
||||
# fe-common
|
||||
s/THEME_REC[^,]*/Irssi::UI::Theme/g;
|
||||
|
|
|
|||
5
src/perl/irc/Client.xs
Normal file
5
src/perl/irc/Client.xs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include "module.h"
|
||||
|
||||
MODULE = Irssi::Irc::Client PACKAGE = Irssi::Irc
|
||||
PROTOTYPES: ENABLE
|
||||
|
||||
|
|
@ -144,6 +144,19 @@ static void perl_notifylist_fill_hash(HV *hv, NOTIFYLIST_REC *notify)
|
|||
hv_store(hv, "ircnets", 7, newRV_noinc((SV*)av), 0);
|
||||
}
|
||||
|
||||
static void perl_client_fill_hash(HV *hv, CLIENT_REC *client)
|
||||
{
|
||||
hv_store(hv, "nick", 4, new_pv(client->nick), 0);
|
||||
hv_store(hv, "host", 4, new_pv(client->host), 0);
|
||||
hv_store(hv, "proxy_address", 13, new_pv(client->proxy_address), 0);
|
||||
hv_store(hv, "server", 6, iobject_bless(client->server), 0);
|
||||
hv_store(hv, "pass_sent", 9, newSViv(client->pass_sent), 0);
|
||||
hv_store(hv, "user_sent", 9, newSViv(client->user_sent), 0);
|
||||
hv_store(hv, "connected", 9, newSViv(client->connected), 0);
|
||||
hv_store(hv, "want_ctcp", 9, newSViv(client->want_ctcp), 0);
|
||||
hv_store(hv, "ircnet", 6, new_pv(client->listen->ircnet), 0);
|
||||
}
|
||||
|
||||
static PLAIN_OBJECT_INIT_REC irc_plains[] = {
|
||||
{ "Irssi::Irc::Ban", (PERL_OBJECT_FUNC) perl_ban_fill_hash },
|
||||
{ "Irssi::Irc::Dcc", (PERL_OBJECT_FUNC) perl_dcc_fill_hash },
|
||||
|
|
@ -151,6 +164,7 @@ static PLAIN_OBJECT_INIT_REC irc_plains[] = {
|
|||
{ "Irssi::Irc::Netsplitserver", (PERL_OBJECT_FUNC) perl_netsplit_server_fill_hash },
|
||||
{ "Irssi::Irc::Netsplitchannel", (PERL_OBJECT_FUNC) perl_netsplit_channel_fill_hash },
|
||||
{ "Irssi::Irc::Notifylist", (PERL_OBJECT_FUNC) perl_notifylist_fill_hash },
|
||||
{ "Irssi::Irc::Client", (PERL_OBJECT_FUNC) perl_client_fill_hash },
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
|
@ -209,3 +223,4 @@ BOOT:
|
|||
irssi_boot(Irc__Notifylist);
|
||||
irssi_boot(Irc__Query);
|
||||
irssi_boot(Irc__Server);
|
||||
irssi_boot(Irc__Client);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
#include "dcc/dcc-send.h"
|
||||
#include "notifylist/notifylist.h"
|
||||
|
||||
#include "proxy/proxy.h"
|
||||
|
||||
typedef IRC_SERVER_REC *Irssi__Irc__Server;
|
||||
typedef IRC_SERVER_CONNECT_REC *Irssi__Irc__Connect;
|
||||
typedef IRC_CHANNEL_REC *Irssi__Irc__Channel;
|
||||
|
|
@ -35,3 +37,5 @@ typedef NETSPLIT_REC *Irssi__Irc__Netsplit;
|
|||
typedef NETSPLIT_SERVER_REC *Irssi__Irc__Netsplitserver;
|
||||
typedef NETSPLIT_CHAN_REC *Irssi__Irc__Netsplitchannel;
|
||||
typedef NOTIFYLIST_REC *Irssi__Irc__Notifylist;
|
||||
|
||||
typedef CLIENT_REC *Irssi__Irc__Client;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ Irssi::Irc::Netsplit T_PlainObj
|
|||
Irssi::Irc::Netsplitserver T_PlainObj
|
||||
Irssi::Irc::Netsplitchannel T_PlainObj
|
||||
Irssi::Irc::Notifylist T_PlainObj
|
||||
Irssi::Irc::Client T_IrssiObj
|
||||
|
||||
INPUT
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue