21 stream:send_iq(verse.iq({ type = "get", to = target_jid }) |
21 stream:send_iq(verse.iq({ type = "get", to = target_jid }) |
22 :tag("query", { xmlns = xmlns_last }), |
22 :tag("query", { xmlns = xmlns_last }), |
23 function (reply) |
23 function (reply) |
24 local query = reply:get_child("query", xmlns_last); |
24 local query = reply:get_child("query", xmlns_last); |
25 if reply.attr.type == "result" then |
25 if reply.attr.type == "result" then |
26 local seconds = query.attr.seconds; |
26 local seconds = tonumber(query.attr.seconds); |
27 callback({ |
27 callback({ |
28 seconds = seconds or nil; |
28 seconds = seconds or nil; |
29 }); |
29 }); |
30 else |
30 else |
31 local type, condition, text = reply:get_error(); |
31 local type, condition, text = reply:get_error(); |