remove Tusky API (was needed for push notifications)

This commit is contained in:
Conny Duck 2017-10-20 09:06:50 +02:00
parent 09e2746c41
commit 170694b6ea
3 changed files with 0 additions and 71 deletions

View File

@ -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);

View File

@ -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 <http://www.gnu.org/licenses>. */
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;
}
}

View File

@ -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 <http://www.gnu.org/licenses>. */
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<ResponseBody> register(@Body Session session);
@POST("/unregister")
Call<ResponseBody> unregister(@Body Session session);
}