summary refs log tree commit diff stats
path: root/src/list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/list.rs')
-rw-r--r--src/list.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/list.rs b/src/list.rs
index d042d21..8a7c632 100644
--- a/src/list.rs
+++ b/src/list.rs
@@ -183,10 +183,11 @@ macro_rules! field_str {
 
 
 macro_rules! field_time {
+    ($(#[$m:meta])* $f:ident, unsafe { $n:expr }) => {
+        field!($(#[$m])* $f, unsafe { $n }, libc::time_t, ph, hexchat_list_time, r => r as libc::time_t);
+    };
     ($(#[$m:meta])* $f:ident) => {
-        $(#[$m])* pub fn $f(&self) -> ! {
-            todo!()
-        }
+        field_time!($(#[$m])* $f, unsafe { ::std::concat!(::std::stringify!($f), "\0") });
     };
 }
 
@@ -347,16 +348,16 @@ impl<'a, 'ph> Fields<'a, 'ph, Notify> {
         raw_flags, unsafe { "flags\0" }
     );
     field_time!(
-        /// Time when the user went online. [NYI]
-        on
+        /// Time when the user went online.
+        raw_on, unsafe { "on\0" }
     );
     field_time!(
-        /// Time when the user went offline. [NYI]
-        off
+        /// Time when the user went offline.
+        raw_off, unsafe { "off\0" }
     );
     field_time!(
-        /// Time when the user was last seen. [NYI]
-        seen
+        /// Time when the user was last seen.
+        raw_seen, unsafe { "seen\0" }
     );
 }
 
@@ -371,8 +372,8 @@ impl<'a, 'ph> Fields<'a, 'ph, Users> {
         away
     );
     field_time!(
-        /// Time when the user last talked. [NYI]
-        lasttalk
+        /// Time when the user last talked.
+        raw_lasttalk, unsafe { "lasttalk\0" }
     );
     field_str!(
         /// User's nick.