summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-02-10 11:59:44 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-02-10 11:59:44 +0300
commit33733576589076f080ddfa000b899843016a2597 (patch)
tree14b7ce9e4726fb230b22fa74e9f3e3b6b65e49f1 /protocols
parentdd914976e8eb566403056c8566941a391813868f (diff)
crash fix
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Telegram/src/proto.cpp2
-rw-r--r--protocols/Telegram/src/server.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index 9762c3c316..88fc2401ab 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -171,7 +171,7 @@ INT_PTR CTelegramProto::GetCaps(int type, MCONTACT)
case PFLAGNUM_2:
return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY;
case PFLAGNUM_4:
- return PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_IMSENDOFFLINE | PF4_OFFLINEFILES | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_SERVERMSGID;
+ return PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_SERVERMSGID;
case PFLAGNUM_5:
return PF2_SHORTAWAY | PF2_LONGAWAY;
case PFLAG_UNIQUEIDTEXT:
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index 59da2a3c9f..bbe86146e7 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -209,6 +209,9 @@ int CTelegramProto::SendTextMessage(int64_t chatId, const char *pszMessage)
void CTelegramProto::SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER pHandler)
{
+ if (!m_pClientMmanager)
+ return;
+
int queryId = ++m_iQueryId;
auto szDescr = to_string(*pFunc);
@@ -222,6 +225,9 @@ void CTelegramProto::SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER pHandler)
void CTelegramProto::SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER_FULL pHandler, void *pUserInfo)
{
+ if (!m_pClientMmanager)
+ return;
+
int queryId = ++m_iQueryId;
auto szDescr = to_string(*pFunc);