diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-08-03 22:19:31 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-08-03 22:19:31 +0000 |
commit | d6aaec7b33aa4ef8fb24249b3856ea5bf746552b (patch) | |
tree | c641ab74a51cb8143376c601c020ffd7bae52e6d | |
parent | fbd85b6ae7d5808790c0799e94cf1d6dd0b59479 (diff) |
hcid: ListRecentRemoteDevices - bonded and trusted must be always added
-rw-r--r-- | hcid/dbus-adapter.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c index 0067b834..0d6f7a74 100644 --- a/hcid/dbus-adapter.c +++ b/hcid/dbus-adapter.c @@ -2891,24 +2891,23 @@ static DBusHandlerResult adapter_list_recent_remote_devices(DBusConnection *conn void *data) { struct adapter *adapter = data; + struct tm date; const char *string; DBusMessageIter iter; DBusMessageIter array_iter; DBusMessage *reply; char filename[PATH_MAX + 1]; struct remote_device_list_t param = { NULL, 0 }; + int len; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &string, DBUS_TYPE_INVALID)) return error_invalid_arguments(conn, msg); - if (strlen(string)) { - struct tm date; - if (strptime(string, "%Y-%m-%d %H:%M:%S", &date) == NULL) - return error_invalid_arguments(conn, msg); - param.time = mktime(&date); - } + len = strlen(string); + if (len && (strptime(string, "%Y-%m-%d %H:%M:%S", &date) == NULL)) + return error_invalid_arguments(conn, msg); /* Add Bonded devices to the list */ create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "linkkeys"); @@ -2918,6 +2917,9 @@ static DBusHandlerResult adapter_list_recent_remote_devices(DBusConnection *conn create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "trusts"); textfile_foreach(filename, list_remote_devices_do_append, ¶m); + if (len) + param.time = mktime(&date); + /* Add Last seen devices to the list */ create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "lastseen"); textfile_foreach(filename, list_remote_devices_do_append, ¶m); |