summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-04-26 18:36:59 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-04-26 18:36:59 +0300
commit2c13b44d3ecdccabbb0e02ca693711b44bfa3d6e (patch)
treec7b3c61bfcd835b32ef73c57ff2a7e2255edc0b0
parent5006023a9f83ac18262ebc5c8078e05e3dead6bf (diff)
Teams: fix for loading private chat's history
-rw-r--r--protocols/Teams/src/teams_history.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/protocols/Teams/src/teams_history.cpp b/protocols/Teams/src/teams_history.cpp
index e83d660eb4..ced9997b25 100644
--- a/protocols/Teams/src/teams_history.cpp
+++ b/protocols/Teams/src/teams_history.cpp
@@ -67,8 +67,11 @@ void CTeamsProto::OnSyncConversations(MHttpResponse *response, AsyncHttpRequest
case 8:
case 2:
CMStringA szChatId(it["properties"]["onetoonethreadid"].as_mstring());
- if (!szChatId.IsEmpty() && hContact)
+ if (!szChatId.IsEmpty() && hContact) {
+ if (szChatId.Left(3) != "19:")
+ szChatId.Insert(0, "19:");
setString(hContact, "ChatId", szChatId);
+ }
FetchMissingHistory(it, hContact);
}
@@ -83,7 +86,11 @@ void CTeamsProto::OnSyncConversations(MHttpResponse *response, AsyncHttpRequest
void CTeamsProto::GetServerHistory(MCONTACT hContact, int pageSize, int64_t timestamp, bool bOperative)
{
- auto *pReq = new AsyncHttpRequest(REQUEST_GET, HOST_DEFAULT, "/users/ME/conversations/" + mir_urlEncode(getId(hContact)) + "/messages", &CTeamsProto::OnGetServerHistory);
+ CMStringA szChatId(getMStringA(hContact, "ChatId"));
+ if (szChatId.IsEmpty())
+ szChatId = getId(hContact);
+
+ auto *pReq = new AsyncHttpRequest(REQUEST_GET, HOST_DEFAULT, "/users/ME/conversations/" + mir_urlEncode(szChatId) + "/messages", &CTeamsProto::OnGetServerHistory);
pReq->hContact = hContact;
if (bOperative)
pReq->pUserInfo = this;