summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/src')
-rw-r--r--protocols/Telegram/src/proto.cpp2
-rw-r--r--protocols/Telegram/src/proto.h1
-rw-r--r--protocols/Telegram/src/server.cpp2
-rw-r--r--protocols/Telegram/src/userinfo.cpp4
-rw-r--r--protocols/Telegram/src/utils.cpp15
5 files changed, 21 insertions, 3 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index 3732e1a5e5..a1678331d2 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -111,6 +111,8 @@ CTelegramProto::CTelegramProto(const char* protoName, const wchar_t* userName) :
HookProtoEvent(ME_GC_MUTE, &CTelegramProto::GcMuteHook);
HookProtoEvent(ME_GC_EVENT, &CTelegramProto::GcEventHook);
HookProtoEvent(ME_GC_BUILDMENU, &CTelegramProto::GcMenuHook);
+
+ CheckCompatibility();
}
CTelegramProto::~CTelegramProto()
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h
index 2ec142edca..57eb9a2f35 100644
--- a/protocols/Telegram/src/proto.h
+++ b/protocols/Telegram/src/proto.h
@@ -367,6 +367,7 @@ class CTelegramProto : public PROTO<CTelegramProto>
int GetDefaultMute(const TG_USER *pUser);
+ void CheckCompatibility(void);
MCONTACT GetRealContact(const TG_USER *pUser, int64_t threadId = 0);
void RemoveFromClist(TG_USER *pUser);
void MarkRead(MCONTACT hContact, const CMStringA &szMaxId, bool bSent);
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index 4e783c06a6..714347b229 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -1328,7 +1328,7 @@ void CTelegramProto::ProcessUserInfo(TD::int53 userId, TD::userFullInfo *pObj)
if (pObj->bio_) {
CMStringA szNotes(GetFormattedText(pObj->bio_));
if (!szNotes.IsEmpty())
- setString(pUser->hContact, "Notes", szNotes);
+ setString(pUser->hContact, "About", szNotes);
}
}
}
diff --git a/protocols/Telegram/src/userinfo.cpp b/protocols/Telegram/src/userinfo.cpp
index 4c40c3b662..174266976f 100644
--- a/protocols/Telegram/src/userinfo.cpp
+++ b/protocols/Telegram/src/userinfo.cpp
@@ -72,10 +72,10 @@ public:
}
else {
DateTime_SetSystemtime(_hwndDate, GDT_NONE, NULL);
- DateTime_SetFormat(_hwndDate, TranslateT("Unspecified"));
+ SetWindowTextW(_hwndDate, TranslateT("Unspecified"));
}
- edtNotes.SetText(m_proto->getMStringW(m_hContact, "Notes"));
+ edtNotes.SetText(m_proto->getMStringW(m_hContact, "About"));
}
};
diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp
index c52a044c90..9ae6d8f9cb 100644
--- a/protocols/Telegram/src/utils.cpp
+++ b/protocols/Telegram/src/utils.cpp
@@ -281,6 +281,21 @@ TG_USER* CTelegramProto::GetSender(const TD::MessageSender *pSender)
/////////////////////////////////////////////////////////////////////////////////////////
+void CTelegramProto::CheckCompatibility()
+{
+ int iLevel = db_get_b(0, "Compatibility", m_szModuleName);
+
+ if (iLevel < 1) {
+ for (auto &cc : AccContacts())
+ delSetting(cc, "Notes");
+ delSetting("Notes");
+ }
+
+ db_set_b(0, "Compatibility", m_szModuleName, 1);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
bool CTelegramProto::CheckSearchUser(TG_USER *pUser)
{
auto pSearchId = std::find(m_searchIds.begin(), m_searchIds.end(), pUser->chatId);