From 59f36ebf68039d1ad649772dbb8d99217fbd079f Mon Sep 17 00:00:00 2001
From: George Hazan <ghazan@miranda.im>
Date: Sun, 30 Dec 2018 22:33:11 +0300
Subject: ICQ: fix for retrieving location data

---
 protocols/Icq10/src/server.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'protocols/Icq10')

diff --git a/protocols/Icq10/src/server.cpp b/protocols/Icq10/src/server.cpp
index e1cf50809f..006b2d6959 100644
--- a/protocols/Icq10/src/server.cpp
+++ b/protocols/Icq10/src/server.cpp
@@ -135,13 +135,16 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy)
 				setByte(hContact, "Gender", 'F');
 		}
 
-		const JSONNode &homeAddress = profile["homeAddress"];
-		if (homeAddress) {
-			str = homeAddress["city"].as_mstring();
+		for (auto &it : profile["homeAddress"]) {
+			str = it["city"].as_mstring();
 			if (!str.IsEmpty())
 				setWString(hContact, "City", str);
 
-			str = homeAddress["country"].as_mstring();
+			str = it["state"].as_mstring();
+			if (!str.IsEmpty())
+				setWString(hContact, "State", str);
+
+			str = it["country"].as_mstring();
 			if (!str.IsEmpty())
 				setWString(hContact, "Country", str);
 		}
-- 
cgit v1.2.3