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:
+11
-3
@@ -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
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user