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

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

This commit is contained in:
Sébastien Helleu
2024-07-16 23:50:24 +02:00
parent c6ad4bfd20
commit 345d99a9b5
2 changed files with 7 additions and 4 deletions
+1
View File
@@ -15,6 +15,7 @@
=== Fixed
* relay/api: fix crash when sending data to a remote buffer when the remote has been deleted (issue #2157)
* relay/api: fix timezone of dates sent to clients (issue #2151)
[[v4.3.5]]
== Version 4.3.5 (2024-07-16)
+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), \
@@ -492,7 +494,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;
@@ -731,7 +733,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;