summaryrefslogtreecommitdiff
path: root/protocols/Teams/src/teams_profile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Teams/src/teams_profile.cpp')
-rw-r--r--protocols/Teams/src/teams_profile.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/protocols/Teams/src/teams_profile.cpp b/protocols/Teams/src/teams_profile.cpp
index 29a04937c6..cf257aa839 100644
--- a/protocols/Teams/src/teams_profile.cpp
+++ b/protocols/Teams/src/teams_profile.cpp
@@ -100,8 +100,9 @@ void CTeamsProto::UpdateProfileAvatar(const JSONNode &root, MCONTACT hContact)
}
}
-//{"firstname":"Echo \/ Sound Test Service", "lastname" : null, "birthday" : null, "gender" : null, "country" : null, "city" : null, "language" : null, "homepage" : null, "about" : null, "province" : null, "jobtitle" : null, "emails" : [], "phoneMobile" : null, "phoneHome" : null, "phoneOffice" : null, "mood" : null, "richMood" : null, "avatarUrl" : null, "username" : "echo123"}
-void CTeamsProto::LoadProfile(MHttpResponse *response, AsyncHttpRequest *pRequest)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void CTeamsProto::OnGetProfileInfo(MHttpResponse *response, AsyncHttpRequest *pRequest)
{
MCONTACT hContact = (DWORD_PTR)pRequest->pUserInfo;
@@ -145,3 +146,11 @@ void CTeamsProto::LoadProfile(MHttpResponse *response, AsyncHttpRequest *pReques
ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, 0);
}
+
+void CTeamsProto::GetProfileInfo(MCONTACT hContact)
+{
+ auto *pReq = new AsyncHttpRequest(REQUEST_GET, HOST_API, 0, &CTeamsProto::OnGetProfileInfo);
+ pReq->m_szUrl.AppendFormat("/users/%s/profile", (hContact == 0) ? "self" : mir_urlEncode(getId(hContact)));
+ pReq->pUserInfo = (void *)hContact;
+ PushRequest(pReq);
+}