From f1c8069fba15a042ba2824ee6dc48a891f8ccd2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 3 Nov 2012 19:03:28 +0000 Subject: Facebook: - use homepage from mobile facebook = much faster (and smaller ;)) logging in - always getting unread messages (not "experimental" anymore) git-svn-id: http://svn.miranda-ng.org/main/trunk@2168 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/connection.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'protocols/FacebookRM/src/connection.cpp') diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp index d041e0344f..4abded5872 100644 --- a/protocols/FacebookRM/src/connection.cpp +++ b/protocols/FacebookRM/src/connection.cpp @@ -82,20 +82,19 @@ void FacebookProto::ChangeStatus(void*) ResetEvent(update_loop_lock_); - if ( NegotiateConnection( )) - { - facy.last_feeds_update_ = ::time( NULL ); - - facy.home(); + if (NegotiateConnection() && facy.home()) + { facy.reconnect(); - facy.load_friends(); // Process Friends requests ForkThread( &FacebookProto::ProcessFriendRequests, this, NULL ); - if (getByte(FACEBOOK_KEY_PARSE_MESSAGES, DEFAULT_PARSE_MESSAGES)) - ForkThread( &FacebookProto::ProcessUnreadMessages, this ); + // Get unread messages + ForkThread( &FacebookProto::ProcessUnreadMessages, this ); + + // Get notifications + ForkThread( &FacebookProto::ProcessNotifications, this ); setDword( "LogonTS", (DWORD)time(NULL)); ForkThread( &FacebookProto::UpdateLoop, this ); @@ -180,6 +179,9 @@ bool FacebookProto::NegotiateConnection( ) DBFreeVariant(&dbv); } + // Refresh last time of feeds update + facy.last_feeds_update_ = ::time(NULL); + // Get info about secured connection facy.https_ = DBGetContactSettingByte(NULL, m_szModuleName, FACEBOOK_KEY_FORCE_HTTPS, DEFAULT_FORCE_HTTPS ) != 0; -- cgit v1.2.3