From a61c8728b379057fe7f0a0d86fe0b037598229dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20P=C3=B6sel?= <robyer@seznam.cz>
Date: Mon, 25 Jul 2016 19:44:19 +0000
Subject: Facebook: Rename "On this day" to "Memories" as Facebook calls it,
 and use better icon for it

git-svn-id: http://svn.miranda-ng.org/main/trunk@17132 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 protocols/FacebookRM/res/facebook.rc    |   1 +
 protocols/FacebookRM/res/memories.ico   | Bin 0 -> 1342 bytes
 protocols/FacebookRM/src/connection.cpp |   2 +-
 protocols/FacebookRM/src/db.h           |   2 +-
 protocols/FacebookRM/src/events.cpp     |   2 +-
 protocols/FacebookRM/src/process.cpp    |   4 ++--
 protocols/FacebookRM/src/proto.cpp      |  16 ++++++++--------
 protocols/FacebookRM/src/proto.h        |   4 ++--
 protocols/FacebookRM/src/resource.h     |   3 ++-
 protocols/FacebookRM/src/theme.cpp      |   9 +++++----
 10 files changed, 23 insertions(+), 20 deletions(-)
 create mode 100644 protocols/FacebookRM/res/memories.ico

(limited to 'protocols')

diff --git a/protocols/FacebookRM/res/facebook.rc b/protocols/FacebookRM/res/facebook.rc
index f790efddc8..bdcee34e4e 100644
--- a/protocols/FacebookRM/res/facebook.rc
+++ b/protocols/FacebookRM/res/facebook.rc
@@ -58,6 +58,7 @@ IDI_NEWSFEED            ICON                    "feeds.ico"
 IDI_FRIENDS             ICON                    "friends.ico"
 IDI_CONVERSATION        ICON                    "conversation.ico"
 IDI_READ                ICON                    "read.ico"
+IDI_MEMORIES            ICON                    "memories.ico"
 
 IDI_ANGRY               ICON                    "angry.ico"
 IDI_HAHA                ICON                    "haha.ico"
diff --git a/protocols/FacebookRM/res/memories.ico b/protocols/FacebookRM/res/memories.ico
new file mode 100644
index 0000000000..d216611b8a
Binary files /dev/null and b/protocols/FacebookRM/res/memories.ico differ
diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp
index ea24c8ca37..1b44b4c544 100644
--- a/protocols/FacebookRM/src/connection.cpp
+++ b/protocols/FacebookRM/src/connection.cpp
@@ -129,7 +129,7 @@ void FacebookProto::ChangeStatus(void*)
 
 			// Load on this day posts
 			if (getByte(FACEBOOK_KEY_EVENT_ON_THIS_DAY_ENABLE, DEFAULT_EVENT_ON_THIS_DAY_ENABLE))
-				ForkThread(&FacebookProto::ProcessOnThisDay, NULL);
+				ForkThread(&FacebookProto::ProcessMemories, NULL);
 
 			setDword(FACEBOOK_KEY_LOGON_TS, (DWORD)time(NULL));
 			ForkThread(&FacebookProto::UpdateLoop, NULL);
diff --git a/protocols/FacebookRM/src/db.h b/protocols/FacebookRM/src/db.h
index 5907a4d6b2..a89f9c33f2 100644
--- a/protocols/FacebookRM/src/db.h
+++ b/protocols/FacebookRM/src/db.h
@@ -79,7 +79,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define FACEBOOK_KEY_EVENT_FEEDS_ENABLE			"EventFeedsEnable"
 #define FACEBOOK_KEY_EVENT_FRIENDSHIP_ENABLE	"EventFriendshipEnable"
 #define FACEBOOK_KEY_EVENT_TICKER_ENABLE		"EventTickerEnable"
-#define FACEBOOK_KEY_EVENT_ON_THIS_DAY_ENABLE	"EventOnThisDayEnable"
+#define FACEBOOK_KEY_EVENT_ON_THIS_DAY_ENABLE	"EventMemoriesEnable"
 #define FACEBOOK_KEY_FEED_TYPE					"EventFeedsType"
 
 // Hidden account DB keys (can't be changed through GUI)
diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp
index 9b6bb9110f..0fc052b563 100644
--- a/protocols/FacebookRM/src/events.cpp
+++ b/protocols/FacebookRM/src/events.cpp
@@ -66,7 +66,7 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO
 		break;
 
 	case FACEBOOK_EVENT_ON_THIS_DAY:
-		mir_snprintf(name, "%s_%s", m_szModuleName, "OnThisDay");		
+		mir_snprintf(name, "%s_%s", m_szModuleName, "Memories");		
 		flags |= NIIF_INFO;
 		break;
 	}
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 95c8e143f2..1a169b684c 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -666,7 +666,7 @@ void parseFeeds(const std::string &text, std::vector<facebook_newsfeed *> &news,
 	last_post_time = new_time;
 }
 
-void FacebookProto::ProcessOnThisDay(void*)
+void FacebookProto::ProcessMemories(void*)
 {
 	if (isOffline())
 		return;
@@ -698,7 +698,7 @@ void FacebookProto::ProcessOnThisDay(void*)
 			parseFeeds(html, news, new_time, true);
 
 			if (!news.empty()) {
-				SkinPlaySound("OnThisDay");
+				SkinPlaySound("Memories");
 			}
 
 			for (std::vector<facebook_newsfeed*>::size_type i = 0; i < news.size(); i++)
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 7f7720f350..0795f2ba16 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -667,11 +667,11 @@ INT_PTR FacebookProto::CheckNotifications(WPARAM, LPARAM)
 	return 0;
 }
 
-INT_PTR FacebookProto::CheckOnThisDay(WPARAM, LPARAM)
+INT_PTR FacebookProto::CheckMemories(WPARAM, LPARAM)
 {
 	if (!isOffline()) {
-		NotifyEvent(m_tszUserName, TranslateT("Loading what happened on this day..."), NULL, FACEBOOK_EVENT_OTHER);
-		ForkThread(&FacebookProto::ProcessOnThisDay, NULL);
+		NotifyEvent(m_tszUserName, TranslateT("Loading memories..."), NULL, FACEBOOK_EVENT_OTHER);
+		ForkThread(&FacebookProto::ProcessMemories, NULL);
 	}
 	return 0;
 }
@@ -1074,12 +1074,12 @@ void FacebookProto::InitPopups()
 	ppc.iSeconds = 0;
 	popupClasses.push_back(Popup_RegisterClass(&ppc));
 
-	// On this day
-	mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("\"On this day\" posts"));
-	mir_snprintf(name, "%s_%s", m_szModuleName, "OnThisDay");
+	// On this day (memories)
+	mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Memories"));
+	mir_snprintf(name, "%s_%s", m_szModuleName, "Memories");
 	ppc.ptszDescription = desc;
 	ppc.pszName = name;
-	ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("newsfeed"));
+	ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle("memories"));
 	ppc.colorBack = RGB(255, 255, 255); // white
 	ppc.colorText = RGB(0, 0, 0); // black
 	ppc.iSeconds = 0;
@@ -1125,7 +1125,7 @@ void FacebookProto::InitSounds()
 	SkinAddNewSoundExT("OtherEvent", m_tszUserName, LPGENT("Other event"));
 	SkinAddNewSoundExT("Friendship", m_tszUserName, LPGENT("Friendship event"));
 	SkinAddNewSoundExT("Ticker", m_tszUserName, LPGENT("Ticker event"));
-	SkinAddNewSoundExT("OnThisDay", m_tszUserName, LPGENT("\"On this day\" event"));
+	SkinAddNewSoundExT("Memories", m_tszUserName, LPGENT("Memories"));
 }
 
 /**
diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h
index fb7502e1af..92a2799b88 100644
--- a/protocols/FacebookRM/src/proto.h
+++ b/protocols/FacebookRM/src/proto.h
@@ -127,7 +127,7 @@ public:
 	INT_PTR __cdecl CheckNewsfeeds(WPARAM, LPARAM);
 	INT_PTR __cdecl CheckFriendRequests(WPARAM, LPARAM);
 	INT_PTR __cdecl CheckNotifications(WPARAM, LPARAM);
-	INT_PTR __cdecl CheckOnThisDay(WPARAM, LPARAM);
+	INT_PTR __cdecl CheckMemories(WPARAM, LPARAM);
 	INT_PTR __cdecl GetNotificationsCount(WPARAM, LPARAM);
 
 	INT_PTR __cdecl OnJoinChat(WPARAM,LPARAM);
@@ -175,7 +175,7 @@ public:
 	void __cdecl ProcessPages(void*);
 	void __cdecl LoadLastMessages(void*);
 	void __cdecl SyncThreads(void*);
-	void __cdecl ProcessOnThisDay(void*);
+	void __cdecl ProcessMemories(void*);
 
 	// Worker threads
 	void __cdecl SignOn(void*);
diff --git a/protocols/FacebookRM/src/resource.h b/protocols/FacebookRM/src/resource.h
index 3752e107e2..aea6099feb 100644
--- a/protocols/FacebookRM/src/resource.h
+++ b/protocols/FacebookRM/src/resource.h
@@ -26,6 +26,7 @@
 #define IDI_LOVE                        138
 #define IDI_SAD                         139
 #define IDI_WOW                         140
+#define IDI_MEMORIES                    141
 #define IDC_UN                          1001
 #define IDC_PW                          1002
 #define IDC_NEWACCOUNTLINK              1003
@@ -75,7 +76,7 @@
 // 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        135
+#define _APS_NEXT_RESOURCE_VALUE        142
 #define _APS_NEXT_COMMAND_VALUE         40001
 #define _APS_NEXT_CONTROL_VALUE         1219
 #define _APS_NEXT_SYMED_VALUE           134
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index b6f6481a14..70ca0eb696 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -43,6 +43,7 @@ static IconItem icons[] =
 	{ LPGEN("Poke"),               "poke",         IDI_POKE         },
 	{ LPGEN("Notification"),       "notification", IDI_NOTIFICATION },
 	{ LPGEN("Newsfeed"),           "newsfeed",     IDI_NEWSFEED     },
+	{ LPGEN("Memories"),           "memories",     IDI_MEMORIES     },
 	{ LPGEN("Friendship details"), "friendship",   IDI_FRIENDS      },
 	{ LPGEN("Conversation"),       "conversation", IDI_CONVERSATION },
 	{ LPGEN("Message read"),       "read",         IDI_READ         },
@@ -266,10 +267,10 @@ void FacebookProto::InitMenu()
 	mi.hIcolibItem = GetIconHandle("newsfeed");
 	Menu_AddProtoMenuItem(&mi, m_szModuleName);
 
-	mi.pszService = "/CheckOnThisDay";
-	CreateProtoService(mi.pszService, &FacebookProto::CheckOnThisDay);
-	mi.name.a = LPGEN("Check \"On this day\" posts");
-	mi.hIcolibItem = GetIconHandle("newsfeed");
+	mi.pszService = "/CheckMemories";
+	CreateProtoService(mi.pszService, &FacebookProto::CheckMemories);
+	mi.name.a = LPGEN("Check memories");
+	mi.hIcolibItem = GetIconHandle("memories");
 	Menu_AddProtoMenuItem(&mi, m_szModuleName);
 
 	mi.pszService = "/CheckNotifications";
-- 
cgit v1.2.3