Skip to content
Snippets Groups Projects
Unverified Commit 5408dc6f authored by Adrien Béraud's avatar Adrien Béraud Committed by GitHub
Browse files

Merge pull request #287 from AmarOk1412/immsgwithdt

immessage: add support for custom datatypes
parents 35d4c1d3 484194c1
No related branches found
No related tags found
No related merge requests found
......@@ -114,6 +114,8 @@ public:
ImMessage() {}
ImMessage(dht::Value::Id id, std::string&& m, long d = 0)
: id(id), msg(std::move(m)), date(d) {}
ImMessage(dht::Value::Id id, std::string&& dt, std::string&& m, long d = 0)
: id(id), datatype(std::move(dt)), msg(std::move(m)), date(d) {}
virtual void unpackValue(const Value& v) override {
to = v.recipient;
......@@ -123,10 +125,11 @@ public:
dht::InfoHash to;
dht::Value::Id id {0};
std::string msg;
std::string datatype;
long date {0};
ImStatus status {ImStatus::NONE};
MSGPACK_DEFINE_MAP(id, msg, date, status)
MSGPACK_DEFINE_MAP(id, msg, date, status, datatype)
};
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