Files
AyuGramDesktop/Telegram/SourceFiles/ayu/sync/utils/telegram_helpers.cpp
T
2023-07-09 18:09:01 +00:00

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;
}