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

relay/api: fix timezone of dates sent to clients (closes #2151)

This commit is contained in:
Sébastien Helleu
2024-07-08 19:10:27 +02:00
parent 7e73da310e
commit 8e2275cebc
2 changed files with 7 additions and 4 deletions
+1
View File
@@ -48,6 +48,7 @@
- ruby: fix builtin functions not available ([#2109](https://github.com/weechat/weechat/issues/2109))
- php: fix return value of function hdata_longlong
- tcl: fix return value of function hdata_longlong ([#2119](https://github.com/weechat/weechat/issues/2119))
- relay/api: fix timezone of dates sent to clients ([#2151](https://github.com/weechat/weechat/issues/2151))
- relay/api: fix "body_type" returned when lines or nicks of a buffer are requested
- relay/api: fix read of one buffer line
- relay: fix websocket permessage-deflate extension when the client doesn't send the max window bits parameters ([#1549](https://github.com/weechat/weechat/issues/1549))
+6 -4
View File
@@ -58,8 +58,10 @@
#define MSG_ADD_HDATA_TIME_USEC(__json_name, \
__var_name, __var_name_usec) \
time_value = weechat_hdata_time (hdata, pointer, __var_name); \
gmtime_r (&time_value, &gm_time); \
tv.tv_sec = mktime (&gm_time); \
local_time = localtime (&time_value); \
time_value -= local_time->tm_gmtoff; \
local_time = localtime (&time_value); \
tv.tv_sec = mktime (local_time); \
tv.tv_usec = weechat_hdata_integer (hdata, pointer, \
__var_name_usec); \
weechat_util_strftimeval (str_time, sizeof (str_time), \
@@ -491,7 +493,7 @@ relay_api_msg_line_data_to_json (struct t_gui_line_data *line_data,
int i, tags_count;
time_t time_value;
struct timeval tv;
struct tm gm_time;
struct tm *local_time;
hdata = relay_hdata_line_data;
pointer = line_data;
@@ -730,7 +732,7 @@ relay_api_msg_hotlist_to_json (struct t_gui_hotlist *hotlist)
cJSON *json, *json_count;
time_t time_value;
struct timeval tv;
struct tm gm_time;
struct tm *local_time;
char str_time[256], str_key[32];
int i, array_size;
long long buffer_id;