summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/lua/weechat-lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/scripts/lua/weechat-lua.c')
-rw-r--r--src/plugins/scripts/lua/weechat-lua.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c
index 4ff0c1f38..2008f649c 100644
--- a/src/plugins/scripts/lua/weechat-lua.c
+++ b/src/plugins/scripts/lua/weechat-lua.c
@@ -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);