mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 12:26:40 +02:00
adding date field 'date' in get_buffer_data() function of plugins/scripts API
This commit is contained in:
@@ -1744,6 +1744,7 @@ weechat_lua_get_buffer_data (lua_State *L)
|
||||
{
|
||||
t_plugin_buffer_line *buffer_data, *ptr_data;
|
||||
const char *server, *channel;
|
||||
char timebuffer[64];
|
||||
int i, n;
|
||||
|
||||
/* make gcc happy */
|
||||
@@ -1796,6 +1797,13 @@ weechat_lua_get_buffer_data (lua_State *L)
|
||||
lua_pushnumber (lua_current_interpreter, i);
|
||||
lua_newtable (lua_current_interpreter);
|
||||
|
||||
strftime(timebuffer, sizeof(timebuffer), "%F %T",
|
||||
localtime(&ptr_data->date));
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "date");
|
||||
lua_pushstring (lua_current_interpreter, timebuffer);
|
||||
lua_rawset (lua_current_interpreter, -3);
|
||||
|
||||
lua_pushstring (lua_current_interpreter, "nick");
|
||||
lua_pushstring (lua_current_interpreter,
|
||||
ptr_data->nick == NULL ? "" : ptr_data->nick);
|
||||
|
||||
Reference in New Issue
Block a user