mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-13 04:37:11 +02:00
fix: crashes
This commit is contained in:
parent
4e0ffc1e28
commit
7631722e99
2 changed files with 14 additions and 12 deletions
|
@ -51,19 +51,21 @@ void runOnce() {
|
|||
const auto invalidateAll = cOtherOnline() >= t;
|
||||
|
||||
for (const auto &[index, account] : Core::App().domain().accounts()) {
|
||||
if (const auto session = account->maybeSession()) {
|
||||
const auto id = session->userId().bare;
|
||||
if (!state.contains(id)) {
|
||||
state[id] = true; // newly added account, I suppose
|
||||
}
|
||||
if (account) {
|
||||
if (const auto session = account->maybeSession()) {
|
||||
const auto id = session->userId().bare;
|
||||
if (!state.contains(id)) {
|
||||
state[id] = true; // newly added account, I suppose
|
||||
}
|
||||
|
||||
if (invalidateAll || state[id] || session->user()->lastseen().isOnline(t)) {
|
||||
session->api().request(MTPaccount_UpdateStatus(
|
||||
MTP_bool(true)
|
||||
)).send();
|
||||
state[id] = false;
|
||||
if (invalidateAll || state[id] || session->user()->lastseen().isOnline(t)) {
|
||||
session->api().request(MTPaccount_UpdateStatus(
|
||||
MTP_bool(true)
|
||||
)).send();
|
||||
state[id] = false;
|
||||
|
||||
DEBUG_LOG(("[AyuGram] Sent offline for account with uid %1, invalidate %2").arg(id).arg(invalidateAll));
|
||||
DEBUG_LOG(("[AyuGram] Sent offline for account with uid %1, invalidate %2").arg(id).arg(invalidateAll));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -411,7 +411,7 @@ bool AddForwardMessageAction(
|
|||
const ContextMenuRequest &request,
|
||||
not_null<ListWidget*> list) {
|
||||
const auto item = request.item;
|
||||
if (item->isDeleted()) {
|
||||
if (item && item->isDeleted()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue