summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/lua
diff options
context:
space:
mode:
authorEmmanuel Bouthenot <kolter@openics.org>2006-10-16 20:19:12 +0000
committerEmmanuel Bouthenot <kolter@openics.org>2006-10-16 20:19:12 +0000
commit06c4cf414435f14f463732886e06ccfa699fc815 (patch)
tree1809d8485dd72a1ca937eea8f93009c1c69928bf /src/plugins/scripts/lua
parent0f07b696885778f40d6093aa312bebdb1507605e (diff)
downloadweechat-06c4cf414435f14f463732886e06ccfa699fc815.zip
adding date field 'date' in get_buffer_data() function of plugins/scripts API
Diffstat (limited to 'src/plugins/scripts/lua')
-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);