diff options
author | Emmanuel Bouthenot <kolter@openics.org> | 2006-10-16 20:19:12 +0000 |
---|---|---|
committer | Emmanuel Bouthenot <kolter@openics.org> | 2006-10-16 20:19:12 +0000 |
commit | 06c4cf414435f14f463732886e06ccfa699fc815 (patch) | |
tree | 1809d8485dd72a1ca937eea8f93009c1c69928bf /src/plugins/scripts/python | |
parent | 0f07b696885778f40d6093aa312bebdb1507605e (diff) | |
download | weechat-06c4cf414435f14f463732886e06ccfa699fc815.zip |
adding date field 'date' in get_buffer_data() function of plugins/scripts API
Diffstat (limited to 'src/plugins/scripts/python')
-rw-r--r-- | src/plugins/scripts/python/weechat-python.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c index 380af33e3..c8091260d 100644 --- a/src/plugins/scripts/python/weechat-python.c +++ b/src/plugins/scripts/python/weechat-python.c @@ -1445,6 +1445,7 @@ weechat_python_get_buffer_data (PyObject *self, PyObject *args) t_plugin_buffer_line *buffer_data, *ptr_data; PyObject *data_list, *data_list_member; char *server, *channel; + char timebuffer[64]; /* make gcc happy */ (void) self; @@ -1480,6 +1481,11 @@ weechat_python_get_buffer_data (PyObject *self, PyObject *args) if (data_list_member) { + strftime(timebuffer, sizeof(timebuffer), "%F %T", + localtime(&ptr_data->date)); + + PyDict_SetItem(data_list_member, Py_BuildValue("s", "date"), + Py_BuildValue("s", timebuffer)); PyDict_SetItem(data_list_member, Py_BuildValue("s", "nick"), Py_BuildValue("s", ptr_data->nick == NULL ? "" : ptr_data->nick)); PyDict_SetItem(data_list_member, Py_BuildValue("s", "data"), |