From 32cd08ae230797bf0287cda1d478265df3f9f61c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 17 Mar 2024 13:41:04 +0300 Subject: fixes #4284 (ICQ: support for changing our own first name, last name & about fields) --- protocols/ICQ-WIM/src/server.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'protocols/ICQ-WIM/src/server.cpp') diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 5d758f6b11..3dca2f8a6c 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -439,6 +439,10 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact, boo Json2string(hContact, it, "country", "Country", bIsPartial); } } + else { + Json2string(hContact, buddy, "firstName", "FirstName", bIsPartial); + Json2string(hContact, buddy, "lastName", "LastName", bIsPartial); + } CMStringW str = buddy["statusMsg"].as_mstring(); if (str.IsEmpty()) @@ -1406,6 +1410,22 @@ void CIcqProto::OnSearchResults(MHttpResponse *pReply, AsyncHttpRequest *pReq) ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)pReq); } +///////////////////////////////////////////////////////////////////////////////////////// + +void CIcqProto::PatchProfileInfo(const char *pszVariable, const wchar_t *pwszValue) +{ + if (!mir_wstrlen(pwszValue)) + return; + + auto *pReq = new AsyncRapiRequest(this, "/profile/update", nullptr, 1); + pReq->params << WCHAR_PARAM(pszVariable, pwszValue); + Push(pReq); + + char *buf = NEWSTR_ALLOCA(pszVariable); + buf[0] = _toupper(buf[0]); + setWString(buf, pwszValue); +} + ///////////////////////////////////////////////////////////////////////////////////////// // Send message -- cgit v1.2.3