Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sociald] Add Facebook Signon sync adapter. Contributes to JB#15021
This commit adds a sync adapter which periodically forces a refresh of the Facebook account credentials, to avoid the situation where user interaction (via webview) is required to be able to continue to use the account. Contributes to JB#15021
- Loading branch information
Chris Adams
committed
Apr 16, 2014
1 parent
42a6061
commit 4edb44a
Showing
13 changed files
with
506 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SOURCES += $$PWD/facebooksignonsyncadaptor.cpp | ||
HEADERS += $$PWD/facebooksignonsyncadaptor.h | ||
INCLUDEPATH += $$PWD | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
TEMPLATE = lib | ||
|
||
TARGET = facebook-signon-client | ||
VERSION = 0.0.1 | ||
CONFIG += plugin | ||
|
||
include($$PWD/../../common.pri) | ||
include($$PWD/../facebook-common.pri) | ||
include($$PWD/facebook-signon.pri) | ||
|
||
target.path += /usr/lib/buteo-plugins-qt5 | ||
facebook_signon_sync_profile.path = /etc/buteo/profiles/sync | ||
facebook_signon_sync_profile.files = $$PWD/facebook.Signon.xml | ||
facebook_signon_client_plugin_xml.path = /etc/buteo/profiles/client | ||
facebook_signon_client_plugin_xml.files = $$PWD/facebook-signon.xml | ||
|
||
HEADERS += facebooksignonplugin.h | ||
SOURCES += facebooksignonplugin.cpp | ||
|
||
OTHER_FILES += \ | ||
facebook_signon_sync_profile.files \ | ||
facebook_signon_client_plugin_xml.files | ||
|
||
INSTALLS += \ | ||
target \ | ||
facebook_signon_sync_profile \ | ||
facebook_signon_client_plugin_xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<profile name="facebook-signon" type="client" > | ||
<field name="Sync Direction" /> | ||
</profile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<profile name="facebook.Signon" type="sync" > | ||
<key name="category" value="signon" /> | ||
<key name="enabled" value="true" /> | ||
<key name="use_accounts" value="false" /> | ||
<key name="destinationtype" value="online" /> | ||
<key name="hidden" value="true" /> | ||
<key name="displayname" value="Facebook Signon"/> | ||
|
||
<schedule enabled="false" interval="90" days="1,2,3,4,5,6,7" syncconfiguredtime="" time="" /> | ||
|
||
<profile name="facebook-signon" type="client" > | ||
<key name="Sync Direction" value="from-remote" /> | ||
</profile> | ||
</profile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2014 Jolla Ltd. | ||
** Contact: Chris Adams <chris.adams@jolla.com> | ||
** | ||
****************************************************************************/ | ||
|
||
#include "facebooksignonplugin.h" | ||
#include "facebooksignonsyncadaptor.h" | ||
#include "socialnetworksyncadaptor.h" | ||
|
||
extern "C" FacebookSignonPlugin* createPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *callbackInterface) | ||
{ | ||
return new FacebookSignonPlugin(pluginName, profile, callbackInterface); | ||
} | ||
|
||
extern "C" void destroyPlugin(FacebookSignonPlugin* plugin) | ||
{ | ||
delete plugin; | ||
} | ||
|
||
FacebookSignonPlugin::FacebookSignonPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *callbackInterface) | ||
: SocialdButeoPlugin(pluginName, profile, callbackInterface, | ||
QStringLiteral("facebook"), | ||
SocialNetworkSyncAdaptor::dataTypeName(SocialNetworkSyncAdaptor::Signon)) | ||
{ | ||
} | ||
|
||
FacebookSignonPlugin::~FacebookSignonPlugin() | ||
{ | ||
} | ||
|
||
SocialNetworkSyncAdaptor *FacebookSignonPlugin::createSocialNetworkSyncAdaptor() | ||
{ | ||
return new FacebookSignonSyncAdaptor(this); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2014 Jolla Ltd. | ||
** Contact: Chris Adams <chris.adams@jolla.com> | ||
** | ||
****************************************************************************/ | ||
|
||
#ifndef FACEBOOKSIGNONPLUGIN_H | ||
#define FACEBOOKSIGNONPLUGIN_H | ||
|
||
#include "socialdbuteoplugin.h" | ||
#include <ClientPlugin.h> | ||
|
||
class FacebookSignonPlugin : public SocialdButeoPlugin | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
FacebookSignonPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *cbInterface); | ||
~FacebookSignonPlugin(); | ||
|
||
protected: | ||
SocialNetworkSyncAdaptor *createSocialNetworkSyncAdaptor(); | ||
}; | ||
|
||
extern "C" FacebookSignonPlugin* createPlugin(const QString& pluginName, | ||
const Buteo::SyncProfile& profile, | ||
Buteo::PluginCbInterface *cbInterface); | ||
|
||
extern "C" void destroyPlugin(FacebookSignonPlugin* client); | ||
|
||
#endif // FACEBOOKSIGNONPLUGIN_H |
Oops, something went wrong.