1
0
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:
Emmanuel Bouthenot
2006-10-16 20:19:12 +00:00
parent 0f07b69688
commit 06c4cf4144
8 changed files with 52 additions and 2 deletions
+8
View File
@@ -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);