Simplify outbound session setup
Don't send inbound session to self and claim and send all keys at once.
This commit is contained in:
parent
8eb74daf76
commit
54db9c89ed
9 changed files with 209 additions and 214 deletions
|
|
@ -139,24 +139,26 @@ Cache::Cache(const QString &userId, QObject *parent)
|
|||
, localUserId_{userId}
|
||||
{
|
||||
setup();
|
||||
connect(this,
|
||||
&Cache::updateUserCacheFlag,
|
||||
this,
|
||||
[this](const std::string &user_id) {
|
||||
std::optional<UserCache> cache_ = getUserCache(user_id);
|
||||
if (cache_.has_value()) {
|
||||
cache_.value().isUpdated = false;
|
||||
setUserCache(user_id, cache_.value());
|
||||
} else {
|
||||
setUserCache(user_id, UserCache{});
|
||||
}
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
connect(this,
|
||||
&Cache::deleteLeftUsers,
|
||||
this,
|
||||
[this](const std::string &user_id) { deleteUserCache(user_id); },
|
||||
Qt::QueuedConnection);
|
||||
connect(
|
||||
this,
|
||||
&Cache::updateUserCacheFlag,
|
||||
this,
|
||||
[this](const std::string &user_id) {
|
||||
std::optional<UserCache> cache_ = getUserCache(user_id);
|
||||
if (cache_.has_value()) {
|
||||
cache_.value().isUpdated = false;
|
||||
setUserCache(user_id, cache_.value());
|
||||
} else {
|
||||
setUserCache(user_id, UserCache{});
|
||||
}
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
connect(
|
||||
this,
|
||||
&Cache::deleteLeftUsers,
|
||||
this,
|
||||
[this](const std::string &user_id) { deleteUserCache(user_id); },
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue