summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@update.uu.se>2021-06-11 23:37:01 +0200
committerMarcus Lundblad <ml@update.uu.se>2021-06-13 22:27:57 +0200
commit64d4619dfc24b324639157fd3b3f5ebf975460e0 (patch)
treeb0cb85324f9199ff09e80ab6a23343007efbd406
parentc9e21c74bcc50a1be25a8b2381bd3c8472978cc5 (diff)
downloadgnome-maps-64d4619dfc24b324639157fd3b3f5ebf975460e0.tar.gz
Remove Facebook checkin backend
-rw-r--r--src/facebookBackend.js118
-rw-r--r--src/org.gnome.Maps.src.gresource.xml1
2 files changed, 0 insertions, 119 deletions
diff --git a/src/facebookBackend.js b/src/facebookBackend.js
deleted file mode 100644
index 3df30adc..00000000
--- a/src/facebookBackend.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode: JS2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- */
-/* vim: set et ts=4 sw=4: */
-/*
- * Copyright (c) 2014 Damián Nohales
- *
- * GNOME Maps is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * GNOME Maps is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with GNOME Maps; if not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Damián Nohales <damiannohales@gmail.com>
- */
-
-const GFBGraph = imports.gi.GFBGraph;
-const GObject = imports.gi.GObject;
-
-const ServiceBackend = imports.serviceBackend;
-const SocialPlace = imports.socialPlace;
-
-const _PLACE_LINK_FORMAT = 'https://www.facebook.com/%s';
-
-var FacebookBackend = GObject.registerClass(
-class FacebookBackend extends ServiceBackend.ServiceBackend {
- get name() {
- return 'facebook';
- }
-
- createRestCall(authorizer) {
- return GFBGraph.new_rest_call(authorizer);
- }
-
- refreshAuthorization(authorizer, cancellable) {
- return authorizer.refresh_authorization(cancellable);
- }
-
- getAuthorizerAccount(authorizer) {
- return authorizer.goa_object;
- }
-
- createAuthorizer(account) {
- return new GFBGraph.GoaAuthorizer({ goa_object: account });
- }
-
- isTokenInvalid(restCall, data) {
- return data.error &&
- (data.error.code === 2500 || data.error.code === 104 || data.error.code === 190);
- }
-
- isInvalidCall(restCall, data) {
- if (!data) {
- return true;
- } else if (data.error) {
- return true;
- } else {
- return false;
- }
- }
-
- getCallResultCode(restCall, data) {
- return data ?
- (data.error ? data.error.code : null) :
- restCall.get_status_code();
- }
-
- getCallResultMessage(restCall, data) {
- return data ?
- (data.error ? data.error.message : null) :
- restCall.get_status_message();
- }
-
- _realPerformCheckIn(authorizer, checkIn, callback, cancellable) {
- this.callAsync(authorizer,
- 'POST',
- 'me/feed',
- {
- 'message': checkIn.message,
- 'place': checkIn.place.id,
- 'privacy_value': checkIn.privacy
- },
- callback,
- cancellable);
- }
-
- _realFindPlaces(authorizer, latitude, longitude, distance, callback, cancellable) {
- this.callAsync(authorizer,
- 'GET',
- 'search',
- {
- 'type': 'place',
- 'center': latitude + ',' + longitude,
- 'distance': distance
- },
- callback,
- cancellable);
- }
-
- createPlaces(rawData) {
- return rawData.data.map(function(place) {
- let link = _PLACE_LINK_FORMAT.format(place.id);
-
- return new SocialPlace.SocialPlace({ id: place.id,
- name: place.name,
- latitude: place.location.latitude,
- longitude: place.location.longitude,
- category: place.category,
- link: link,
- originalData: place });
- });
- }
-});
diff --git a/src/org.gnome.Maps.src.gresource.xml b/src/org.gnome.Maps.src.gresource.xml
index 3c5bc128..70877dee 100644
--- a/src/org.gnome.Maps.src.gresource.xml
+++ b/src/org.gnome.Maps.src.gresource.xml
@@ -13,7 +13,6 @@
<file>constants.js</file>
<file>epaf.js</file>
<file>exportViewDialog.js</file>
- <file>facebookBackend.js</file>
<file>favoritesPopover.js</file>
<file>foursquareBackend.js</file>
<file>foursquareGoaAuthorizer.js</file>