diff options
author | George Hazan <george.hazan@gmail.com> | 2024-03-17 13:41:04 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-03-17 13:41:04 +0300 |
commit | 32cd08ae230797bf0287cda1d478265df3f9f61c (patch) | |
tree | 804d44bd2b3d841cb04ce6f3c6c72a1c5ade0f7b /protocols/ICQ-WIM/src/server.cpp | |
parent | 31705a905d2fa6e81a3c8cc40c45e7c0366d6c49 (diff) |
fixes #4284 (ICQ: support for changing our own first name, last name & about fields)
Diffstat (limited to 'protocols/ICQ-WIM/src/server.cpp')
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
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())
@@ -1407,6 +1411,22 @@ void CIcqProto::OnSearchResults(MHttpResponse *pReply, AsyncHttpRequest *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
void CIcqProto::OnSendMessage(MHttpResponse *pReply, AsyncHttpRequest *pReq)
|