mirror of https://github.com/djcb/mu.git
message: add docid param to sexp
This commit is contained in:
parent
fccd961712
commit
967e855f6b
|
@ -140,12 +140,12 @@ add_date_and_size(Sexp::List& items, const Message& message)
|
|||
}
|
||||
|
||||
Mu::Sexp::List
|
||||
Message::to_sexp_list() const
|
||||
Message::to_sexp_list(unsigned docid) const
|
||||
{
|
||||
Sexp::List items;
|
||||
|
||||
// if (docid != 0)
|
||||
// items.add_prop(":docid", Sexp::make_number(docid));
|
||||
if (docid != 0)
|
||||
items.add_prop(":docid", Sexp::make_number(docid));
|
||||
|
||||
add_prop_nonempty(items, ":subject", subject());
|
||||
add_prop_nonempty(items, ":message-id", message_id());
|
||||
|
@ -169,7 +169,7 @@ Message::to_sexp_list() const
|
|||
}
|
||||
|
||||
Mu::Sexp
|
||||
Message::to_sexp() const
|
||||
Message::to_sexp(unsigned docid) const
|
||||
{
|
||||
return Sexp::make_list(to_sexp_list());
|
||||
}
|
||||
|
|
|
@ -279,8 +279,8 @@ public:
|
|||
*
|
||||
* @return a Mu::Sexp or a Mu::Sexp::List representing the message.
|
||||
*/
|
||||
Mu::Sexp::List to_sexp_list() const;
|
||||
Mu::Sexp to_sexp() const;
|
||||
Mu::Sexp::List to_sexp_list(unsigned docid=0) const;
|
||||
Mu::Sexp to_sexp(unsigned docid=0) const;
|
||||
|
||||
/*
|
||||
* And some non-const message, for updating an existing
|
||||
|
|
|
@ -184,7 +184,7 @@ Server::Private::build_message_sexp(const Message& msg,
|
|||
Store::Id docid,
|
||||
const Option<QueryMatch&> qm) const
|
||||
{
|
||||
auto msgsexp{msg.to_sexp_list()};
|
||||
auto msgsexp{msg.to_sexp_list(docid)};
|
||||
if (qm)
|
||||
msgsexp.add_prop(":meta", build_metadata(*qm));
|
||||
|
||||
|
|
Loading…
Reference in New Issue