diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-06-17 21:58:32 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-06-18 22:41:23 +0200 |
commit | e7d6aafd3c9353d9e6169ca775cf1dae618238cd (patch) | |
tree | 6df8f296d7db8dd9e7d23f5774009ccc5ee269a7 /src/message.cpp | |
parent | 2130d07cbf91e016fd21a730a8449dd4bd34a093 (diff) |
Storage: iterable type for record item list
Diffstat (limited to 'src/message.cpp')
-rw-r--r-- | src/message.cpp | 7 |
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(), |