1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

fixes .. still not perfect

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@713 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-10-02 01:04:39 +00:00 committed by cras
parent f0b2564809
commit b7ce4dc814
4 changed files with 24 additions and 11 deletions

View File

@ -93,9 +93,9 @@ void fe_common_core_init(void)
theme_register(fecommon_core_formats);
autorun_init();
hilight_text_init();
command_history_init();
completion_init();
hilight_text_init();
keyboard_init();
printtext_init();
fe_channels_init();

View File

@ -63,9 +63,8 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
window_item_window((WI_ITEM_REC *) chanrec)->items->next != NULL)
print_channel = TRUE;
level = MSGLEVEL_PUBLIC |
(color != NULL ? MSGLEVEL_HILIGHT :
(for_me ? MSGLEVEL_HILIGHT : MSGLEVEL_NOHILIGHT));
level = MSGLEVEL_PUBLIC | (for_me || color != NULL ?
MSGLEVEL_HILIGHT : MSGLEVEL_NOHILIGHT);
nickmode = get_nickmode(chanrec, nick);
if (!print_channel) {
@ -103,7 +102,7 @@ static void sig_message_private(SERVER_REC *server, const char *msg,
{
QUERY_REC *query;
query = privmsg_get_query(server, nick, FALSE, MSGLEVEL_MSGS);
query = query_find(server, nick);
printformat(server, nick, MSGLEVEL_MSGS,
query == NULL ? IRCTXT_MSG_PRIVATE :
IRCTXT_MSG_PRIVATE_QUERY, nick, address, msg);
@ -209,8 +208,8 @@ void fe_messages_init(void)
settings_add_bool("lookandfeel", "show_nickmode", TRUE);
settings_add_bool("lookandfeel", "print_active_channel", FALSE);
signal_add("message public", (SIGNAL_FUNC) sig_message_public);
signal_add("message private", (SIGNAL_FUNC) sig_message_private);
signal_add_last("message public", (SIGNAL_FUNC) sig_message_public);
signal_add_last("message private", (SIGNAL_FUNC) sig_message_private);
command_bind_last("msg", NULL, (SIGNAL_FUNC) cmd_msg);
}

View File

@ -262,6 +262,13 @@ static int sig_query_autoclose(void)
return 1;
}
static void sig_message_private(SERVER_REC *server, const char *msg,
const char *nick, const char *address)
{
/* create query window if needed */
privmsg_get_query(server, nick, FALSE, MSGLEVEL_MSGS);
}
static void read_settings(void)
{
querycreate_level = level2bits(settings_get_str("autocreate_query_level"));
@ -288,6 +295,7 @@ void fe_queries_init(void)
signal_add("window item remove", (SIGNAL_FUNC) signal_window_item_removed);
signal_add("server connected", (SIGNAL_FUNC) sig_server_connected);
signal_add("window changed", (SIGNAL_FUNC) sig_window_changed);
signal_add_first("message private", (SIGNAL_FUNC) sig_message_private);
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
command_bind("query", NULL, (SIGNAL_FUNC) cmd_query);
@ -306,6 +314,7 @@ void fe_queries_deinit(void)
signal_remove("window item remove", (SIGNAL_FUNC) signal_window_item_removed);
signal_remove("server connected", (SIGNAL_FUNC) sig_server_connected);
signal_remove("window changed", (SIGNAL_FUNC) sig_window_changed);
signal_remove("message private", (SIGNAL_FUNC) sig_message_private);
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
command_unbind("query", (SIGNAL_FUNC) cmd_query);

View File

@ -32,7 +32,9 @@
static const char *noact_channels;
static void sig_hilight_text(WINDOW_REC *window, SERVER_REC *server, const char *channel, gpointer levelptr, const char *msg)
static void sig_hilight_text(WINDOW_REC *window, SERVER_REC *server,
const char *channel, void *levelptr,
const char *msg)
{
int level, oldlevel, new_data;
@ -40,10 +42,13 @@ static void sig_hilight_text(WINDOW_REC *window, SERVER_REC *server, const char
if (window == active_win || (level & (MSGLEVEL_NEVER|MSGLEVEL_NO_ACT)))
return;
/* hilights and private messages get HILIGHT status,
public messages get MSGS status and rest get TEXT */
new_data = (level & (MSGLEVEL_HILIGHT|MSGLEVEL_MSGS)) ?
NEWDATA_HILIGHT :
((level & MSGLEVEL_PUBLIC) ? NEWDATA_MSG : NEWDATA_TEXT);
/* check that channel isn't in "don't show activity" list */
if (new_data < NEWDATA_HILIGHT &&
channel != NULL && find_substr(noact_channels, channel))
return;
@ -51,7 +56,7 @@ static void sig_hilight_text(WINDOW_REC *window, SERVER_REC *server, const char
oldlevel = window->new_data;
if (window->new_data < new_data) {
window->new_data = new_data;
window->last_color = 0;
window->last_color = hilight_last_nick_color();;
signal_emit("window hilight", 1, window);
}
@ -188,8 +193,8 @@ void window_activity_init(void)
signal_add("window changed", (SIGNAL_FUNC) sig_dehilight_window);
signal_add("window dehilight", (SIGNAL_FUNC) sig_dehilight_window);
signal_add("window item hilight", (SIGNAL_FUNC) sig_hilight_window_item);
signal_add_last("message public", (SIGNAL_FUNC) sig_message_public);
signal_add_last("message private", (SIGNAL_FUNC) sig_message_private);
signal_add("message public", (SIGNAL_FUNC) sig_message_public);
signal_add("message private", (SIGNAL_FUNC) sig_message_private);
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
}