Skip to content
Snippets Groups Projects
Commit b143bc45 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

default_types: add metadatas map into ImMessage

Give the ability to store more datas into an ImMessage

Issue: #345
parent 4d6e5ab8
No related branches found
No related tags found
No related merge requests found
...@@ -116,6 +116,8 @@ public: ...@@ -116,6 +116,8 @@ public:
: id(id), msg(std::move(m)), date(d) {} : id(id), msg(std::move(m)), date(d) {}
ImMessage(dht::Value::Id id, std::string &&dt, std::string &&m, long d = 0) ImMessage(dht::Value::Id id, std::string &&dt, std::string &&m, long d = 0)
: id(id), msg(std::move(m)), datatype(std::move(dt)), date(d) {} : id(id), msg(std::move(m)), datatype(std::move(dt)), date(d) {}
ImMessage(dht::Value::Id id, std::string &&dt, std::string &&m, std::map<std::string, std::string> &&md, long d = 0)
: id(id), msg(std::move(m)), datatype(std::move(dt)), metadatas(std::move(md)), date(d) {}
virtual void unpackValue(const Value& v) override { virtual void unpackValue(const Value& v) override {
to = v.recipient; to = v.recipient;
...@@ -126,10 +128,11 @@ public: ...@@ -126,10 +128,11 @@ public:
dht::Value::Id id {0}; dht::Value::Id id {0};
std::string msg; std::string msg;
std::string datatype; std::string datatype;
std::map<std::string, std::string> metadatas;
long date {0}; long date {0};
ImStatus status {ImStatus::NONE}; ImStatus status {ImStatus::NONE};
MSGPACK_DEFINE_MAP(id, msg, date, status, datatype) MSGPACK_DEFINE_MAP(id, msg, date, status, datatype, metadatas)
}; };
class OPENDHT_PUBLIC TrustRequest : public EncryptedValue<TrustRequest> class OPENDHT_PUBLIC TrustRequest : public EncryptedValue<TrustRequest>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment