From 170694b6ea360be7a9cada26fa3b8dbdf4ef58c6 Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Fri, 20 Oct 2017 09:06:50 +0200 Subject: [PATCH] remove Tusky API (was needed for push notifications) --- .../com/keylesspalace/tusky/BaseActivity.java | 13 -------- .../keylesspalace/tusky/entity/Session.java | 28 ----------------- .../keylesspalace/tusky/network/TuskyApi.java | 30 ------------------- 3 files changed, 71 deletions(-) delete mode 100644 app/src/main/java/com/keylesspalace/tusky/entity/Session.java delete mode 100644 app/src/main/java/com/keylesspalace/tusky/network/TuskyApi.java diff --git a/app/src/main/java/com/keylesspalace/tusky/BaseActivity.java b/app/src/main/java/com/keylesspalace/tusky/BaseActivity.java index 96a29cf9..1421b782 100644 --- a/app/src/main/java/com/keylesspalace/tusky/BaseActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/BaseActivity.java @@ -37,7 +37,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.keylesspalace.tusky.json.SpannedTypeAdapter; import com.keylesspalace.tusky.network.MastodonApi; -import com.keylesspalace.tusky.network.TuskyApi; import com.keylesspalace.tusky.service.PullNotificationService; import com.keylesspalace.tusky.util.OkHttpUtils; @@ -56,7 +55,6 @@ public class BaseActivity extends AppCompatActivity { protected static final int SERVICE_REQUEST_CODE = 8574603; // This number is arbitrary. public MastodonApi mastodonApi; - public TuskyApi tuskyApi; protected Dispatcher mastodonApiDispatcher; @Override @@ -65,7 +63,6 @@ public class BaseActivity extends AppCompatActivity { redirectIfNotLoggedIn(); createMastodonApi(); - createTuskyApi(); /* There isn't presently a way to globally change the theme of a whole application at * runtime, just individual activities. So, each activity has to set its theme before any @@ -159,16 +156,6 @@ public class BaseActivity extends AppCompatActivity { mastodonApi = retrofit.create(MastodonApi.class); } - protected void createTuskyApi() { - Retrofit retrofit = - new Retrofit.Builder().baseUrl("https://" + getString(R.string.tusky_api_url)) - .client(OkHttpUtils.getCompatibleClient()) - .addConverterFactory(GsonConverterFactory.create()) - .build(); - - tuskyApi = retrofit.create(TuskyApi.class); - } - protected void redirectIfNotLoggedIn() { SharedPreferences preferences = getPrivatePreferences(); String domain = preferences.getString("domain", null); diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/Session.java b/app/src/main/java/com/keylesspalace/tusky/entity/Session.java deleted file mode 100644 index 8a3c5d0b..00000000 --- a/app/src/main/java/com/keylesspalace/tusky/entity/Session.java +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2017 Andrew Dawson - * - * This file is a part of Tusky. - * - * This program 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 3 of the - * License, or (at your option) any later version. - * - * Tusky 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 Tusky; if not, - * see . */ - -package com.keylesspalace.tusky.entity; - -public class Session { - public String instanceUrl; - public String accessToken; - public String deviceToken; - - public Session(String instanceUrl, String accessToken, String deviceToken) { - this.instanceUrl = instanceUrl; - this.accessToken = accessToken; - this.deviceToken = deviceToken; - } -} diff --git a/app/src/main/java/com/keylesspalace/tusky/network/TuskyApi.java b/app/src/main/java/com/keylesspalace/tusky/network/TuskyApi.java deleted file mode 100644 index 24384dcf..00000000 --- a/app/src/main/java/com/keylesspalace/tusky/network/TuskyApi.java +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2017 Andrew Dawson - * - * This file is a part of Tusky. - * - * This program 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 3 of the - * License, or (at your option) any later version. - * - * Tusky 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 Tusky; if not, - * see . */ - -package com.keylesspalace.tusky.network; - -import com.keylesspalace.tusky.entity.Session; - -import okhttp3.ResponseBody; -import retrofit2.Call; -import retrofit2.http.Body; -import retrofit2.http.POST; - -public interface TuskyApi { - @POST("/register") - Call register(@Body Session session); - @POST("/unregister") - Call unregister(@Body Session session); -}