mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-09 21:23:43 +00:00
32 lines
601 B
C++
32 lines
601 B
C++
// This is the source code of AyuGram for Desktop.
|
|
//
|
|
// We do not and cannot prevent the use of our code,
|
|
// but be respectful and credit the original author.
|
|
//
|
|
// Copyright @Radolyn, 2023
|
|
|
|
#include "telegram_helpers.h"
|
|
#include "data/data_peer_id.h"
|
|
|
|
Main::Session* getSession(long userId)
|
|
{
|
|
for (auto& [index, account] : Core::App().domain().accounts())
|
|
{
|
|
if (const auto session = account->maybeSession())
|
|
{
|
|
if (session->userId().bare == userId)
|
|
{
|
|
return session;
|
|
}
|
|
}
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
PeerId dialogIdToPeerId(long dialogId)
|
|
{
|
|
auto peerId = PeerId();
|
|
return peerId;
|
|
}
|