mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-10 23:07:52 +00:00
Merge pull request #290 from dryabov/patch-2
More checks to be sure DM is in new format
This commit is contained in:
commit
82f305403c
@ -1092,9 +1092,13 @@ bool processReceivedDM(lazy_entry const* post)
|
|||||||
libtorrent::error_code ec;
|
libtorrent::error_code ec;
|
||||||
if (lazy_bdecode(textOut.data(), textOut.data()+textOut.size(), v, ec, &pos) == 0
|
if (lazy_bdecode(textOut.data(), textOut.data()+textOut.size(), v, ec, &pos) == 0
|
||||||
&& v.type() == lazy_entry::dict_t) {
|
&& v.type() == lazy_entry::dict_t) {
|
||||||
msg = v.dict_find_string_value("msg");
|
lazy_entry const* pMsg = v.dict_find_string("msg");
|
||||||
to = v.dict_find_string_value("to");
|
lazy_entry const* pTo = v.dict_find_string("to");
|
||||||
// new features here: key distribution etc
|
if (pMsg && pTo) {
|
||||||
|
msg = pMsg->string_value();
|
||||||
|
to = pTo->string_value();
|
||||||
|
// new features here: key distribution etc
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user