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/ruby | |
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/ruby')
-rw-r--r-- | src/plugins/scripts/ruby/weechat-ruby.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c index 8bc084b69..5001c10d3 100644 --- a/src/plugins/scripts/ruby/weechat-ruby.c +++ b/src/plugins/scripts/ruby/weechat-ruby.c @@ -1682,6 +1682,7 @@ weechat_ruby_get_buffer_data (int argc, VALUE *argv, VALUE class) VALUE data_list, data_list_member; VALUE server, channel; char *c_server, *c_channel; + char timebuffer[64]; /* make gcc happy */ (void) class; @@ -1727,6 +1728,11 @@ weechat_ruby_get_buffer_data (int argc, VALUE *argv, VALUE class) if (!NIL_P (data_list_member)) { + strftime(timebuffer, sizeof(timebuffer), "%F %T", + localtime(&ptr_data->date)); + + rb_hash_aset (data_list_member, rb_str_new2("date"), + rb_str_new2(timebuffer)); rb_hash_aset (data_list_member, rb_str_new2("nick"), rb_str_new2(ptr_data->nick == NULL ? "" : ptr_data->nick)); rb_hash_aset (data_list_member, rb_str_new2("data"), |