remove Tusky API (was needed for push notifications)
This commit is contained in:
parent
2666f81b96
commit
942f26c632
3 changed files with 0 additions and 71 deletions
|
@ -37,7 +37,6 @@ import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import com.keylesspalace.tusky.json.SpannedTypeAdapter;
|
import com.keylesspalace.tusky.json.SpannedTypeAdapter;
|
||||||
import com.keylesspalace.tusky.network.MastodonApi;
|
import com.keylesspalace.tusky.network.MastodonApi;
|
||||||
import com.keylesspalace.tusky.network.TuskyApi;
|
|
||||||
import com.keylesspalace.tusky.service.PullNotificationService;
|
import com.keylesspalace.tusky.service.PullNotificationService;
|
||||||
import com.keylesspalace.tusky.util.OkHttpUtils;
|
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.
|
protected static final int SERVICE_REQUEST_CODE = 8574603; // This number is arbitrary.
|
||||||
|
|
||||||
public MastodonApi mastodonApi;
|
public MastodonApi mastodonApi;
|
||||||
public TuskyApi tuskyApi;
|
|
||||||
protected Dispatcher mastodonApiDispatcher;
|
protected Dispatcher mastodonApiDispatcher;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -65,7 +63,6 @@ public class BaseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
redirectIfNotLoggedIn();
|
redirectIfNotLoggedIn();
|
||||||
createMastodonApi();
|
createMastodonApi();
|
||||||
createTuskyApi();
|
|
||||||
|
|
||||||
/* There isn't presently a way to globally change the theme of a whole application at
|
/* 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
|
* 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);
|
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() {
|
protected void redirectIfNotLoggedIn() {
|
||||||
SharedPreferences preferences = getPrivatePreferences();
|
SharedPreferences preferences = getPrivatePreferences();
|
||||||
String domain = preferences.getString("domain", null);
|
String domain = preferences.getString("domain", 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 <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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
}
|
|
Loading…
Reference in a new issue