mirror of
https://github.com/irssi/irssi.git
synced 2026-08-16 15:12:11 +02:00
implement server-time
This commit is contained in:
parent
33d8cc3254
commit
d535a79730
21 changed files with 323 additions and 39 deletions
|
|
@ -103,3 +103,17 @@ send_message(server, target, msg, target_type)
|
|||
CODE:
|
||||
server->send_message(server, target, msg, target_type);
|
||||
|
||||
void
|
||||
server_meta_stash(server, meta_key, meta_value)
|
||||
Irssi::Server server
|
||||
char *meta_key
|
||||
char *meta_value
|
||||
|
||||
char *
|
||||
server_meta_stash_find(server, meta_key)
|
||||
Irssi::Server server
|
||||
char *meta_key
|
||||
CODE:
|
||||
RETVAL = (char *) server_meta_stash_find(server, meta_key);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
|
|
|||
|
|
@ -199,10 +199,29 @@ static PLAIN_OBJECT_INIT_REC irc_plains[] = {
|
|||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
MODULE = Irssi::Irc PACKAGE = Irssi::Irc
|
||||
MODULE = Irssi::Irc PACKAGE = Irssi::Irc PREFIX = irc_
|
||||
|
||||
PROTOTYPES: ENABLE
|
||||
|
||||
void
|
||||
irc_parse_message_tags(tags)
|
||||
char *tags
|
||||
PREINIT:
|
||||
HV *hv;
|
||||
GHashTable *hash;
|
||||
GHashTableIter iter;
|
||||
char *key;
|
||||
char *val;
|
||||
PPCODE:
|
||||
hv = newHV();
|
||||
hash = irc_parse_message_tags(tags);
|
||||
g_hash_table_iter_init(&iter, hash);
|
||||
while (g_hash_table_iter_next(&iter, (gpointer *) &key, (gpointer *) &val)) {
|
||||
(void) hv_store(hv, key, strlen(key), new_pv(val), 0);
|
||||
}
|
||||
g_hash_table_destroy(hash);
|
||||
XPUSHs(sv_2mortal(newRV_noinc((SV *) hv)));
|
||||
|
||||
void
|
||||
init()
|
||||
PREINIT:
|
||||
|
|
|
|||
|
|
@ -68,3 +68,29 @@ PPCODE:
|
|||
(void) hv_store(hv, "text", 4, new_pv(l->info.text), 0);
|
||||
}
|
||||
XPUSHs(sv_2mortal(newRV_noinc((SV *) hv)));
|
||||
|
||||
void
|
||||
textbuffer_line_get_meta(line)
|
||||
Irssi::TextUI::Line line
|
||||
PREINIT:
|
||||
HV *hv;
|
||||
LINE_REC *l;
|
||||
TEXT_BUFFER_META_REC *m;
|
||||
GHashTableIter iter;
|
||||
char *key;
|
||||
char *val;
|
||||
PPCODE:
|
||||
hv = newHV();
|
||||
l = line->line;
|
||||
if (l->info.meta != NULL) {
|
||||
m = l->info.meta;
|
||||
if (m->hash != NULL) {
|
||||
g_hash_table_iter_init(&iter, m->hash);
|
||||
while (
|
||||
g_hash_table_iter_next(&iter, (gpointer *) &key, (gpointer *) &val)) {
|
||||
(void) hv_store(hv, key, strlen(key), new_pv(val), 0);
|
||||
}
|
||||
}
|
||||
(void) hv_store(hv, "server_time", 11, newSViv(m->server_time), 0);
|
||||
}
|
||||
XPUSHs(sv_2mortal(newRV_noinc((SV *) hv)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue