summary refs log tree commit diff stats
path: root/src/list.rs
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2022-05-01 00:14:29 -0300
committerSoniEx2 <endermoneymod@gmail.com>2022-05-01 00:16:39 -0300
commitc857705c93291a640dc8f0d3b4ccb6a97c7742b0 (patch)
tree4fcd5053d832ce4b396adf5caf9806290eaa4c28 /src/list.rs
parent23ba75117815bc384bd4d678b5c5c2091edffcbb (diff)
Expose raw time_t values
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.