From e4ab7cd45a4c45e81b8b862be68951da22334dd9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 5 Jun 2025 13:22:16 +0300 Subject: =?UTF-8?q?fixes=20#5044=20(Teams:=20=D0=98=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=B3=D1=80=D1=83?= =?UTF-8?q?=D0=BF=D1=87=D0=B0=D1=82=D1=8B=20"=D0=BD=D0=B0=20=D0=B4=D0=B2?= =?UTF-8?q?=D0=BE=D0=B8=D1=85"=20=D0=B4=D0=BE=D0=BB=D0=B6=D0=BD=D1=8B=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B0=D1=82=D1=8C?= =?UTF-8?q?=D1=81=D1=8F=20=D0=BA=D0=B0=D0=BA=20=D0=B3=D1=80=D1=83=D0=BF?= =?UTF-8?q?=D1=87=D0=B0=D1=82=D1=8B,=20=D0=B0=20=D0=BD=D0=B5=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=BA=20=D0=BB=D0=B8=D1=87=D0=BA=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Teams/src/teams_history.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/Teams/src/teams_history.cpp b/protocols/Teams/src/teams_history.cpp index 78221846cf..6930e90382 100644 --- a/protocols/Teams/src/teams_history.cpp +++ b/protocols/Teams/src/teams_history.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . void CTeamsProto::RefreshConversations() { auto *pReq = new AsyncHttpRequest(REQUEST_GET, HOST_DEFAULT, "/users/ME/conversations", &CTeamsProto::OnSyncConversations); - pReq << INT_PARAM("startTime", getLastTime(0)) << INT_PARAM("pageSize", 100) + pReq << INT64_PARAM("startTime", getLastTime(0)) << INT_PARAM("pageSize", 100) << CHAR_PARAM("view", "msnp24Equivalent") << CHAR_PARAM("targetType", "Passport|Skype|Lync|Thread|PSTN|Agent"); PushRequest(pReq); @@ -58,8 +58,21 @@ void CTeamsProto::OnSyncConversations(MHttpResponse *response, AsyncHttpRequest case 19: { auto &props = it["threadProperties"]; - if (!props["lastleaveat"]) - StartChatRoom(it["id"].as_mstring(), props["topic"].as_mstring(), props["version"].as_string().c_str()); + CMStringA szType = props["productThreadType"].as_mstring(), szChatType; + + int idx = szSkypename.ReverseFind('@'); + if (idx != -1) + szChatType = szSkypename.Mid(idx + 1); + + if (szType == "Chat" || szChatType == "thread.skype") { + if (!props["lastleaveat"]) + StartChatRoom(it["id"].as_mstring(), props["topic"].as_mstring(), props["version"].as_string().c_str()); + } + else if (szType == "OneToOneChat") { + hContact = FindContact(it["properties"]["addedBy"].as_string().c_str()); + if (hContact) + setString(hContact, "ChatId", szSkypename); + } } FetchMissingHistory(it, hContact); break; -- cgit v1.2.3