1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 02:03:13 +02:00

Add new command /silence

This commit is contained in:
Sebastien Helleu
2010-02-09 12:40:19 +01:00
parent 74d148d056
commit 71d77a5890
17 changed files with 444 additions and 17 deletions
+11 -3
View File
@@ -46,10 +46,12 @@
#include "gui-window.h"
char *gui_chat_buffer = NULL; /* buffer for printf */
char *gui_chat_prefix[GUI_CHAT_NUM_PREFIXES]; /* prefixes */
char gui_chat_prefix_empty[] = ""; /* empty prefix */
char *gui_chat_buffer = NULL; /* buffer for printf */
char *gui_chat_prefix[GUI_CHAT_NUM_PREFIXES]; /* prefixes */
char gui_chat_prefix_empty[] = ""; /* empty prefix */
int gui_chat_time_length = 0; /* length of time for each line (in chars) */
int gui_chat_silent = GUI_CHAT_SILENT_DISABLED; /* silence mode */
struct t_gui_buffer *gui_chat_silent_buffer = NULL; /* buffer for silence */
/*
@@ -452,6 +454,12 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
if (buffer->type != GUI_BUFFER_TYPE_FORMATTED)
return;
}
/* if silent is enabled for buffer (or all buffers), then just return */
if ((gui_chat_silent == GUI_CHAT_SILENT_ALL_BUFFERS)
|| ((gui_chat_silent == GUI_CHAT_SILENT_BUFFER)
&& (gui_chat_silent_buffer == buffer)))
return;
if (!gui_chat_buffer)
gui_chat_buffer = malloc (GUI_CHAT_BUFFER_PRINTF_SIZE);
+10 -1
View File
@@ -31,7 +31,7 @@ struct t_gui_line;
#define GUI_CHAT_TAG_NO_HIGHLIGHT "no_highlight"
enum t_gui_prefix
enum t_gui_chat_prefix
{
GUI_CHAT_PREFIX_ERROR = 0,
GUI_CHAT_PREFIX_NETWORK,
@@ -42,9 +42,18 @@ enum t_gui_prefix
GUI_CHAT_NUM_PREFIXES,
};
enum t_gui_chat_silent
{
GUI_CHAT_SILENT_DISABLED = 0,
GUI_CHAT_SILENT_BUFFER,
GUI_CHAT_SILENT_ALL_BUFFERS,
};
extern char *gui_chat_prefix[GUI_CHAT_NUM_PREFIXES];
extern char gui_chat_prefix_empty[];
extern int gui_chat_time_length;
extern int gui_chat_silent;
extern struct t_gui_buffer *gui_chat_silent_buffer;
/* chat functions */