mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 05:16:38 +02:00
Buffers timestamp can now be changed (new option in config file)
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-04-03
|
||||
ChangeLog - 2005-04-09
|
||||
|
||||
|
||||
Version 0.1.2 (under dev!):
|
||||
* buffers timestamp can now be changed (new option in config file)
|
||||
* fixed crash when purging old DCC
|
||||
* fixed crash with 64-bits arch (like AMD64) when converting UTF-8
|
||||
* added missing IRC commands (307)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
@title WeeChat - User guide
|
||||
@subtitle Fast, light and extensible IRC client
|
||||
@subtitle Documentation for WeeChat v0.1.1 - March, 20 2005
|
||||
@subtitle Documentation for WeeChat v0.1.2-cvs - April, 09 2005
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -270,6 +270,9 @@ Type: string (any string), default value: ''@*
|
||||
@item look_charset_internal
|
||||
Internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)@*
|
||||
Type: string (any string), default value: 'ISO-8859-1'@*
|
||||
@item look_buffer_timestamp
|
||||
Timestamp for buffers@*
|
||||
Type: string (any string), default value: '[%H:%M:%S]'@*
|
||||
@item look_color_nicks
|
||||
Display nick names with different colors@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@@ -498,6 +501,9 @@ Type: integer (values: between 0 and 2147483647), default value: 1@*
|
||||
@item irc_lag_disconnect
|
||||
Disconnect after important lag (in minutes, 0 = never disconnect)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 5@*
|
||||
@item irc_fifo_pipe
|
||||
Create a FIFO pipe for remote control@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item dcc_auto_accept_files
|
||||
Automatically accept incoming dcc files@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
@title WeeChat - Gui@'on de usuario.
|
||||
@subtitle Cliente IRC r@'apido, peque@~no y extensible
|
||||
@subtitle Documentaci@'on para WeeChat v0.1.1 - 20 de marzo de 2005
|
||||
@subtitle Documentaci@'on para WeeChat v0.1.2 - 9 de abril de 2005
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -269,6 +269,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@item look_charset_internal
|
||||
Juego de caracteres interno de WeeChat, deber@'ia ser ISO-xxxx aunque el locale sea UTF-8 (si no se especifica, se utiliza el juego de caracteres local)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: 'ISO-8859-1'@*
|
||||
@item look_buffer_timestamp
|
||||
Fecha y hora para las búfers@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '[%H:%M:%S]'@*
|
||||
@item look_color_nicks
|
||||
Mostrar nombres de usuario con colores diferentes@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@@ -498,7 +501,7 @@ Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 1@*
|
||||
Desconexi@'on tras un lag importante (en minutos, 0 = no desconectar nunca)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 5@*
|
||||
@item irc_fifo_pipe
|
||||
Create a FIFO pipe for remote control@*
|
||||
Crea una tuber@'ia FIFO para control remoto@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item dcc_auto_accept_files
|
||||
Aceptar autom@'aticamente los ficheros dcc entrantes@*
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
@title WeeChat - Guide utilisateur
|
||||
@subtitle Client IRC rapide, l@'eger et extensible
|
||||
@subtitle Documentation pour WeeChat v0.1.1 - 20 Mars 2005
|
||||
@subtitle Documentation pour WeeChat v0.1.2-cvs - 9 Avril 2005
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -270,6 +270,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item look_charset_internal
|
||||
Jeu de caract@`eres interne @`a WeeChat, devrait @^etre ISO-xxxx m@^eme si la locale est UTF-8 (si non renseign@'e, le jeu de caract@`eres local est utilis@'e)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'ISO-8859-1'@*
|
||||
@item look_buffer_timestamp
|
||||
Horodatage pour les tampons@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '[%H:%M:%S]'@*
|
||||
@item look_color_nicks
|
||||
Afficher les utilisateurs avec diff@'erentes couleurs@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
@title WeeChat - Guia do Utilizador
|
||||
@subtitle Cliente de IRC rapido, leve e extencivel
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.1 - 20 de Mar@,{c}o de 2005
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.2-cvs - 9 de Abril de 2005
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
|
||||
+387
-379
File diff suppressed because it is too large
Load Diff
@@ -66,6 +66,7 @@ char *cfg_look_weechat_slogan;
|
||||
char *cfg_look_charset_decode;
|
||||
char *cfg_look_charset_encode;
|
||||
char *cfg_look_charset_internal;
|
||||
char *cfg_look_buffer_timestamp;
|
||||
int cfg_look_color_nicks;
|
||||
int cfg_look_color_actions;
|
||||
int cfg_look_remove_colors_from_msgs;
|
||||
@@ -112,6 +113,10 @@ t_config_option weechat_options_look[] =
|
||||
N_("internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"ISO-8859-1", NULL, NULL, &cfg_look_charset_internal, config_change_buffer_content },
|
||||
{ "look_buffer_timestamp", N_("timestamp for buffers"),
|
||||
N_("timestamp for buffers"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"[%H:%M:%S]", NULL, NULL, &cfg_look_buffer_timestamp, config_change_buffer_content },
|
||||
{ "look_color_nicks", N_("display nick names with different colors"),
|
||||
N_("display nick names with different colors"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
|
||||
@@ -83,6 +83,7 @@ extern char *cfg_look_weechat_slogan;
|
||||
extern char *cfg_look_charset_decode;
|
||||
extern char *cfg_look_charset_encode;
|
||||
extern char *cfg_look_charset_internal;
|
||||
extern char *cfg_look_buffer_timestamp;
|
||||
extern int cfg_look_color_nicks;
|
||||
extern int cfg_look_color_actions;
|
||||
extern int cfg_look_remove_colors_from_msgs;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
#include <ncurses.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
@@ -1314,7 +1315,7 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
|
||||
t_gui_window *ptr_win;
|
||||
time_t time_seconds;
|
||||
struct tm *local_time;
|
||||
char text[1024 + 1];
|
||||
char text_time[1024 + 1];
|
||||
|
||||
/* make gcc happy */
|
||||
(void) buffer;
|
||||
@@ -1339,9 +1340,9 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
|
||||
local_time = localtime (&time_seconds);
|
||||
if (local_time)
|
||||
{
|
||||
strftime (text, 1024, cfg_look_infobar_timestamp, local_time);
|
||||
strftime (text_time, 1024, cfg_look_infobar_timestamp, local_time);
|
||||
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
|
||||
wprintw (ptr_win->win_infobar, "%s", text);
|
||||
wprintw (ptr_win->win_infobar, "%s", text_time);
|
||||
}
|
||||
if (gui_infobar)
|
||||
{
|
||||
@@ -2424,7 +2425,11 @@ void
|
||||
gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message, ...)
|
||||
{
|
||||
static char buf[8192];
|
||||
char timestamp[16];
|
||||
char text_time[1024 + 1];
|
||||
char text_time_char[2];
|
||||
time_t time_seconds;
|
||||
struct tm *local_time;
|
||||
int time_first_digit, time_last_digit;
|
||||
char *pos, *buf2, *buf3;
|
||||
int i, j;
|
||||
va_list argptr;
|
||||
@@ -2503,19 +2508,52 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
|
||||
pos = buf3 - 1;
|
||||
while (pos)
|
||||
{
|
||||
/* TODO: read timestamp format from config! */
|
||||
if ((!buffer->last_line) || (buffer->line_complete))
|
||||
{
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "[");
|
||||
snprintf (timestamp, 16, "%02d", date_tmp->tm_hour);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
|
||||
snprintf (timestamp, 16, "%02d", date_tmp->tm_min);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
|
||||
snprintf (timestamp, 16, "%02d", date_tmp->tm_sec);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "] ");
|
||||
time_seconds = time (NULL);
|
||||
local_time = localtime (&time_seconds);
|
||||
strftime (text_time, 1024, cfg_look_buffer_timestamp, local_time);
|
||||
|
||||
time_first_digit = -1;
|
||||
time_last_digit = -1;
|
||||
i = 0;
|
||||
while (text_time[i])
|
||||
{
|
||||
if (isdigit (text_time[i]))
|
||||
{
|
||||
if (time_first_digit == -1)
|
||||
time_first_digit = i;
|
||||
time_last_digit = i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
text_time_char[1] = '\0';
|
||||
i = 0;
|
||||
while (text_time[i])
|
||||
{
|
||||
text_time_char[0] = text_time[i];
|
||||
if (time_first_digit < 0)
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
|
||||
text_time_char);
|
||||
else
|
||||
{
|
||||
if ((i < time_first_digit) || (i > time_last_digit))
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK,
|
||||
text_time_char);
|
||||
else
|
||||
{
|
||||
if (isdigit (text_time[i]))
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
|
||||
text_time_char);
|
||||
else
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP,
|
||||
text_time_char);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, " ");
|
||||
}
|
||||
gui_add_message (buffer, type, color, pos + 1);
|
||||
pos = strchr (pos + 1, '\n');
|
||||
|
||||
+2
-1
@@ -1,10 +1,11 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-04-03
|
||||
ChangeLog - 2005-04-09
|
||||
|
||||
|
||||
Version 0.1.2 (under dev!):
|
||||
* buffers timestamp can now be changed (new option in config file)
|
||||
* fixed crash when purging old DCC
|
||||
* fixed crash with 64-bits arch (like AMD64) when converting UTF-8
|
||||
* added missing IRC commands (307)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
@title WeeChat - User guide
|
||||
@subtitle Fast, light and extensible IRC client
|
||||
@subtitle Documentation for WeeChat v0.1.1 - March, 20 2005
|
||||
@subtitle Documentation for WeeChat v0.1.2-cvs - April, 09 2005
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -270,6 +270,9 @@ Type: string (any string), default value: ''@*
|
||||
@item look_charset_internal
|
||||
Internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)@*
|
||||
Type: string (any string), default value: 'ISO-8859-1'@*
|
||||
@item look_buffer_timestamp
|
||||
Timestamp for buffers@*
|
||||
Type: string (any string), default value: '[%H:%M:%S]'@*
|
||||
@item look_color_nicks
|
||||
Display nick names with different colors@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'on'@*
|
||||
@@ -498,6 +501,9 @@ Type: integer (values: between 0 and 2147483647), default value: 1@*
|
||||
@item irc_lag_disconnect
|
||||
Disconnect after important lag (in minutes, 0 = never disconnect)@*
|
||||
Type: integer (values: between 0 and 2147483647), default value: 5@*
|
||||
@item irc_fifo_pipe
|
||||
Create a FIFO pipe for remote control@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
@item dcc_auto_accept_files
|
||||
Automatically accept incoming dcc files@*
|
||||
Type: boolean (values: 'on' or 'off'), default value: 'off'@*
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
@title WeeChat - Gui@'on de usuario.
|
||||
@subtitle Cliente IRC r@'apido, peque@~no y extensible
|
||||
@subtitle Documentaci@'on para WeeChat v0.1.1 - 20 de marzo de 2005
|
||||
@subtitle Documentaci@'on para WeeChat v0.1.2 - 9 de abril de 2005
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -269,6 +269,9 @@ Typo: cadena (cualquier cadena), valor por defecto: ''@*
|
||||
@item look_charset_internal
|
||||
Juego de caracteres interno de WeeChat, deber@'ia ser ISO-xxxx aunque el locale sea UTF-8 (si no se especifica, se utiliza el juego de caracteres local)@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: 'ISO-8859-1'@*
|
||||
@item look_buffer_timestamp
|
||||
Fecha y hora para las búfers@*
|
||||
Typo: cadena (cualquier cadena), valor por defecto: '[%H:%M:%S]'@*
|
||||
@item look_color_nicks
|
||||
Mostrar nombres de usuario con colores diferentes@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'on'@*
|
||||
@@ -498,7 +501,7 @@ Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 1@*
|
||||
Desconexi@'on tras un lag importante (en minutos, 0 = no desconectar nunca)@*
|
||||
Typo: entero (valores: entre 0 y 2147483647), valor por defecto: 5@*
|
||||
@item irc_fifo_pipe
|
||||
Create a FIFO pipe for remote control@*
|
||||
Crea una tuber@'ia FIFO para control remoto@*
|
||||
Typo: booleano (valores: 'on' u 'off'), valor por defecto: 'off'@*
|
||||
@item dcc_auto_accept_files
|
||||
Aceptar autom@'aticamente los ficheros dcc entrantes@*
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
@title WeeChat - Guide utilisateur
|
||||
@subtitle Client IRC rapide, l@'eger et extensible
|
||||
@subtitle Documentation pour WeeChat v0.1.1 - 20 Mars 2005
|
||||
@subtitle Documentation pour WeeChat v0.1.2-cvs - 9 Avril 2005
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
@@ -270,6 +270,9 @@ Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: ''@*
|
||||
@item look_charset_internal
|
||||
Jeu de caract@`eres interne @`a WeeChat, devrait @^etre ISO-xxxx m@^eme si la locale est UTF-8 (si non renseign@'e, le jeu de caract@`eres local est utilis@'e)@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: 'ISO-8859-1'@*
|
||||
@item look_buffer_timestamp
|
||||
Horodatage pour les tampons@*
|
||||
Type: cha@^ine (toute cha@^ine), valeur par d@'efaut: '[%H:%M:%S]'@*
|
||||
@item look_color_nicks
|
||||
Afficher les utilisateurs avec diff@'erentes couleurs@*
|
||||
Type: bool@'een (valeurs: 'on' ou 'off'), valeur par d@'efaut: 'on'@*
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
@title WeeChat - Guia do Utilizador
|
||||
@subtitle Cliente de IRC rapido, leve e extencivel
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.1 - 20 de Mar@,{c}o de 2005
|
||||
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.2-cvs - 9 de Abril de 2005
|
||||
|
||||
@image{weechat_image}
|
||||
|
||||
|
||||
+388
-380
File diff suppressed because it is too large
Load Diff
+388
-380
File diff suppressed because it is too large
Load Diff
+387
-379
File diff suppressed because it is too large
Load Diff
@@ -66,6 +66,7 @@ char *cfg_look_weechat_slogan;
|
||||
char *cfg_look_charset_decode;
|
||||
char *cfg_look_charset_encode;
|
||||
char *cfg_look_charset_internal;
|
||||
char *cfg_look_buffer_timestamp;
|
||||
int cfg_look_color_nicks;
|
||||
int cfg_look_color_actions;
|
||||
int cfg_look_remove_colors_from_msgs;
|
||||
@@ -112,6 +113,10 @@ t_config_option weechat_options_look[] =
|
||||
N_("internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"ISO-8859-1", NULL, NULL, &cfg_look_charset_internal, config_change_buffer_content },
|
||||
{ "look_buffer_timestamp", N_("timestamp for buffers"),
|
||||
N_("timestamp for buffers"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"[%H:%M:%S]", NULL, NULL, &cfg_look_buffer_timestamp, config_change_buffer_content },
|
||||
{ "look_color_nicks", N_("display nick names with different colors"),
|
||||
N_("display nick names with different colors"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
|
||||
@@ -83,6 +83,7 @@ extern char *cfg_look_weechat_slogan;
|
||||
extern char *cfg_look_charset_decode;
|
||||
extern char *cfg_look_charset_encode;
|
||||
extern char *cfg_look_charset_internal;
|
||||
extern char *cfg_look_buffer_timestamp;
|
||||
extern int cfg_look_color_nicks;
|
||||
extern int cfg_look_color_actions;
|
||||
extern int cfg_look_remove_colors_from_msgs;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
#include <ncurses.h>
|
||||
|
||||
#include "../../common/weechat.h"
|
||||
@@ -1314,7 +1315,7 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
|
||||
t_gui_window *ptr_win;
|
||||
time_t time_seconds;
|
||||
struct tm *local_time;
|
||||
char text[1024 + 1];
|
||||
char text_time[1024 + 1];
|
||||
|
||||
/* make gcc happy */
|
||||
(void) buffer;
|
||||
@@ -1339,9 +1340,9 @@ gui_draw_buffer_infobar (t_gui_buffer *buffer, int erase)
|
||||
local_time = localtime (&time_seconds);
|
||||
if (local_time)
|
||||
{
|
||||
strftime (text, 1024, cfg_look_infobar_timestamp, local_time);
|
||||
strftime (text_time, 1024, cfg_look_infobar_timestamp, local_time);
|
||||
gui_window_set_color (ptr_win->win_infobar, COLOR_WIN_INFOBAR);
|
||||
wprintw (ptr_win->win_infobar, "%s", text);
|
||||
wprintw (ptr_win->win_infobar, "%s", text_time);
|
||||
}
|
||||
if (gui_infobar)
|
||||
{
|
||||
@@ -2424,7 +2425,11 @@ void
|
||||
gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message, ...)
|
||||
{
|
||||
static char buf[8192];
|
||||
char timestamp[16];
|
||||
char text_time[1024 + 1];
|
||||
char text_time_char[2];
|
||||
time_t time_seconds;
|
||||
struct tm *local_time;
|
||||
int time_first_digit, time_last_digit;
|
||||
char *pos, *buf2, *buf3;
|
||||
int i, j;
|
||||
va_list argptr;
|
||||
@@ -2503,19 +2508,52 @@ gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message,
|
||||
pos = buf3 - 1;
|
||||
while (pos)
|
||||
{
|
||||
/* TODO: read timestamp format from config! */
|
||||
if ((!buffer->last_line) || (buffer->line_complete))
|
||||
{
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "[");
|
||||
snprintf (timestamp, 16, "%02d", date_tmp->tm_hour);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
|
||||
snprintf (timestamp, 16, "%02d", date_tmp->tm_min);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP, ":");
|
||||
snprintf (timestamp, 16, "%02d", date_tmp->tm_sec);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME, timestamp);
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, "] ");
|
||||
time_seconds = time (NULL);
|
||||
local_time = localtime (&time_seconds);
|
||||
strftime (text_time, 1024, cfg_look_buffer_timestamp, local_time);
|
||||
|
||||
time_first_digit = -1;
|
||||
time_last_digit = -1;
|
||||
i = 0;
|
||||
while (text_time[i])
|
||||
{
|
||||
if (isdigit (text_time[i]))
|
||||
{
|
||||
if (time_first_digit == -1)
|
||||
time_first_digit = i;
|
||||
time_last_digit = i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
text_time_char[1] = '\0';
|
||||
i = 0;
|
||||
while (text_time[i])
|
||||
{
|
||||
text_time_char[0] = text_time[i];
|
||||
if (time_first_digit < 0)
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
|
||||
text_time_char);
|
||||
else
|
||||
{
|
||||
if ((i < time_first_digit) || (i > time_last_digit))
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK,
|
||||
text_time_char);
|
||||
else
|
||||
{
|
||||
if (isdigit (text_time[i]))
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME,
|
||||
text_time_char);
|
||||
else
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_TIME_SEP,
|
||||
text_time_char);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
gui_add_message (buffer, MSG_TYPE_TIME, COLOR_WIN_CHAT_DARK, " ");
|
||||
}
|
||||
gui_add_message (buffer, type, color, pos + 1);
|
||||
pos = strchr (pos + 1, '\n');
|
||||
|
||||
Reference in New Issue
Block a user