From 054110d7777848d931e22137ed2e4072334c6d58 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20P=C3=B6sel?= <robyer@seznam.cz>
Date: Sat, 14 Feb 2015 16:30:26 +0000
Subject: Facebook: Fix (hopefully) loading own avatar for some people with
 weird FB "version"; version bump

git-svn-id: http://svn.miranda-ng.org/main/trunk@12104 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 protocols/FacebookRM/src/communication.cpp | 11 +++++++++++
 protocols/FacebookRM/src/version.h         |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index c9f9bfd9e5..f366814d60 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -1078,6 +1078,17 @@ bool facebook_client::home()
 
 		// Get avatar
 		this->self_.image_url = utils::text::source_get_value(&resp.data, 3, "id=\"root", "<img src=\"", "\"");
+		
+		// Another attempt to get avatar
+		if (this->self_.image_url.empty()) {
+			this->self_.image_url = utils::text::source_get_value(&resp.data, 3, "id=\"root", "/photo.php?", "\"");
+			
+			// Prepare this special url (not direct image url) to be handled correctly in CheckAvatarChange()
+			// It must contain "/" at the beginning and also shouldn't contain "?" as parameters after that are stripped
+			if (!this->self_.image_url.empty())
+				this->self_.image_url = "/" + this->self_.image_url;
+		}
+
 		parent->debugLogA("      Got self avatar: %s", this->self_.image_url.c_str());
 		parent->CheckAvatarChange(NULL, this->self_.image_url);
 
diff --git a/protocols/FacebookRM/src/version.h b/protocols/FacebookRM/src/version.h
index 794b425e87..f4c9d6f9df 100644
--- a/protocols/FacebookRM/src/version.h
+++ b/protocols/FacebookRM/src/version.h
@@ -1,7 +1,7 @@
 #define __MAJOR_VERSION            0
 #define __MINOR_VERSION            2
 #define __RELEASE_NUM              10
-#define __BUILD_NUM                0
+#define __BUILD_NUM                1
 
 #include <stdver.h>
 
-- 
cgit v1.2.3