summaryrefslogtreecommitdiff
path: root/src/message.cpp
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-06-17 21:58:32 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2023-06-18 22:41:23 +0200
commite7d6aafd3c9353d9e6169ca775cf1dae618238cd (patch)
tree6df8f296d7db8dd9e7d23f5774009ccc5ee269a7 /src/message.cpp
parent2130d07cbf91e016fd21a730a8449dd4bd34a093 (diff)
Storage: iterable type for record item list
Diffstat (limited to 'src/message.cpp')
-rw-r--r--src/message.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/message.cpp b/src/message.cpp
index ff8e05b..06ee8ad 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -55,15 +55,10 @@ DirectMessageData DirectMessageData::load(const Ref & ref)
if (!rec)
return DirectMessageData();
- vector<Stored<DirectMessageData>> prev;
- for (auto p : rec->items("PREV"))
- if (const auto & x = p.as<DirectMessageData>())
- prev.push_back(*x);
-
auto fref = rec->item("from").asRef();
return DirectMessageData {
- .prev = std::move(prev),
+ .prev = rec->items("PREV").as<DirectMessageData>(),
.from = fref ? Identity::load(*fref) : nullopt,
.time = *rec->item("time").asDate(),
.text = rec->item("text").asText().value(),