mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 18:25:41 +02:00
IRC colors reintroduced
This commit is contained in:
@@ -100,6 +100,7 @@ gui_keyboard_default_bindings ()
|
||||
gui_keyboard_bind (NULL, /* ^S^U */ "ctrl-Sctrl-U", "/input set_unread");
|
||||
gui_keyboard_bind (NULL, /* ^Cb */ "ctrl-Cb", "/input insert \\x02");
|
||||
gui_keyboard_bind (NULL, /* ^Cc */ "ctrl-Cc", "/input insert \\x03");
|
||||
gui_keyboard_bind (NULL, /* ^Cc */ "ctrl-Ci", "/input insert \\x1D");
|
||||
gui_keyboard_bind (NULL, /* ^Co */ "ctrl-Co", "/input insert \\x0F");
|
||||
gui_keyboard_bind (NULL, /* ^Cr */ "ctrl-Cr", "/input insert \\x12");
|
||||
gui_keyboard_bind (NULL, /* ^Cu */ "ctrl-Cu", "/input insert \\x15");
|
||||
|
||||
+154
-171
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,8 @@
|
||||
#ifndef __WEECHAT_IRC_COLOR_H
|
||||
#define __WEECHAT_IRC_COLOR_H 1
|
||||
|
||||
#define IRC_NUM_COLORS 16
|
||||
|
||||
/* shift ncurses colors for compatibility with colors
|
||||
in IRC messages (same as other IRC clients) */
|
||||
|
||||
@@ -51,10 +53,8 @@
|
||||
#define IRC_COLOR_UNDERLINE_CHAR '\x1F'
|
||||
#define IRC_COLOR_UNDERLINE_STR "\x1F"
|
||||
|
||||
extern unsigned char *irc_color_decode (unsigned char *string,
|
||||
int keep_irc_colors,
|
||||
int keep_weechat_attr);
|
||||
extern unsigned char *irc_color_decode_for_user_entry (unsigned char *string);
|
||||
extern unsigned char *irc_color_encode (unsigned char *string, int keep_colors);
|
||||
extern char *irc_color_decode (char *string, int keep_colors);
|
||||
extern char *irc_color_decode_for_user_entry (char *string);
|
||||
extern char *irc_color_encode (char *string, int keep_colors);
|
||||
|
||||
#endif /* irc-color.h */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "../weechat-plugin.h"
|
||||
#include "irc.h"
|
||||
#include "irc-color.h"
|
||||
#include "irc-completion.h"
|
||||
#include "irc-config.h"
|
||||
#include "irc-server.h"
|
||||
@@ -264,6 +265,8 @@ irc_completion_channel_topic_cb (void *data, char *completion,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_weelist *list)
|
||||
{
|
||||
char *topic_color;
|
||||
|
||||
IRC_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -272,7 +275,12 @@ irc_completion_channel_topic_cb (void *data, char *completion,
|
||||
|
||||
if (ptr_channel && ptr_channel->topic && ptr_channel->topic[0])
|
||||
{
|
||||
weechat_list_add (list, ptr_channel->topic, WEECHAT_LIST_POS_SORT);
|
||||
topic_color = irc_color_decode_for_user_entry (ptr_channel->topic);
|
||||
weechat_list_add (list,
|
||||
(topic_color) ? topic_color : ptr_channel->topic,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
if (topic_color)
|
||||
free (topic_color);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
@@ -40,9 +40,13 @@ void
|
||||
irc_input_user_message_display (struct t_gui_buffer *buffer, char *text)
|
||||
{
|
||||
struct t_irc_nick *ptr_nick;
|
||||
char *text_decoded;
|
||||
|
||||
text_decoded = irc_color_decode (text,
|
||||
weechat_config_boolean (irc_config_network_colors_send));
|
||||
|
||||
IRC_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
|
||||
if (ptr_channel)
|
||||
{
|
||||
if ((ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE)
|
||||
@@ -52,7 +56,7 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, char *text)
|
||||
"%s%s",
|
||||
irc_nick_as_prefix (NULL, ptr_server->nick,
|
||||
IRC_COLOR_CHAT_NICK_SELF),
|
||||
text);
|
||||
(text_decoded) ? text_decoded : text);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -63,7 +67,7 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, char *text)
|
||||
"%s%s",
|
||||
irc_nick_as_prefix (ptr_nick, NULL,
|
||||
IRC_COLOR_CHAT_NICK_SELF),
|
||||
text);
|
||||
(text_decoded) ? text_decoded : text);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -74,6 +78,9 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, char *text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (text_decoded)
|
||||
free (text_decoded);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -157,8 +164,8 @@ irc_input_data_cb (void *data, struct t_gui_buffer *buffer, char *input_data)
|
||||
|
||||
if (ptr_channel)
|
||||
{
|
||||
data_with_colors = (char *)irc_color_encode ((unsigned char *)input_data,
|
||||
weechat_config_boolean (irc_config_network_colors_send));
|
||||
data_with_colors = irc_color_encode (input_data,
|
||||
weechat_config_boolean (irc_config_network_colors_send));
|
||||
|
||||
if (ptr_channel->dcc_chat)
|
||||
{
|
||||
|
||||
+137
-123
File diff suppressed because it is too large
Load Diff
@@ -52,6 +52,7 @@ struct t_irc_protocol_msg
|
||||
{
|
||||
char *name; /* IRC message name */
|
||||
char *description; /* message description */
|
||||
int decode_color; /* decode color before calling function */
|
||||
t_irc_recv_func *recv_function; /* function called when msg is received */
|
||||
};
|
||||
|
||||
|
||||
@@ -1632,8 +1632,7 @@ irc_server_msgq_flush ()
|
||||
|
||||
/* parse and execute command */
|
||||
irc_protocol_recv_command (irc_recv_msgq->server,
|
||||
(msg_decoded) ?
|
||||
msg_decoded : ptr_msg,
|
||||
(msg_decoded) ? msg_decoded : ptr_msg,
|
||||
host,
|
||||
command,
|
||||
arguments);
|
||||
|
||||
+77
-40
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user