From 893fe6d2f16f5e70087aa9d5949aff5aaff556d2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 17 Jan 2023 13:47:54 +0300 Subject: Telegram: CMTProto class renamed according to Miranda standards --- protocols/Telegram/src/auth.cpp | 20 ++++++++--------- protocols/Telegram/src/avatars.cpp | 10 ++++----- protocols/Telegram/src/main.cpp | 2 +- protocols/Telegram/src/options.cpp | 10 ++++----- protocols/Telegram/src/proto.cpp | 36 +++++++++++++++---------------- protocols/Telegram/src/proto.h | 24 ++++++++++----------- protocols/Telegram/src/server.cpp | 44 +++++++++++++++++++------------------- protocols/Telegram/src/stdafx.h | 2 +- protocols/Telegram/src/utils.cpp | 10 ++++----- 9 files changed, 79 insertions(+), 79 deletions(-) (limited to 'protocols/Telegram/src') diff --git a/protocols/Telegram/src/auth.cpp b/protocols/Telegram/src/auth.cpp index 043628ab19..674d91d6a4 100644 --- a/protocols/Telegram/src/auth.cpp +++ b/protocols/Telegram/src/auth.cpp @@ -21,24 +21,24 @@ along with this program. If not, see . /////////////////////////////////////////////////////////////////////////////// -INT_PTR CALLBACK CMTProto::EnterPhoneCode(void *param) +INT_PTR CALLBACK CTelegramProto::EnterPhoneCode(void *param) { - auto *ppro = (CMTProto *)param; + auto *ppro = (CTelegramProto *)param; ENTER_STRING es = {}; es.szModuleName = ppro->m_szModuleName; es.caption = TranslateT("Enter secret code sent to your phone"); if (EnterString(&es)) { - ppro->SendQuery(new TD::checkAuthenticationCode(_T2A(es.ptszResult).get()), &CMTProto::OnUpdateAuth); + ppro->SendQuery(new TD::checkAuthenticationCode(_T2A(es.ptszResult).get()), &CTelegramProto::OnUpdateAuth); mir_free(es.ptszResult); } else ppro->LogOut(); return 0; } -INT_PTR CALLBACK CMTProto::EnterPassword(void *param) +INT_PTR CALLBACK CTelegramProto::EnterPassword(void *param) { - auto *ppro = (CMTProto *)param; + auto *ppro = (CTelegramProto *)param; CMStringW wszTitle(TranslateT("Enter password")); auto *pAuth = (TD::authorizationStateWaitPassword *)ppro->pAuthState.get(); @@ -50,14 +50,14 @@ INT_PTR CALLBACK CMTProto::EnterPassword(void *param) es.caption = wszTitle; es.type = ESF_PASSWORD; if (EnterString(&es)) { - ppro->SendQuery(new TD::checkAuthenticationPassword(_T2A(es.ptszResult).get()), &CMTProto::OnUpdateAuth); + ppro->SendQuery(new TD::checkAuthenticationPassword(_T2A(es.ptszResult).get()), &CTelegramProto::OnUpdateAuth); mir_free(es.ptszResult); } else ppro->LogOut(); return 0; } -void CMTProto::ProcessAuth(TD::updateAuthorizationState *pObj) +void CTelegramProto::ProcessAuth(TD::updateAuthorizationState *pObj) { pAuthState = std::move(pObj->authorization_state_); switch (pAuthState->get_id()) { @@ -80,12 +80,12 @@ void CMTProto::ProcessAuth(TD::updateAuthorizationState *pObj) request->device_model_ = T2Utf(m_wszDeviceName).get(); request->application_version_ = text; request->enable_storage_optimizer_ = true; - SendQuery(request, &CMTProto::OnUpdateAuth); + SendQuery(request, &CTelegramProto::OnUpdateAuth); } break; case TD::authorizationStateWaitPhoneNumber::ID: - SendQuery(new TD::setAuthenticationPhoneNumber(_T2A(m_szOwnPhone).get(), nullptr), &CMTProto::OnUpdateAuth); + SendQuery(new TD::setAuthenticationPhoneNumber(_T2A(m_szOwnPhone).get(), nullptr), &CTelegramProto::OnUpdateAuth); break; case TD::authorizationStateWaitCode::ID: @@ -107,7 +107,7 @@ void CMTProto::ProcessAuth(TD::updateAuthorizationState *pObj) } } -void CMTProto::OnUpdateAuth(td::ClientManager::Response &response) +void CTelegramProto::OnUpdateAuth(td::ClientManager::Response &response) { if (response.object->get_id() == TD::error::ID) { auto *pError = (TD::error *)response.object.get(); diff --git a/protocols/Telegram/src/avatars.cpp b/protocols/Telegram/src/avatars.cpp index bd24079f5f..6aacd51190 100644 --- a/protocols/Telegram/src/avatars.cpp +++ b/protocols/Telegram/src/avatars.cpp @@ -17,7 +17,7 @@ along with this program. If not, see . #include "stdafx.h" -INT_PTR CMTProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam) +INT_PTR CTelegramProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam) { switch (wParam) { case AF_MAXSIZE: @@ -41,7 +41,7 @@ INT_PTR CMTProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam) return 0; } -INT_PTR CMTProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam) +INT_PTR CTelegramProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam) { auto *pai = (PROTO_AVATAR_INFORMATION *)lParam; @@ -59,19 +59,19 @@ INT_PTR CMTProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam) return GAIR_NOAVATAR; } -INT_PTR CMTProto::SvcGetMyAvatar(WPARAM, LPARAM) +INT_PTR CTelegramProto::SvcGetMyAvatar(WPARAM, LPARAM) { return 1; } -INT_PTR CMTProto::SvcSetMyAvatar(WPARAM, LPARAM) +INT_PTR CTelegramProto::SvcSetMyAvatar(WPARAM, LPARAM) { return 1; } ///////////////////////////////////////////////////////////////////////////////////////// -void CMTProto::ProcessFile(TD::updateFile *pObj) +void CTelegramProto::ProcessFile(TD::updateFile *pObj) { if (auto *pFile = pObj->file_.get()) { if (!pFile->local_->is_downloading_completed_) diff --git a/protocols/Telegram/src/main.cpp b/protocols/Telegram/src/main.cpp index c00b87536d..e3f59b0d6b 100644 --- a/protocols/Telegram/src/main.cpp +++ b/protocols/Telegram/src/main.cpp @@ -27,7 +27,7 @@ PLUGININFOEX pluginInfo = }; CMPlugin::CMPlugin() : - ACCPROTOPLUGIN("Telegram", pluginInfo) + ACCPROTOPLUGIN("Telegram", pluginInfo) { SetUniqueId(DBKEY_ID); } diff --git a/protocols/Telegram/src/options.cpp b/protocols/Telegram/src/options.cpp index f3c5cbfb37..5d2d6b83d5 100644 --- a/protocols/Telegram/src/options.cpp +++ b/protocols/Telegram/src/options.cpp @@ -19,15 +19,15 @@ along with this program. If not, see . ///////////////////////////////////////////////////////////////////////////////////////// -class COptionsDlg : public CProtoDlgBase +class COptionsDlg : public CProtoDlgBase { CCtrlCheck chkHideChats, chkUsePopups; CCtrlEdit edtGroup, edtPhone, edtDeviceName; ptrW m_wszOldGroup; public: - COptionsDlg(CMTProto *ppro, int iDlgID, bool bFullDlg) : - CProtoDlgBase(ppro, iDlgID), + COptionsDlg(CTelegramProto *ppro, int iDlgID, bool bFullDlg) : + CProtoDlgBase(ppro, iDlgID), chkUsePopups(this, IDC_POPUPS), chkHideChats(this, IDC_HIDECHATS), edtPhone(this, IDC_PHONE), @@ -59,7 +59,7 @@ public: ///////////////////////////////////////////////////////////////////////////////////////// -INT_PTR CMTProto::SvcCreateAccMgrUI(WPARAM, LPARAM hwndParent) +INT_PTR CTelegramProto::SvcCreateAccMgrUI(WPARAM, LPARAM hwndParent) { auto *pDlg = new COptionsDlg(this, IDD_ACCMGRUI, false); pDlg->SetParent((HWND)hwndParent); @@ -67,7 +67,7 @@ INT_PTR CMTProto::SvcCreateAccMgrUI(WPARAM, LPARAM hwndParent) return (INT_PTR)pDlg->GetHwnd(); } -int CMTProto::OnOptionsInit(WPARAM wParam, LPARAM) +int CTelegramProto::OnOptionsInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; odp.szTitle.w = m_tszUserName; diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index 6fbde8731e..2dd667314b 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -16,8 +16,8 @@ static int CompareUsers(const TG_USER *p1, const TG_USER *p2) return (p1->id < p2->id) ? -1 : 1; } -CMTProto::CMTProto(const char* protoName, const wchar_t* userName) : - PROTO(protoName, userName), +CTelegramProto::CTelegramProto(const char* protoName, const wchar_t* userName) : + PROTO(protoName, userName), m_impl(*this), m_arUsers(10, CompareUsers), m_arRequests(10, CompareRequests), @@ -29,14 +29,14 @@ CMTProto::CMTProto(const char* protoName, const wchar_t* userName) : { m_iOwnId = _atoi64(getMStringA(DBKEY_ID)); - CreateProtoService(PS_CREATEACCMGRUI, &CMTProto::SvcCreateAccMgrUI); - CreateProtoService(PS_GETAVATARCAPS, &CMTProto::SvcGetAvatarCaps); - CreateProtoService(PS_GETAVATARINFO, &CMTProto::SvcGetAvatarInfo); - CreateProtoService(PS_GETMYAVATAR, &CMTProto::SvcGetMyAvatar); - CreateProtoService(PS_SETMYAVATAR, &CMTProto::SvcSetMyAvatar); + CreateProtoService(PS_CREATEACCMGRUI, &CTelegramProto::SvcCreateAccMgrUI); + CreateProtoService(PS_GETAVATARCAPS, &CTelegramProto::SvcGetAvatarCaps); + CreateProtoService(PS_GETAVATARINFO, &CTelegramProto::SvcGetAvatarInfo); + CreateProtoService(PS_GETMYAVATAR, &CTelegramProto::SvcGetMyAvatar); + CreateProtoService(PS_SETMYAVATAR, &CTelegramProto::SvcSetMyAvatar); - HookProtoEvent(ME_OPT_INITIALISE, &CMTProto::OnOptionsInit); - HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CMTProto::OnDbMarkedRead); + HookProtoEvent(ME_OPT_INITIALISE, &CTelegramProto::OnOptionsInit); + HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CTelegramProto::OnDbMarkedRead); // default contacts group if (m_wszDefaultGroup == NULL) @@ -61,11 +61,11 @@ CMTProto::CMTProto(const char* protoName, const wchar_t* userName) : // HookProtoEvent(ME_GC_BUILDMENU, &WhatsAppProto::GcMenuHook); } -CMTProto::~CMTProto() +CTelegramProto::~CTelegramProto() { } -void CMTProto::OnModulesLoaded() +void CTelegramProto::OnModulesLoaded() { CMStringA szId(getMStringA(DBKEY_ID)); if (!szId.IsEmpty()) @@ -82,12 +82,12 @@ void CMTProto::OnModulesLoaded() } } -void CMTProto::OnShutdown() +void CTelegramProto::OnShutdown() { m_bTerminated = true; } -void CMTProto::OnErase() +void CTelegramProto::OnErase() { m_bUnregister = true; ServerThread(0); @@ -95,7 +95,7 @@ void CMTProto::OnErase() DeleteDirectoryTreeW(GetProtoFolder(), false); } -int CMTProto::OnDbMarkedRead(WPARAM hContact, LPARAM hDbEvent) +int CTelegramProto::OnDbMarkedRead(WPARAM hContact, LPARAM hDbEvent) { if (!hContact) return 0; @@ -127,7 +127,7 @@ int CMTProto::OnDbMarkedRead(WPARAM hContact, LPARAM hDbEvent) return 0; } -INT_PTR CMTProto::GetCaps(int type, MCONTACT) +INT_PTR CTelegramProto::GetCaps(int type, MCONTACT) { switch (type) { case PFLAGNUM_1: @@ -145,7 +145,7 @@ INT_PTR CMTProto::GetCaps(int type, MCONTACT) } } -int CMTProto::SendMsg(MCONTACT hContact, int, const char *pszMessage) +int CTelegramProto::SendMsg(MCONTACT hContact, int, const char *pszMessage) { ptrA szId(getStringA(hContact, DBKEY_ID)); if (szId == nullptr) @@ -154,7 +154,7 @@ int CMTProto::SendMsg(MCONTACT hContact, int, const char *pszMessage) return SendTextMessage(_atoi64(szId), pszMessage); } -int CMTProto::SetStatus(int iNewStatus) +int CTelegramProto::SetStatus(int iNewStatus) { if (m_iDesiredStatus == iNewStatus) return 0; @@ -185,7 +185,7 @@ int CMTProto::SetStatus(int iNewStatus) m_iStatus = ID_STATUS_CONNECTING; ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus); - ForkThread(&CMTProto::ServerThread); + ForkThread(&CTelegramProto::ServerThread); } else if (isRunning()) { m_iStatus = m_iDesiredStatus; diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h index 3a5a622198..a303f81eb9 100644 --- a/protocols/Telegram/src/proto.h +++ b/protocols/Telegram/src/proto.h @@ -8,9 +8,9 @@ #define DBKEY_AVATAR_PATH "AvatarPath" #define DBKEY_AVATAR_TYPE "AvatarType" -class CMTProto; -typedef void (CMTProto:: *TG_QUERY_HANDLER)(td::ClientManager::Response &response); -typedef void (CMTProto:: *TG_QUERY_HANDLER_FULL)(td::ClientManager::Response &response, void *pUserInfo); +class CTelegramProto; +typedef void (CTelegramProto:: *TG_QUERY_HANDLER)(td::ClientManager::Response &response); +typedef void (CTelegramProto:: *TG_QUERY_HANDLER_FULL)(td::ClientManager::Response &response, void *pUserInfo); struct TG_REQUEST_BASE { @@ -23,7 +23,7 @@ struct TG_REQUEST_BASE td::ClientManager::RequestId requestId; - virtual void Execute(CMTProto *ppro, td::ClientManager::Response &response) = 0; + virtual void Execute(CTelegramProto *ppro, td::ClientManager::Response &response) = 0; }; struct TG_REQUEST : public TG_REQUEST_BASE @@ -35,7 +35,7 @@ struct TG_REQUEST : public TG_REQUEST_BASE TG_QUERY_HANDLER pHandler; - void Execute(CMTProto *ppro, td::ClientManager::Response &response) override + void Execute(CTelegramProto *ppro, td::ClientManager::Response &response) override { (ppro->*pHandler)(response); } @@ -52,7 +52,7 @@ struct TG_REQUEST_FULL : public TG_REQUEST_BASE TG_QUERY_HANDLER_FULL pHandler; void *pUserInfo; - void Execute(CMTProto *ppro, td::ClientManager::Response &response) override + void Execute(CTelegramProto *ppro, td::ClientManager::Response &response) override { (ppro->*pHandler)(response, pUserInfo); } @@ -75,12 +75,12 @@ struct TG_USER time_t m_timer1 = 0, m_timer2 = 0; }; -class CMTProto : public PROTO +class CTelegramProto : public PROTO { class CProtoImpl { - friend class CMTProto; - CMTProto &m_proto; + friend class CTelegramProto; + CTelegramProto &m_proto; CTimer m_keepAlive, m_markRead; void OnKeepAlive(CTimer *) @@ -91,7 +91,7 @@ class CMTProto : public PROTO { m_proto.SendMarkRead(); } - CProtoImpl(CMTProto &pro) : + CProtoImpl(CTelegramProto &pro) : m_proto(pro), m_markRead(Miranda_GetSystemWindow(), UINT_PTR(this)), m_keepAlive(Miranda_GetSystemWindow(), UINT_PTR(this)+1) @@ -169,8 +169,8 @@ public: ////////////////////////////////////////////////////////////////////////////////////// // Ctors - CMTProto(const char *protoName, const wchar_t *userName); - ~CMTProto(); + CTelegramProto(const char *protoName, const wchar_t *userName); + ~CTelegramProto(); ////////////////////////////////////////////////////////////////////////////////////// // Virtual functions diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 690f18295b..befa3fb7ab 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -17,12 +17,12 @@ along with this program. If not, see . #include "stdafx.h" -void CMTProto::OnEndSession(td::ClientManager::Response&) +void CTelegramProto::OnEndSession(td::ClientManager::Response&) { m_bTerminated = true; } -void __cdecl CMTProto::ServerThread(void *) +void __cdecl CTelegramProto::ServerThread(void *) { m_bTerminated = m_bAuthorized = false; @@ -38,12 +38,12 @@ void __cdecl CMTProto::ServerThread(void *) m_pClientMmanager = std::move(nullptr); } -void CMTProto::LogOut() +void CTelegramProto::LogOut() { if (m_bTerminated) return; - debugLogA("CMTProto::OnLoggedOut"); + debugLogA("CTelegramProto::OnLoggedOut"); m_bTerminated = true; m_bAuthorized = false; @@ -54,18 +54,18 @@ void CMTProto::LogOut() setAllContactStatuses(ID_STATUS_OFFLINE, false); } -void CMTProto::OnLoggedIn() +void CTelegramProto::OnLoggedIn() { m_bAuthorized = true; - debugLogA("CMTProto::OnLoggedIn"); + debugLogA("CTelegramProto::OnLoggedIn"); ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, m_iDesiredStatus); m_iStatus = m_iDesiredStatus; if (m_bUnregister) { SendQuery(new TD::terminateSession()); - SendQuery(new TD::logOut(), &CMTProto::OnEndSession); + SendQuery(new TD::logOut(), &CTelegramProto::OnEndSession); } else { m_impl.m_keepAlive.Start(1000); @@ -76,7 +76,7 @@ void CMTProto::OnLoggedIn() /////////////////////////////////////////////////////////////////////////////// -void CMTProto::SendKeepAlive() +void CTelegramProto::SendKeepAlive() { time_t now = time(0); @@ -93,7 +93,7 @@ void CMTProto::SendKeepAlive() } } -void CMTProto::SendMarkRead() +void CTelegramProto::SendMarkRead() { m_impl.m_markRead.Stop(); @@ -105,7 +105,7 @@ void CMTProto::SendMarkRead() /////////////////////////////////////////////////////////////////////////////// -void CMTProto::ProcessResponse(td::ClientManager::Response response) +void CTelegramProto::ProcessResponse(td::ClientManager::Response response) { if (!response.object) return; @@ -163,7 +163,7 @@ void CMTProto::ProcessResponse(td::ClientManager::Response response) ///////////////////////////////////////////////////////////////////////////////////////// -void CMTProto::OnSendMessage(td::ClientManager::Response &response, void *pUserInfo) +void CTelegramProto::OnSendMessage(td::ClientManager::Response &response, void *pUserInfo) { if (!response.object) return; @@ -182,7 +182,7 @@ void CMTProto::OnSendMessage(td::ClientManager::Response &response, void *pUserI } } -int CMTProto::SendTextMessage(uint64_t chatId, const char *pszMessage) +int CTelegramProto::SendTextMessage(uint64_t chatId, const char *pszMessage) { int ret = m_iMsgId++; @@ -193,12 +193,12 @@ int CMTProto::SendTextMessage(uint64_t chatId, const char *pszMessage) auto *pMessage = new TD::sendMessage(); pMessage->chat_id_ = chatId; pMessage->input_message_content_ = std::move(pContent); - SendQuery(pMessage, &CMTProto::OnSendMessage, (void*)ret); + SendQuery(pMessage, &CTelegramProto::OnSendMessage, (void*)ret); return ret; } -void CMTProto::SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER pHandler) +void CTelegramProto::SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER pHandler) { int queryId = ++m_iQueryId; @@ -211,7 +211,7 @@ void CMTProto::SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER pHandler) m_arRequests.insert(new TG_REQUEST(queryId, pHandler)); } -void CMTProto::SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER_FULL pHandler, void *pUserInfo) +void CTelegramProto::SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER_FULL pHandler, void *pUserInfo) { int queryId = ++m_iQueryId; @@ -226,7 +226,7 @@ void CMTProto::SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER_FULL pHandler, vo /////////////////////////////////////////////////////////////////////////////// -void CMTProto::ProcessChat(TD::updateNewChat *pObj) +void CTelegramProto::ProcessChat(TD::updateNewChat *pObj) { auto &pChat = pObj->chat_; if (pChat->type_->get_id() != TD::chatTypePrivate::ID) { @@ -239,7 +239,7 @@ void CMTProto::ProcessChat(TD::updateNewChat *pObj) setUString(pUser->hContact, "Nick", pChat->title_.c_str()); } -void CMTProto::ProcessChatPosition(TD::updateChatPosition *pObj) +void CTelegramProto::ProcessChatPosition(TD::updateChatPosition *pObj) { if (pObj->position_->get_id() != TD::chatPosition::ID) { debugLogA("Unsupport position"); @@ -268,7 +268,7 @@ void CMTProto::ProcessChatPosition(TD::updateChatPosition *pObj) } } -void CMTProto::ProcessGroups(TD::updateChatFilters *pObj) +void CTelegramProto::ProcessGroups(TD::updateChatFilters *pObj) { for (auto &grp : pObj->chat_filters_) { if (grp->icon_name_ != "Custom") @@ -293,7 +293,7 @@ void CMTProto::ProcessGroups(TD::updateChatFilters *pObj) } } -void CMTProto::ProcessMarkRead(TD::updateChatReadInbox *pObj) +void CTelegramProto::ProcessMarkRead(TD::updateChatReadInbox *pObj) { auto *pUser = FindUser(pObj->chat_id_); if (pUser == nullptr) { @@ -325,7 +325,7 @@ void CMTProto::ProcessMarkRead(TD::updateChatReadInbox *pObj) } } -void CMTProto::ProcessMessage(TD::updateNewMessage *pObj) +void CTelegramProto::ProcessMessage(TD::updateNewMessage *pObj) { auto &pMessage = pObj->message_; @@ -359,7 +359,7 @@ void CMTProto::ProcessMessage(TD::updateNewMessage *pObj) ProtoChainRecvMsg(pUser->hContact, &pre); } -void CMTProto::ProcessStatus(TD::updateUserStatus *pObj) +void CTelegramProto::ProcessStatus(TD::updateUserStatus *pObj) { if (auto *pUser = FindUser(pObj->user_id_)) { if (pObj->status_->get_id() == TD::userStatusOnline::ID) @@ -372,7 +372,7 @@ void CMTProto::ProcessStatus(TD::updateUserStatus *pObj) } } -void CMTProto::ProcessUser(TD::updateUser *pObj) +void CTelegramProto::ProcessUser(TD::updateUser *pObj) { auto *pUser = pObj->user_.get(); diff --git a/protocols/Telegram/src/stdafx.h b/protocols/Telegram/src/stdafx.h index ce2aaf4abf..340270df0a 100644 --- a/protocols/Telegram/src/stdafx.h +++ b/protocols/Telegram/src/stdafx.h @@ -36,7 +36,7 @@ namespace TD = td::td_api; #include "proto.h" #include "utils.h" -struct CMPlugin : public ACCPROTOPLUGIN +struct CMPlugin : public ACCPROTOPLUGIN { CMPlugin(); diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp index df4a0d9118..b2eaeac1ca 100644 --- a/protocols/Telegram/src/utils.cpp +++ b/protocols/Telegram/src/utils.cpp @@ -17,7 +17,7 @@ along with this program. If not, see . #include "stdafx.h" -void CMTProto::UpdateString(MCONTACT hContact, const char *pszSetting, const std::string &str) +void CTelegramProto::UpdateString(MCONTACT hContact, const char *pszSetting, const std::string &str) { if (str.empty()) delSetting(hContact, pszSetting); @@ -28,7 +28,7 @@ void CMTProto::UpdateString(MCONTACT hContact, const char *pszSetting, const std ///////////////////////////////////////////////////////////////////////////////////////// // Users -TG_USER* CMTProto::FindUser(uint64_t id) +TG_USER* CTelegramProto::FindUser(uint64_t id) { if (auto *pCache = m_arUsers.find((TG_USER *)&id)) return pCache; @@ -36,7 +36,7 @@ TG_USER* CMTProto::FindUser(uint64_t id) return nullptr; } -TG_USER* CMTProto::AddUser(uint64_t id, bool bIsChat) +TG_USER* CTelegramProto::AddUser(uint64_t id, bool bIsChat) { auto *pUser = FindUser(id); if (pUser != nullptr) @@ -67,7 +67,7 @@ TG_USER* CMTProto::AddUser(uint64_t id, bool bIsChat) ///////////////////////////////////////////////////////////////////////////////////////// // Popups -void CMTProto::InitPopups(void) +void CTelegramProto::InitPopups(void) { g_plugin.addPopupOption(CMStringW(FORMAT, TranslateT("%s error notifications"), m_tszUserName), m_bUsePopups); @@ -90,7 +90,7 @@ void CMTProto::InitPopups(void) IcoLib_ReleaseIcon(ppc.hIcon); } -void CMTProto::Popup(MCONTACT hContact, const wchar_t *szMsg, const wchar_t *szTitle) +void CTelegramProto::Popup(MCONTACT hContact, const wchar_t *szMsg, const wchar_t *szTitle) { if (!m_bUsePopups) return; -- cgit v1.2.3