mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
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
This commit is contained in:
parent
e5f1216797
commit
513e140bce
@ -52,9 +52,10 @@ log_close(log)
|
|||||||
Irssi::Log log
|
Irssi::Log log
|
||||||
|
|
||||||
void
|
void
|
||||||
log_write_rec(log, str)
|
log_write_rec(log, str, level)
|
||||||
Irssi::Log log
|
Irssi::Log log
|
||||||
char *str
|
char *str
|
||||||
|
int level
|
||||||
|
|
||||||
void
|
void
|
||||||
log_start_logging(log)
|
log_start_logging(log)
|
||||||
|
@ -155,7 +155,8 @@ SIG_FUNC_DECL(2, last);
|
|||||||
((rec)->priority == 0 ? sig_func_first : \
|
((rec)->priority == 0 ? sig_func_first : \
|
||||||
(rec)->priority == 1 ? sig_func_default : sig_func_last)
|
(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;
|
PERL_SIGNAL_REC *rec;
|
||||||
GHashTable *table;
|
GHashTable *table;
|
||||||
@ -180,13 +181,20 @@ void perl_signal_add_to(const char *signal, const char *func, int priority)
|
|||||||
siglist = g_new0(GSList *, 1);
|
siglist = g_new0(GSList *, 1);
|
||||||
g_hash_table_insert(table, signal_idp, siglist);
|
g_hash_table_insert(table, signal_idp, siglist);
|
||||||
|
|
||||||
|
if (add_signal) {
|
||||||
signal_add_to_id(MODULE_NAME, priority, rec->signal_id,
|
signal_add_to_id(MODULE_NAME, priority, rec->signal_id,
|
||||||
perl_signal_get_func(rec));
|
perl_signal_get_func(rec));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*siglist = g_slist_append(*siglist, 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)
|
static void perl_signal_destroy(PERL_SIGNAL_REC *rec)
|
||||||
{
|
{
|
||||||
if (strncmp(rec->signal, "command ", 8) == 0)
|
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);
|
command_bind(cmd, category, sig_func_default);
|
||||||
|
|
||||||
signal = g_strconcat("command ", cmd, NULL);
|
signal = g_strconcat("command ", cmd, NULL);
|
||||||
perl_signal_add(signal, func);
|
perl_signal_add_to_int(signal, func, 1, FALSE);
|
||||||
g_free(signal);
|
g_free(signal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user