libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
client_device.h
Go to the documentation of this file.
1// THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
2
3#pragma once
4
5#include <Quotient/converters.h>
6
7namespace Quotient {
8//! A client device
10 //! Identifier of this device.
12
13 //! Display name set by the user for this device. Absent if no name has been
14 //! set.
16
17 //! The IP address where this device was last seen. (May be a few minutes out
18 //! of date, for efficiency reasons).
20
21 //! The timestamp (in milliseconds since the unix epoch) when this devices
22 //! was last seen. (May be a few minutes out of date, for efficiency
23 //! reasons).
25};
26
27template <>
28struct JsonObjectConverter<Device> {
29 static void dumpTo(QJsonObject& jo, const Device& pod)
30 {
31 addParam(jo, "device_id"_L1, pod.deviceId);
32 addParam<IfNotEmpty>(jo, "display_name"_L1, pod.displayName);
33 addParam<IfNotEmpty>(jo, "last_seen_ip"_L1, pod.lastSeenIp);
34 addParam<IfNotEmpty>(jo, "last_seen_ts"_L1, pod.lastSeenTs);
35 }
36 static void fillFrom(const QJsonObject& jo, Device& pod)
37 {
38 fillFromJson(jo.value("device_id"_L1), pod.deviceId);
39 fillFromJson(jo.value("display_name"_L1), pod.displayName);
40 fillFromJson(jo.value("last_seen_ip"_L1), pod.lastSeenIp);
41 fillFromJson(jo.value("last_seen_ts"_L1), pod.lastSeenTs);
42 }
43};
44
45} // namespace Quotient
#define QUOTIENT_API
A client device.
std::optional< qint64 > lastSeenTs