diff options
author | Timo Sirainen <cras@irssi.org> | 2001-02-17 12:23:18 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-02-17 12:23:18 +0000 |
commit | 513e140bcebce617d6078a9532ab9976437c3ef6 (patch) | |
tree | 2fd89cfb9ba227edbe8c7b819cd12aed402b3a09 | |
parent | e5f12167977baaa520e886395986264443184620 (diff) | |
download | irssi-513e140bcebce617d6078a9532ab9976437c3ef6.zip |
Irssi::command_bind(): Don't run the command twice. Log updated for
log_write_rec()
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1236 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/perl/common/Log.xs | 3 | ||||
-rw-r--r-- | src/perl/perl-signals.c | 16 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/perl/common/Log.xs b/src/perl/common/Log.xs index 5a693c49..3418555b 100644 --- a/src/perl/common/Log.xs +++ b/src/perl/common/Log.xs @@ -52,9 +52,10 @@ log_close(log) Irssi::Log log void -log_write_rec(log, str) +log_write_rec(log, str, level) Irssi::Log log char *str + int level void log_start_logging(log) diff --git a/src/perl/perl-signals.c b/src/perl/perl-signals.c index 16e07444..d4d3fa16 100644 --- a/src/perl/perl-signals.c +++ b/src/perl/perl-signals.c @@ -155,7 +155,8 @@ SIG_FUNC_DECL(2, last); ((rec)->priority == 0 ? sig_func_first : \ (rec)->priority == 1 ? sig_func_default : sig_func_last) -void perl_signal_add_to(const char *signal, const char *func, int priority) +void perl_signal_add_to_int(const char *signal, const char *func, + int priority, int add_signal) { PERL_SIGNAL_REC *rec; GHashTable *table; @@ -180,13 +181,20 @@ void perl_signal_add_to(const char *signal, const char *func, int priority) siglist = g_new0(GSList *, 1); g_hash_table_insert(table, signal_idp, siglist); - signal_add_to_id(MODULE_NAME, priority, rec->signal_id, - perl_signal_get_func(rec)); + if (add_signal) { + signal_add_to_id(MODULE_NAME, priority, rec->signal_id, + perl_signal_get_func(rec)); + } } *siglist = g_slist_append(*siglist, rec); } +void perl_signal_add_to(const char *signal, const char *func, int priority) +{ + perl_signal_add_to_int(signal, func, priority, TRUE); +} + static void perl_signal_destroy(PERL_SIGNAL_REC *rec) { if (strncmp(rec->signal, "command ", 8) == 0) @@ -256,7 +264,7 @@ void perl_command_bind(const char *cmd, const char *category, const char *func) command_bind(cmd, category, sig_func_default); signal = g_strconcat("command ", cmd, NULL); - perl_signal_add(signal, func); + perl_signal_add_to_int(signal, func, 1, FALSE); g_free(signal); } |