Commit f4d79dcc authored by Adrien Béraud's avatar Adrien Béraud Committed by Guillaume Roguez

account: add per-account pseudo-random generator

This is required by RingAccount to support ICE transport.

Refs #61678

Change-Id: I82863a1aafef9099f003c1f9591d6aa690c28ee9
parent deeb02b8
......@@ -99,6 +99,10 @@ Account::Account(const string &accountID)
, hasCustomUserAgent_(false)
, mailBox_()
{
std::random_device rdev;
std::seed_seq seed {rdev(), rdev()};
rand_.seed(seed);
// Initialize the codec order, used when creating a new account
loadDefaultCodecs();
#ifdef __ANDROID__
......
......@@ -43,6 +43,7 @@
#include <memory>
#include <map>
#include <set>
#include <random>
#include <stdexcept>
class Call;
......@@ -369,6 +370,11 @@ class Account : public Serializable, public std::enable_shared_from_this<Account
* Account mail box
*/
std::string mailBox_;
/**
* Random generator engine
*/
std::mt19937_64 rand_ {};
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment