diff --git a/README.md b/README.md
index ea42ffc1c..157d1a88a 100644
--- a/README.md
+++ b/README.md
@@ -38,6 +38,6 @@ For reporting issues, visit [Framagit](https://framagit.org/tom79/fedilab/issues
-Lead developer: [toot.fedilab.app/@fedilab](https://toot.fedilab.app/@fedilab)
+Lead developer: [toot.fedilab.app/@apps](https://toot.fedilab.app/@apps)
diff --git a/app/build.gradle b/app/build.gradle
index c08418195..67770a5d1 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,8 +6,8 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
- versionCode 379
- versionName "2.37.0"
+ versionCode 380
+ versionName "2.37.1"
multiDexEnabled true
renderscriptTargetApi 28 as int
renderscriptSupportModeEnabled true
diff --git a/app/src/main/assets/changelogs/380.txt b/app/src/main/assets/changelogs/380.txt
new file mode 100644
index 000000000..79a8c8a35
--- /dev/null
+++ b/app/src/main/assets/changelogs/380.txt
@@ -0,0 +1,6 @@
+Added:
+- notify when a followed user posts (subscribe by clicking the bell icon on profiles).
+
+Fixed:
+- Crash when importing media due to photo editor
+- Some crashes when doing actions
\ No newline at end of file
diff --git a/app/src/main/java/app/fedilab/android/activities/ShowAccountActivity.java b/app/src/main/java/app/fedilab/android/activities/ShowAccountActivity.java
index e079def11..36e5bf39e 100644
--- a/app/src/main/java/app/fedilab/android/activities/ShowAccountActivity.java
+++ b/app/src/main/java/app/fedilab/android/activities/ShowAccountActivity.java
@@ -162,6 +162,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
private ScheduledExecutorService scheduledExecutorService;
private action doAction;
private API.StatusAction doActionAccount;
+ ImageButton account_notification;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -191,6 +192,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
account_dn = findViewById(R.id.account_dn);
account_un = findViewById(R.id.account_un);
account_bot = findViewById(R.id.account_bot);
+ account_notification = findViewById(R.id.account_notification);
addToList = null;
account_pp.setBackgroundResource(R.drawable.account_pp_border);
if (b != null) {
@@ -451,6 +453,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
}
});
mPager = findViewById(R.id.account_viewpager);
+ TabLayout.Tab tab = tabLayout.newTab();
if (!peertubeAccount) {
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.toots)));
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.following)));
@@ -740,11 +743,17 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
startActivity(intent);
}
});
+
//Follow button
String target = account.getId();
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE)
target = account.getAcct();
String finalTarget = target;
+ account_notification.setOnClickListener(v -> {
+ if (relationship != null) {
+ new PostActionAsyncTask(ShowAccountActivity.this, relationship.isNotifying() ? API.StatusAction.UNNOTIFY_FOR_ACCOUNT : API.StatusAction.NOTIFY_FOR_ACCOUNT, finalTarget, ShowAccountActivity.this);
+ }
+ });
account_follow.setOnClickListener(v -> {
if (doAction == action.NOTHING) {
Toasty.info(ShowAccountActivity.this, getString(R.string.nothing_to_do), Toast.LENGTH_LONG).show();
@@ -951,6 +960,17 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
account_follow.setVisibility(View.GONE);
doAction = action.NOTHING;
}
+ if (!relationship.isFollowing()) {
+ account_notification.setVisibility(View.GONE);
+ } else {
+ account_notification.setVisibility(View.VISIBLE);
+ }
+ if (relationship.isNotifying()) {
+ account_notification.setImageResource(R.drawable.ic_baseline_notifications_account_yes);
+ } else {
+ account_notification.setImageResource(R.drawable.ic_baseline_notifications_account_none);
+ }
+
}
@Override
@@ -1520,24 +1540,21 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
return displayStatusFragment;
}
case 1:
+ DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
if (peertubeAccount) {
- DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
bundle.putSerializable("type", RetrieveAccountsAsyncTask.Type.CHANNELS);
bundle.putString("targetedid", account.getId());
bundle.putString("instance", Helper.getLiveInstance(ShowAccountActivity.this));
bundle.putString("name", account.getAcct());
- displayAccountsFragment.setArguments(bundle);
- return displayAccountsFragment;
} else {
- DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
bundle.putSerializable("type", RetrieveAccountsAsyncTask.Type.FOLLOWING);
bundle.putString("targetedid", account.getId());
- displayAccountsFragment.setArguments(bundle);
- return displayAccountsFragment;
}
+ displayAccountsFragment.setArguments(bundle);
+ return displayAccountsFragment;
default:
- DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
+ displayAccountsFragment = new DisplayAccountsFragment();
bundle.putSerializable("type", RetrieveAccountsAsyncTask.Type.FOLLOWERS);
bundle.putString("targetedid", account.getId());
displayAccountsFragment.setArguments(bundle);
diff --git a/app/src/main/java/app/fedilab/android/asynctasks/PostActionAsyncTask.java b/app/src/main/java/app/fedilab/android/asynctasks/PostActionAsyncTask.java
index 1b4765332..8a068f110 100644
--- a/app/src/main/java/app/fedilab/android/asynctasks/PostActionAsyncTask.java
+++ b/app/src/main/java/app/fedilab/android/asynctasks/PostActionAsyncTask.java
@@ -264,9 +264,11 @@ public class PostActionAsyncTask {
statusCode = gnuapi.postAction(apiAction, targetedId);
error = gnuapi.getError();
}
- Handler mainHandler = new Handler(Looper.getMainLooper());
- Runnable myRunnable = () -> listener.onPostAction(statusCode, apiAction, targetedId, error);
- mainHandler.post(myRunnable);
+ if (listener != null) {
+ Handler mainHandler = new Handler(Looper.getMainLooper());
+ Runnable myRunnable = () -> listener.onPostAction(statusCode, apiAction, targetedId, error);
+ mainHandler.post(myRunnable);
+ }
}).start();
}
diff --git a/app/src/main/java/app/fedilab/android/client/API.java b/app/src/main/java/app/fedilab/android/client/API.java
index 005825669..ae1cbe9c5 100644
--- a/app/src/main/java/app/fedilab/android/client/API.java
+++ b/app/src/main/java/app/fedilab/android/client/API.java
@@ -3642,7 +3642,7 @@ public class API {
List tmp_status = parseStatuses(context, new JSONArray(response));
if (tmp_status.size() > 0) {
for (Status status : tmp_status) {
- if (status.getAccount().getAcct().equals("fedilab")) {
+ if (status.getAccount().getAcct().equals("apps")) {
statuses.add(status);
}
}
@@ -4274,6 +4274,16 @@ public class API {
case FOLLOW:
action = String.format("/accounts/%s/follow", targetedId);
break;
+ case NOTIFY_FOR_ACCOUNT:
+ params = new HashMap<>();
+ params.put("notify", "true");
+ action = String.format("/accounts/%s/follow", targetedId);
+ break;
+ case UNNOTIFY_FOR_ACCOUNT:
+ params = new HashMap<>();
+ params.put("notify", "false");
+ action = String.format("/accounts/%s/follow", targetedId);
+ break;
case REMOTE_FOLLOW:
action = "/follows";
params = new HashMap<>();
@@ -4801,7 +4811,7 @@ public class API {
return apiResponse;
}
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
- boolean notif_follow, notif_add, notif_mention, notif_share, notif_poll;
+ boolean notif_follow, notif_add, notif_mention, notif_share, notif_poll, notif_status;
StringBuilder parameters = new StringBuilder();
//TODO: If pixelfed supports exclude_types this condition needs to be changed
if (type == DisplayNotificationsFragment.Type.ALL && MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED) {
@@ -4811,12 +4821,14 @@ public class API {
notif_mention = sharedpreferences.getBoolean(Helper.SET_NOTIF_MENTION_FILTER, true);
notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE_FILTER, true);
notif_poll = sharedpreferences.getBoolean(Helper.SET_NOTIF_POLL_FILTER, true);
+ notif_status = sharedpreferences.getBoolean(Helper.SET_NOTIF_STATUS_FILTER, true);
} else {
notif_follow = sharedpreferences.getBoolean(Helper.SET_NOTIF_FOLLOW, true);
notif_add = sharedpreferences.getBoolean(Helper.SET_NOTIF_ADD, true);
notif_mention = sharedpreferences.getBoolean(Helper.SET_NOTIF_MENTION, true);
notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE, true);
notif_poll = sharedpreferences.getBoolean(Helper.SET_NOTIF_POLL, true);
+ notif_status = sharedpreferences.getBoolean(Helper.SET_NOTIF_STATUS, true);
}
@@ -4828,6 +4840,8 @@ public class API {
parameters.append("exclude_types[]=").append("favourite").append("&");
if (!notif_share)
parameters.append("exclude_types[]=").append("reblog").append("&");
+ if (!notif_status)
+ parameters.append("exclude_types[]=").append("status").append("&");
if (!notif_mention)
parameters.append("exclude_types[]=").append("mention").append("&");
if (!notif_poll)
@@ -4841,6 +4855,7 @@ public class API {
parameters.append("exclude_types[]=").append("follow_request").append("&");
parameters.append("exclude_types[]=").append("favourite").append("&");
parameters.append("exclude_types[]=").append("reblog").append("&");
+ parameters.append("exclude_types[]=").append("status").append("&");
parameters.append("exclude_types[]=").append("poll").append("&");
parameters = new StringBuilder(parameters.substring(0, parameters.length() - 1).substring(16));
params.put("exclude_types[]", parameters.toString());
@@ -4848,6 +4863,7 @@ public class API {
parameters.append("exclude_types[]=").append("follow").append("&");
parameters.append("exclude_types[]=").append("follow_request").append("&");
parameters.append("exclude_types[]=").append("mention").append("&");
+ parameters.append("exclude_types[]=").append("status").append("&");
parameters.append("exclude_types[]=").append("reblog").append("&");
parameters.append("exclude_types[]=").append("poll").append("&");
parameters = new StringBuilder(parameters.substring(0, parameters.length() - 1).substring(16));
@@ -4855,6 +4871,7 @@ public class API {
} else if (type == DisplayNotificationsFragment.Type.BOOST) {
parameters.append("exclude_types[]=").append("follow").append("&");
parameters.append("exclude_types[]=").append("follow_request").append("&");
+ parameters.append("exclude_types[]=").append("status").append("&");
parameters.append("exclude_types[]=").append("mention").append("&");
parameters.append("exclude_types[]=").append("favourite").append("&");
parameters.append("exclude_types[]=").append("poll").append("&");
@@ -4863,12 +4880,22 @@ public class API {
} else if (type == DisplayNotificationsFragment.Type.POLL) {
parameters.append("exclude_types[]=").append("reblog").append("&");
parameters.append("exclude_types[]=").append("follow").append("&");
+ parameters.append("exclude_types[]=").append("status").append("&");
parameters.append("exclude_types[]=").append("follow_request").append("&");
parameters.append("exclude_types[]=").append("mention").append("&");
parameters.append("exclude_types[]=").append("favourite").append("&");
parameters = new StringBuilder(parameters.substring(0, parameters.length() - 1).substring(16));
params.put("exclude_types[]", parameters.toString());
} else if (type == DisplayNotificationsFragment.Type.FOLLOW) {
+ parameters.append("exclude_types[]=").append("status").append("&");
+ parameters.append("exclude_types[]=").append("reblog").append("&");
+ parameters.append("exclude_types[]=").append("mention").append("&");
+ parameters.append("exclude_types[]=").append("favourite").append("&");
+ parameters.append("exclude_types[]=").append("poll").append("&");
+ parameters = new StringBuilder(parameters.substring(0, parameters.length() - 1).substring(16));
+ params.put("exclude_types[]", parameters.toString());
+ } else if (type == DisplayNotificationsFragment.Type.STATUS) {
+ parameters.append("exclude_types[]=").append("follow").append("&");
parameters.append("exclude_types[]=").append("reblog").append("&");
parameters.append("exclude_types[]=").append("mention").append("&");
parameters.append("exclude_types[]=").append("favourite").append("&");
@@ -4886,6 +4913,7 @@ public class API {
apiResponse.setMax_id(httpsConnection.getMax_id());
notifications = parseNotificationResponse(new JSONArray(response));
} catch (HttpsConnection.HttpsConnectionException e) {
+ e.printStackTrace();
setError(e.getStatusCode(), e);
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException e) {
e.printStackTrace();
@@ -6081,6 +6109,17 @@ public class API {
} catch (Exception ignored) {
relationship.setBlocked_by(false);
}
+ try {
+ relationship.setDomain_blocking(resobj.getBoolean("domain_blocking"));
+ } catch (Exception ignored) {
+ relationship.setDomain_blocking(false);
+ }
+ relationship.setNote(resobj.getString("note"));
+ try {
+ relationship.setNotifying(resobj.getBoolean("notifying"));
+ } catch (Exception ignored) {
+ relationship.setNotifying(false);
+ }
relationship.setRequested(resobj.getBoolean("requested"));
} catch (JSONException e) {
setDefaultError(e);
@@ -6257,6 +6296,8 @@ public class API {
UNBLOCK,
FOLLOW,
UNFOLLOW,
+ NOTIFY_FOR_ACCOUNT,
+ UNNOTIFY_FOR_ACCOUNT,
CREATESTATUS,
UNSTATUS,
AUTHORIZE,
diff --git a/app/src/main/java/app/fedilab/android/client/Entities/ManageTimelines.java b/app/src/main/java/app/fedilab/android/client/Entities/ManageTimelines.java
index a59f94d7d..0487e5f3d 100644
--- a/app/src/main/java/app/fedilab/android/client/Entities/ManageTimelines.java
+++ b/app/src/main/java/app/fedilab/android/client/Entities/ManageTimelines.java
@@ -76,7 +76,7 @@ public class ManageTimelines {
private String currentFilter;
- private boolean notif_follow, notif_add, notif_mention, notif_share, notif_poll;
+ private boolean notif_follow, notif_add, notif_mention, notif_share, notif_poll, notif_status;
public static Type typeFromDb(String value) {
switch (value) {
@@ -387,18 +387,21 @@ public class ManageTimelines {
final MenuItem itemMention = menu.findItem(R.id.action_mention);
final MenuItem itemBoost = menu.findItem(R.id.action_boost);
final MenuItem itemPoll = menu.findItem(R.id.action_poll);
+ final MenuItem itemStatus = menu.findItem(R.id.action_status);
notif_follow = sharedpreferences.getBoolean(Helper.SET_NOTIF_FOLLOW_FILTER, true);
notif_add = sharedpreferences.getBoolean(Helper.SET_NOTIF_ADD_FILTER, true);
notif_mention = sharedpreferences.getBoolean(Helper.SET_NOTIF_MENTION_FILTER, true);
notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE_FILTER, true);
notif_poll = sharedpreferences.getBoolean(Helper.SET_NOTIF_POLL_FILTER, true);
+ notif_status = sharedpreferences.getBoolean(Helper.SET_NOTIF_STATUS_FILTER, true);
itemFavourite.setChecked(notif_add);
itemFollow.setChecked(notif_follow);
itemMention.setChecked(notif_mention);
itemBoost.setChecked(notif_share);
- if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON)
+ if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
itemPoll.setChecked(notif_poll);
- else
+ itemStatus.setChecked(notif_status);
+ } else
itemPoll.setVisible(false);
popup.setOnDismissListener(menu1 -> {
@@ -423,42 +426,48 @@ public class ManageTimelines {
return false;
}
});
- switch (item.getItemId()) {
- case R.id.action_favorite:
- SharedPreferences.Editor editor = sharedpreferences.edit();
- notif_add = !notif_add;
- editor.putBoolean(Helper.SET_NOTIF_ADD_FILTER, notif_add);
- itemFavourite.setChecked(notif_add);
- editor.apply();
- break;
- case R.id.action_follow:
- editor = sharedpreferences.edit();
- notif_follow = !notif_follow;
- editor.putBoolean(Helper.SET_NOTIF_FOLLOW_FILTER, notif_follow);
- itemFollow.setChecked(notif_follow);
- editor.apply();
- break;
- case R.id.action_mention:
- editor = sharedpreferences.edit();
- notif_mention = !notif_mention;
- editor.putBoolean(Helper.SET_NOTIF_MENTION_FILTER, notif_mention);
- itemMention.setChecked(notif_mention);
- editor.apply();
- break;
- case R.id.action_boost:
- editor = sharedpreferences.edit();
- notif_share = !notif_share;
- editor.putBoolean(Helper.SET_NOTIF_SHARE_FILTER, notif_share);
- itemBoost.setChecked(notif_share);
- editor.apply();
- break;
- case R.id.action_poll:
- editor = sharedpreferences.edit();
- notif_poll = !notif_poll;
- editor.putBoolean(Helper.SET_NOTIF_POLL_FILTER, notif_poll);
- itemPoll.setChecked(notif_poll);
- editor.apply();
- break;
+ int itemId = item.getItemId();
+ if (itemId == R.id.action_favorite) {
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ notif_add = !notif_add;
+ editor.putBoolean(Helper.SET_NOTIF_ADD_FILTER, notif_add);
+ itemFavourite.setChecked(notif_add);
+ editor.apply();
+ } else if (itemId == R.id.action_follow) {
+ SharedPreferences.Editor editor;
+ editor = sharedpreferences.edit();
+ notif_follow = !notif_follow;
+ editor.putBoolean(Helper.SET_NOTIF_FOLLOW_FILTER, notif_follow);
+ itemFollow.setChecked(notif_follow);
+ editor.apply();
+ } else if (itemId == R.id.action_mention) {
+ SharedPreferences.Editor editor;
+ editor = sharedpreferences.edit();
+ notif_mention = !notif_mention;
+ editor.putBoolean(Helper.SET_NOTIF_MENTION_FILTER, notif_mention);
+ itemMention.setChecked(notif_mention);
+ editor.apply();
+ } else if (itemId == R.id.action_boost) {
+ SharedPreferences.Editor editor;
+ editor = sharedpreferences.edit();
+ notif_share = !notif_share;
+ editor.putBoolean(Helper.SET_NOTIF_SHARE_FILTER, notif_share);
+ itemBoost.setChecked(notif_share);
+ editor.apply();
+ } else if (itemId == R.id.action_poll) {
+ SharedPreferences.Editor editor;
+ editor = sharedpreferences.edit();
+ notif_poll = !notif_poll;
+ editor.putBoolean(Helper.SET_NOTIF_POLL_FILTER, notif_poll);
+ itemPoll.setChecked(notif_poll);
+ editor.apply();
+ } else if (itemId == R.id.action_status) {
+ SharedPreferences.Editor editor;
+ editor = sharedpreferences.edit();
+ notif_status = !notif_status;
+ editor.putBoolean(Helper.SET_NOTIF_STATUS_FILTER, notif_status);
+ itemStatus.setChecked(notif_status);
+ editor.apply();
}
return false;
});
diff --git a/app/src/main/java/app/fedilab/android/client/Entities/Relationship.java b/app/src/main/java/app/fedilab/android/client/Entities/Relationship.java
index b57b7e472..14eae977e 100644
--- a/app/src/main/java/app/fedilab/android/client/Entities/Relationship.java
+++ b/app/src/main/java/app/fedilab/android/client/Entities/Relationship.java
@@ -25,12 +25,15 @@ public class Relationship {
private boolean following;
private boolean followed_by;
private boolean blocking;
+ private boolean domain_blocking;
private boolean muting;
private boolean requested;
private boolean muting_notifications;
private boolean endorsed;
private boolean showing_reblogs;
private boolean blocked_by;
+ private String note;
+ private boolean notifying;
public String getId() {
@@ -112,4 +115,28 @@ public class Relationship {
public void setBlocked_by(boolean blocked_by) {
this.blocked_by = blocked_by;
}
+
+ public boolean isDomain_blocking() {
+ return domain_blocking;
+ }
+
+ public void setDomain_blocking(boolean domain_blocking) {
+ this.domain_blocking = domain_blocking;
+ }
+
+ public String getNote() {
+ return note;
+ }
+
+ public void setNote(String note) {
+ this.note = note;
+ }
+
+ public boolean isNotifying() {
+ return notifying;
+ }
+
+ public void setNotifying(boolean notifying) {
+ this.notifying = notifying;
+ }
}
diff --git a/app/src/main/java/app/fedilab/android/client/HttpsConnection.java b/app/src/main/java/app/fedilab/android/client/HttpsConnection.java
index 6e84331c3..4f5f60991 100644
--- a/app/src/main/java/app/fedilab/android/client/HttpsConnection.java
+++ b/app/src/main/java/app/fedilab/android/client/HttpsConnection.java
@@ -77,7 +77,6 @@ import static app.fedilab.android.helper.Helper.urlPattern;
public class HttpsConnection {
- private HttpsURLConnection httpsURLConnection;
private HttpURLConnection httpURLConnection;
private String since_id, max_id;
private final Context context;
@@ -168,31 +167,33 @@ public class HttpsConnection {
}
if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
+ httpURLConnection = (HttpsURLConnection) url.openConnection(proxy);
else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setConnectTimeout(timeout * 1000);
- httpsURLConnection.setRequestProperty("http.keepAlive", "false");
- httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpsURLConnection.setRequestProperty("Content-Type", "application/json");
- httpsURLConnection.setRequestProperty("Accept", "application/json");
- httpsURLConnection.setUseCaches(true);
- httpsURLConnection.setDefaultUseCaches(true);
- httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory(this.instance));
+ httpURLConnection = (HttpsURLConnection) url.openConnection();
+ httpURLConnection.setConnectTimeout(timeout * 1000);
+ httpURLConnection.setRequestProperty("http.keepAlive", "false");
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ httpURLConnection.setRequestProperty("Content-Type", "application/json");
+ httpURLConnection.setRequestProperty("Accept", "application/json");
+ httpURLConnection.setUseCaches(true);
+ httpURLConnection.setDefaultUseCaches(true);
+ if (httpURLConnection instanceof HttpsURLConnection) {
+ ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new TLSSocketFactory(this.instance));
+ }
if (token != null && !token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", "Bearer " + token);
+ httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
else if (token != null && token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", token);
- httpsURLConnection.setRequestMethod("GET");
+ httpURLConnection.setRequestProperty("Authorization", token);
+ httpURLConnection.setRequestMethod("GET");
String response;
- if (httpsURLConnection.getResponseCode() >= 200 && httpsURLConnection.getResponseCode() < 400) {
- response = converToString(httpsURLConnection.getInputStream());
+ if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
+ response = converToString(httpURLConnection.getInputStream());
} else {
String error = null;
- if (httpsURLConnection.getErrorStream() != null) {
- InputStream stream = httpsURLConnection.getErrorStream();
+ if (httpURLConnection.getErrorStream() != null) {
+ InputStream stream = httpURLConnection.getErrorStream();
if (stream == null) {
- stream = httpsURLConnection.getInputStream();
+ stream = httpURLConnection.getInputStream();
}
try (Scanner scanner = new Scanner(stream)) {
scanner.useDelimiter("\\Z");
@@ -203,15 +204,15 @@ public class HttpsConnection {
e.printStackTrace();
}
}
- int responseCode = httpsURLConnection.getResponseCode();
+ int responseCode = httpURLConnection.getResponseCode();
try {
- httpsURLConnection.getInputStream().close();
+ httpURLConnection.getInputStream().close();
} catch (Exception ignored) {
}
throw new HttpsConnectionException(responseCode, error);
}
getSinceMaxId();
- httpsURLConnection.getInputStream().close();
+ httpURLConnection.getInputStream().close();
return response;
}
@@ -228,15 +229,17 @@ public class HttpsConnection {
try {
url = new URL(urlConnection);
if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
+ httpURLConnection = (HttpsURLConnection) url.openConnection(proxy);
else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setRequestProperty("http.keepAlive", "false");
- httpsURLConnection.setInstanceFollowRedirects(false);
- httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory(this.instance));
- httpsURLConnection.setRequestMethod("HEAD");
- if (httpsURLConnection.getResponseCode() == 301 || httpsURLConnection.getResponseCode() == 302) {
- Map> map = httpsURLConnection.getHeaderFields();
+ httpURLConnection = (HttpsURLConnection) url.openConnection();
+ httpURLConnection.setRequestProperty("http.keepAlive", "false");
+ httpURLConnection.setInstanceFollowRedirects(false);
+ if (httpURLConnection instanceof HttpsURLConnection) {
+ ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new TLSSocketFactory(this.instance));
+ }
+ httpURLConnection.setRequestMethod("HEAD");
+ if (httpURLConnection.getResponseCode() == 301 || httpURLConnection.getResponseCode() == 302) {
+ Map> map = httpURLConnection.getHeaderFields();
for (Map.Entry> entry : map.entrySet()) {
if (entry.toString().toLowerCase().startsWith("location")) {
Matcher matcher = urlPattern.matcher(entry.toString());
@@ -246,7 +249,7 @@ public class HttpsConnection {
}
}
}
- httpsURLConnection.getInputStream().close();
+ httpURLConnection.getInputStream().close();
if (redirect != null && redirect.compareTo(urlConnection) != 0) {
URL redirectURL = new URL(redirect);
String host = redirectURL.getHost();
@@ -266,96 +269,51 @@ public class HttpsConnection {
public String get(String urlConnection) throws IOException, NoSuchAlgorithmException, KeyManagementException, HttpsConnectionException {
URL url = new URL(urlConnection);
- if (urlConnection.startsWith("https://")) {
- if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
- else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setConnectTimeout(30 * 1000);
- httpsURLConnection.setRequestProperty("http.keepAlive", "false");
- httpsURLConnection.setRequestProperty("Content-Type", "application/json");
- httpsURLConnection.setRequestProperty("Accept", "application/json");
- httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory(this.instance));
- httpsURLConnection.setRequestMethod("GET");
- httpsURLConnection.setDefaultUseCaches(true);
- httpsURLConnection.setUseCaches(true);
- String response;
- if (httpsURLConnection.getResponseCode() >= 200 && httpsURLConnection.getResponseCode() < 400) {
- getSinceMaxId();
- response = converToString(httpsURLConnection.getInputStream());
- } else {
- String error = null;
- if (httpsURLConnection.getErrorStream() != null) {
- InputStream stream = httpsURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpsURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpsURLConnection.getResponseCode();
- try {
- httpsURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- throw new HttpsConnectionException(responseCode, error);
- }
- getSinceMaxId();
- httpsURLConnection.getInputStream().close();
- return response;
- } else {
- if (proxy != null)
- httpURLConnection = (HttpURLConnection) url.openConnection(proxy);
- else
- httpURLConnection = (HttpURLConnection) url.openConnection();
- httpURLConnection.setConnectTimeout(30 * 1000);
- httpURLConnection.setRequestProperty("http.keepAlive", "false");
- httpURLConnection.setRequestProperty("Content-Type", "application/json");
- httpURLConnection.setRequestProperty("Accept", "application/json");
- httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpURLConnection.setRequestMethod("GET");
- httpURLConnection.setDefaultUseCaches(true);
- httpURLConnection.setUseCaches(true);
- String response;
- if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
- getSinceMaxId();
- response = converToString(httpURLConnection.getInputStream());
- } else {
- String error = null;
- if (httpURLConnection.getErrorStream() != null) {
- InputStream stream = httpURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpURLConnection.getResponseCode();
- try {
- httpURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- throw new HttpsConnectionException(responseCode, error);
- }
- getSinceMaxId();
- httpURLConnection.getInputStream().close();
- return response;
+ if (proxy != null)
+ httpURLConnection = (HttpsURLConnection) url.openConnection(proxy);
+ else
+ httpURLConnection = (HttpsURLConnection) url.openConnection();
+ httpURLConnection.setConnectTimeout(30 * 1000);
+ httpURLConnection.setRequestProperty("http.keepAlive", "false");
+ httpURLConnection.setRequestProperty("Content-Type", "application/json");
+ httpURLConnection.setRequestProperty("Accept", "application/json");
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ if (httpURLConnection instanceof HttpsURLConnection) {
+ ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new TLSSocketFactory(this.instance));
}
-
-
+ httpURLConnection.setRequestMethod("GET");
+ httpURLConnection.setDefaultUseCaches(true);
+ httpURLConnection.setUseCaches(true);
+ String response;
+ if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
+ getSinceMaxId();
+ response = converToString(httpURLConnection.getInputStream());
+ } else {
+ String error = null;
+ if (httpURLConnection.getErrorStream() != null) {
+ InputStream stream = httpURLConnection.getErrorStream();
+ if (stream == null) {
+ stream = httpURLConnection.getInputStream();
+ }
+ try (Scanner scanner = new Scanner(stream)) {
+ scanner.useDelimiter("\\Z");
+ if (scanner.hasNext()) {
+ error = scanner.next();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ int responseCode = httpURLConnection.getResponseCode();
+ try {
+ httpURLConnection.getInputStream().close();
+ } catch (Exception ignored) {
+ }
+ throw new HttpsConnectionException(responseCode, error);
+ }
+ getSinceMaxId();
+ httpURLConnection.getInputStream().close();
+ return response;
}
@@ -378,243 +336,35 @@ public class HttpsConnection {
postData.append(param.getValue());
}
byte[] postDataBytes = postData.toString().getBytes(StandardCharsets.UTF_8);
- if (urlConnection.startsWith("https://")) {
- if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
- else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpsURLConnection.setConnectTimeout(timeout * 1000);
- httpsURLConnection.setDoOutput(true);
- httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory(this.instance));
- httpsURLConnection.setRequestMethod("POST");
- if (token != null && !token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", "Bearer " + token);
- else if (token != null && token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", token);
- httpsURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
-
-
- httpsURLConnection.getOutputStream().write(postDataBytes);
- String response;
- if (httpsURLConnection.getResponseCode() >= 200 && httpsURLConnection.getResponseCode() < 400) {
- getSinceMaxId();
- response = converToString(httpsURLConnection.getInputStream());
- } else {
- String error = null;
- if (httpsURLConnection.getErrorStream() != null) {
- InputStream stream = httpsURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpsURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpsURLConnection.getResponseCode();
- try {
- httpsURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- throw new HttpsConnectionException(responseCode, error);
- }
- getSinceMaxId();
- httpsURLConnection.getInputStream().close();
- return response;
- } else {
- if (proxy != null)
- httpURLConnection = (HttpURLConnection) url.openConnection(proxy);
- else
- httpURLConnection = (HttpURLConnection) url.openConnection();
- httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpURLConnection.setConnectTimeout(timeout * 1000);
- httpURLConnection.setDoOutput(true);
- httpURLConnection.setRequestMethod("POST");
- if (token != null && !token.startsWith("Basic "))
- httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
- else if (token != null && token.startsWith("Basic "))
- httpURLConnection.setRequestProperty("Authorization", token);
- httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
-
- httpURLConnection.getOutputStream().write(postDataBytes);
- String response;
- if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
- getSinceMaxId();
- response = converToString(httpURLConnection.getInputStream());
- } else {
- String error = null;
- if (httpURLConnection.getErrorStream() != null) {
- InputStream stream = httpURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpURLConnection.getResponseCode();
- try {
- httpURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- throw new HttpsConnectionException(responseCode, error);
- }
- getSinceMaxId();
- httpURLConnection.getInputStream().close();
- return response;
- }
-
- }
-
-
- String postJson(String urlConnection, int timeout, JsonObject jsonObject, String token) throws IOException, NoSuchAlgorithmException, KeyManagementException, HttpsConnectionException {
-
- URL url = new URL(urlConnection);
- byte[] postDataBytes;
- postDataBytes = jsonObject.toString().getBytes(StandardCharsets.UTF_8);
- if (urlConnection.startsWith("https://")) {
-
- if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
- else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpsURLConnection.setConnectTimeout(timeout * 1000);
- httpsURLConnection.setDoOutput(true);
- httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory(this.instance));
- httpsURLConnection.setRequestProperty("Content-Type", "application/json");
- httpsURLConnection.setRequestProperty("Accept", "application/json");
- httpsURLConnection.setRequestMethod("POST");
- if (token != null && !token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", "Bearer " + token);
- else if (token != null && token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", token);
- httpsURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
-
-
- httpsURLConnection.getOutputStream().write(postDataBytes);
- String response;
- if (httpsURLConnection.getResponseCode() >= 200 && httpsURLConnection.getResponseCode() < 400) {
- getSinceMaxId();
- response = converToString(httpsURLConnection.getInputStream());
- } else {
- String error = null;
- if (httpsURLConnection.getErrorStream() != null) {
- InputStream stream = httpsURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpsURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpsURLConnection.getResponseCode();
- try {
- httpsURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- throw new HttpsConnectionException(responseCode, error);
- }
- getSinceMaxId();
- httpsURLConnection.getInputStream().close();
- return response;
- } else {
- if (proxy != null)
- httpURLConnection = (HttpURLConnection) url.openConnection(proxy);
- else
- httpURLConnection = (HttpURLConnection) url.openConnection();
- httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpURLConnection.setConnectTimeout(timeout * 1000);
- httpURLConnection.setDoOutput(true);
- httpURLConnection.setRequestMethod("POST");
- if (token != null && !token.startsWith("Basic "))
- httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
- else if (token != null && token.startsWith("Basic "))
- httpURLConnection.setRequestProperty("Authorization", token);
- httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
-
- httpURLConnection.getOutputStream().write(postDataBytes);
- String response;
- if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
- getSinceMaxId();
- response = converToString(httpURLConnection.getInputStream());
- } else {
- String error = null;
- if (httpURLConnection.getErrorStream() != null) {
- InputStream stream = httpURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpURLConnection.getResponseCode();
- try {
- httpURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- throw new HttpsConnectionException(responseCode, error);
- }
- getSinceMaxId();
- httpURLConnection.getInputStream().close();
- return response;
- }
-
- }
-
- @SuppressWarnings("SameParameterValue")
- String postMisskey(String urlConnection, int timeout, JSONObject paramaters, String token) throws IOException, NoSuchAlgorithmException, KeyManagementException, HttpsConnectionException {
- URL url = new URL(urlConnection);
- byte[] postDataBytes = paramaters.toString().getBytes(StandardCharsets.UTF_8);
-
if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
+ httpURLConnection = (HttpsURLConnection) url.openConnection(proxy);
else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpsURLConnection.setConnectTimeout(timeout * 1000);
- httpsURLConnection.setDoOutput(true);
- httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory(this.instance));
- httpsURLConnection.setRequestMethod("POST");
+ httpURLConnection = (HttpsURLConnection) url.openConnection();
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ httpURLConnection.setConnectTimeout(timeout * 1000);
+ httpURLConnection.setDoOutput(true);
+ if (httpURLConnection instanceof HttpsURLConnection) {
+ ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new TLSSocketFactory(this.instance));
+ }
+ httpURLConnection.setRequestMethod("POST");
if (token != null && !token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", "Bearer " + token);
+ httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
else if (token != null && token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", token);
- httpsURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
+ httpURLConnection.setRequestProperty("Authorization", token);
+ httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
- httpsURLConnection.getOutputStream().write(postDataBytes);
+ httpURLConnection.getOutputStream().write(postDataBytes);
String response;
- if (httpsURLConnection.getResponseCode() >= 200 && httpsURLConnection.getResponseCode() < 400) {
+ if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
getSinceMaxId();
- response = converToString(httpsURLConnection.getInputStream());
+ response = converToString(httpURLConnection.getInputStream());
} else {
String error = null;
- if (httpsURLConnection.getErrorStream() != null) {
- InputStream stream = httpsURLConnection.getErrorStream();
+ if (httpURLConnection.getErrorStream() != null) {
+ InputStream stream = httpURLConnection.getErrorStream();
if (stream == null) {
- stream = httpsURLConnection.getInputStream();
+ stream = httpURLConnection.getInputStream();
}
try (Scanner scanner = new Scanner(stream)) {
scanner.useDelimiter("\\Z");
@@ -625,15 +375,131 @@ public class HttpsConnection {
e.printStackTrace();
}
}
- int responseCode = httpsURLConnection.getResponseCode();
+ int responseCode = httpURLConnection.getResponseCode();
try {
- httpsURLConnection.getInputStream().close();
+ httpURLConnection.getInputStream().close();
} catch (Exception ignored) {
}
throw new HttpsConnectionException(responseCode, error);
}
getSinceMaxId();
- httpsURLConnection.getInputStream().close();
+ httpURLConnection.getInputStream().close();
+ return response;
+ }
+
+
+ String postJson(String urlConnection, int timeout, JsonObject jsonObject, String token) throws IOException, NoSuchAlgorithmException, KeyManagementException, HttpsConnectionException {
+
+ URL url = new URL(urlConnection);
+ byte[] postDataBytes;
+ postDataBytes = jsonObject.toString().getBytes(StandardCharsets.UTF_8);
+ if (proxy != null)
+ httpURLConnection = (HttpURLConnection) url.openConnection(proxy);
+ else
+ httpURLConnection = (HttpURLConnection) url.openConnection();
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ httpURLConnection.setConnectTimeout(timeout * 1000);
+ httpURLConnection.setDoOutput(true);
+ if (httpURLConnection instanceof HttpsURLConnection) {
+ ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new TLSSocketFactory(this.instance));
+ }
+ httpURLConnection.setRequestProperty("Content-Type", "application/json");
+ httpURLConnection.setRequestProperty("Accept", "application/json");
+ httpURLConnection.setRequestMethod("POST");
+ if (token != null && !token.startsWith("Basic "))
+ httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
+ else if (token != null && token.startsWith("Basic "))
+ httpURLConnection.setRequestProperty("Authorization", token);
+ httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
+
+
+ httpURLConnection.getOutputStream().write(postDataBytes);
+ String response;
+ if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
+ getSinceMaxId();
+ response = converToString(httpURLConnection.getInputStream());
+ } else {
+ String error = null;
+ if (httpURLConnection.getErrorStream() != null) {
+ InputStream stream = httpURLConnection.getErrorStream();
+ if (stream == null) {
+ stream = httpURLConnection.getInputStream();
+ }
+ try (Scanner scanner = new Scanner(stream)) {
+ scanner.useDelimiter("\\Z");
+ if (scanner.hasNext()) {
+ error = scanner.next();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ int responseCode = httpURLConnection.getResponseCode();
+ try {
+ httpURLConnection.getInputStream().close();
+ } catch (Exception ignored) {
+ }
+ throw new HttpsConnectionException(responseCode, error);
+ }
+ getSinceMaxId();
+ httpURLConnection.getInputStream().close();
+ return response;
+
+ }
+
+ @SuppressWarnings("SameParameterValue")
+ String postMisskey(String urlConnection, int timeout, JSONObject paramaters, String token) throws IOException, NoSuchAlgorithmException, KeyManagementException, HttpsConnectionException {
+ URL url = new URL(urlConnection);
+ byte[] postDataBytes = paramaters.toString().getBytes(StandardCharsets.UTF_8);
+
+ if (proxy != null)
+ httpURLConnection = (HttpsURLConnection) url.openConnection(proxy);
+ else
+ httpURLConnection = (HttpsURLConnection) url.openConnection();
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ httpURLConnection.setConnectTimeout(timeout * 1000);
+ httpURLConnection.setDoOutput(true);
+ if (httpURLConnection instanceof HttpsURLConnection) {
+ ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new TLSSocketFactory(this.instance));
+ }
+ httpURLConnection.setRequestMethod("POST");
+ if (token != null && !token.startsWith("Basic "))
+ httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
+ else if (token != null && token.startsWith("Basic "))
+ httpURLConnection.setRequestProperty("Authorization", token);
+ httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
+
+
+ httpURLConnection.getOutputStream().write(postDataBytes);
+ String response;
+ if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
+ getSinceMaxId();
+ response = converToString(httpURLConnection.getInputStream());
+ } else {
+ String error = null;
+ if (httpURLConnection.getErrorStream() != null) {
+ InputStream stream = httpURLConnection.getErrorStream();
+ if (stream == null) {
+ stream = httpURLConnection.getInputStream();
+ }
+ try (Scanner scanner = new Scanner(stream)) {
+ scanner.useDelimiter("\\Z");
+ if (scanner.hasNext()) {
+ error = scanner.next();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ int responseCode = httpURLConnection.getResponseCode();
+ try {
+ httpURLConnection.getInputStream().close();
+ } catch (Exception ignored) {
+ }
+ throw new HttpsConnectionException(responseCode, error);
+ }
+ getSinceMaxId();
+ httpURLConnection.getInputStream().close();
return response;
}
@@ -646,145 +512,73 @@ public class HttpsConnection {
public void download(final String downloadUrl, final OnDownloadInterface listener) {
new Thread(() -> {
URL url;
- HttpsURLConnection httpsURLConnection;
- HttpURLConnection httpURLConnection;
- if (downloadUrl.startsWith("https://")) {
- try {
- url = new URL(downloadUrl);
- if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
- else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- int responseCode = httpsURLConnection.getResponseCode();
+ try {
+ url = new URL(downloadUrl);
+ if (proxy != null)
+ httpURLConnection = (HttpURLConnection) url.openConnection(proxy);
+ else
+ httpURLConnection = (HttpURLConnection) url.openConnection();
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ int responseCode = httpURLConnection.getResponseCode();
- // always check HTTP response code first
- if (responseCode == HttpURLConnection.HTTP_OK) {
- String fileName = "";
- String disposition = httpsURLConnection.getHeaderField("Content-Disposition");
+ // always check HTTP response code first
+ if (responseCode == HttpURLConnection.HTTP_OK) {
+ String fileName = "";
+ String disposition = httpURLConnection.getHeaderField("Content-Disposition");
- if (disposition != null) {
- // extracts file name from header field
- int index = disposition.indexOf("filename=");
- if (index > 0) {
- fileName = disposition.substring(index + 10,
- disposition.length() - 1);
- }
- } else {
- // extracts file name from URL
- fileName = downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1
- );
+ if (disposition != null) {
+ // extracts file name from header field
+ int index = disposition.indexOf("filename=");
+ if (index > 0) {
+ fileName = disposition.substring(index + 10,
+ disposition.length() - 1);
}
- fileName = FileNameCleaner.cleanFileName(fileName);
- // opens input stream from the HTTP connection
- InputStream inputStream = httpsURLConnection.getInputStream();
- File saveDir = context.getCacheDir();
- final String saveFilePath = saveDir + File.separator + fileName;
-
- // opens an output stream to save into file
- FileOutputStream outputStream = new FileOutputStream(saveFilePath);
-
- int bytesRead;
- byte[] buffer = new byte[CHUNK_SIZE];
- int contentSize = httpsURLConnection.getContentLength();
- int downloadedFileSize = 0;
- while ((bytesRead = inputStream.read(buffer)) != -1) {
- outputStream.write(buffer, 0, bytesRead);
- downloadedFileSize += bytesRead;
- if (context instanceof SlideMediaActivity) {
- final int currentProgress = (downloadedFileSize * 100) / contentSize;
- ((SlideMediaActivity) context).runOnUiThread(() -> listener.onUpdateProgress(currentProgress > 0 ? currentProgress : 101));
- }
- }
- outputStream.close();
- inputStream.close();
- if (context instanceof TootActivity)
- ((TootActivity) context).runOnUiThread(() -> listener.onDownloaded(saveFilePath, downloadUrl, null));
- if (context instanceof SlideMediaActivity)
- ((SlideMediaActivity) context).runOnUiThread(() -> listener.onDownloaded(saveFilePath, downloadUrl, null));
} else {
- final Error error = new Error();
- error.setError(String.valueOf(responseCode));
- if (context instanceof TootActivity)
- ((TootActivity) context).runOnUiThread(() -> listener.onDownloaded(null, downloadUrl, error));
- if (context instanceof SlideMediaActivity)
- ((SlideMediaActivity) context).runOnUiThread(() -> listener.onDownloaded(null, downloadUrl, error));
-
+ // extracts file name from URL
+ fileName = downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1
+ );
}
- } catch (IOException e) {
- Error error = new Error();
- error.setError(context.getString(R.string.toast_error));
- }
+ fileName = FileNameCleaner.cleanFileName(fileName);
+ // opens input stream from the HTTP connection
+ InputStream inputStream = httpURLConnection.getInputStream();
+ File saveDir = context.getCacheDir();
+ final String saveFilePath = saveDir + File.separator + fileName;
- } else {
- try {
- url = new URL(downloadUrl);
- if (proxy != null)
- httpURLConnection = (HttpURLConnection) url.openConnection(proxy);
- else
- httpURLConnection = (HttpURLConnection) url.openConnection();
- httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- int responseCode = httpURLConnection.getResponseCode();
+ // opens an output stream to save into file
+ FileOutputStream outputStream = new FileOutputStream(saveFilePath);
- // always check HTTP response code first
- if (responseCode == HttpURLConnection.HTTP_OK) {
- String fileName = "";
- String disposition = httpURLConnection.getHeaderField("Content-Disposition");
-
- if (disposition != null) {
- // extracts file name from header field
- int index = disposition.indexOf("filename=");
- if (index > 0) {
- fileName = disposition.substring(index + 10,
- disposition.length() - 1);
- }
- } else {
- // extracts file name from URL
- fileName = downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1
- );
+ int bytesRead;
+ byte[] buffer = new byte[CHUNK_SIZE];
+ int contentSize = httpURLConnection.getContentLength();
+ int downloadedFileSize = 0;
+ while ((bytesRead = inputStream.read(buffer)) != -1) {
+ outputStream.write(buffer, 0, bytesRead);
+ downloadedFileSize += bytesRead;
+ if (context instanceof SlideMediaActivity) {
+ final int currentProgress = (downloadedFileSize * 100) / contentSize;
+ ((SlideMediaActivity) context).runOnUiThread(() -> listener.onUpdateProgress(currentProgress > 0 ? currentProgress : 101));
}
- fileName = FileNameCleaner.cleanFileName(fileName);
- // opens input stream from the HTTP connection
- InputStream inputStream = httpURLConnection.getInputStream();
- File saveDir = context.getCacheDir();
- final String saveFilePath = saveDir + File.separator + fileName;
-
- // opens an output stream to save into file
- FileOutputStream outputStream = new FileOutputStream(saveFilePath);
-
- int bytesRead;
- byte[] buffer = new byte[CHUNK_SIZE];
- int contentSize = httpURLConnection.getContentLength();
- int downloadedFileSize = 0;
- while ((bytesRead = inputStream.read(buffer)) != -1) {
- outputStream.write(buffer, 0, bytesRead);
- downloadedFileSize += bytesRead;
- if (context instanceof SlideMediaActivity) {
- final int currentProgress = (downloadedFileSize * 100) / contentSize;
- ((SlideMediaActivity) context).runOnUiThread(() -> listener.onUpdateProgress(currentProgress > 0 ? currentProgress : 101));
- }
- }
- outputStream.close();
- inputStream.close();
- if (context instanceof TootActivity)
- ((TootActivity) context).runOnUiThread(() -> listener.onDownloaded(saveFilePath, downloadUrl, null));
- if (context instanceof SlideMediaActivity)
- ((SlideMediaActivity) context).runOnUiThread(() -> listener.onDownloaded(saveFilePath, downloadUrl, null));
- } else {
- final Error error = new Error();
- error.setError(String.valueOf(responseCode));
- if (context instanceof TootActivity)
- ((TootActivity) context).runOnUiThread(() -> listener.onDownloaded(null, downloadUrl, error));
- if (context instanceof SlideMediaActivity)
- ((SlideMediaActivity) context).runOnUiThread(() -> listener.onDownloaded(null, downloadUrl, error));
-
}
- } catch (IOException e) {
- Error error = new Error();
- error.setError(context.getString(R.string.toast_error));
- }
+ outputStream.close();
+ inputStream.close();
+ if (context instanceof TootActivity)
+ ((TootActivity) context).runOnUiThread(() -> listener.onDownloaded(saveFilePath, downloadUrl, null));
+ if (context instanceof SlideMediaActivity)
+ ((SlideMediaActivity) context).runOnUiThread(() -> listener.onDownloaded(saveFilePath, downloadUrl, null));
+ } else {
+ final Error error = new Error();
+ error.setError(String.valueOf(responseCode));
+ if (context instanceof TootActivity)
+ ((TootActivity) context).runOnUiThread(() -> listener.onDownloaded(null, downloadUrl, error));
+ if (context instanceof SlideMediaActivity)
+ ((SlideMediaActivity) context).runOnUiThread(() -> listener.onDownloaded(null, downloadUrl, error));
+ }
+ } catch (IOException e) {
+ Error error = new Error();
+ error.setError(context.getString(R.string.toast_error));
}
+
}).start();
}
@@ -797,50 +591,29 @@ public class HttpsConnection {
} catch (MalformedURLException e) {
return null;
}
- if (downloadUrl.startsWith("https://")) {
- try {
- if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
- else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory(this.instance));
- httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- int responseCode = httpsURLConnection.getResponseCode();
- // always check HTTP response code first
- if (responseCode >= 200 && responseCode < 400) {
- // opens input stream from the HTTP connection
- return httpsURLConnection.getInputStream();
- }
- httpsURLConnection.getInputStream().close();
- } catch (IOException | NoSuchAlgorithmException | KeyManagementException ignored) {
+ try {
+ if (proxy != null)
+ httpURLConnection = (HttpsURLConnection) url.openConnection(proxy);
+ else
+ httpURLConnection = (HttpsURLConnection) url.openConnection();
+ if (httpURLConnection instanceof HttpsURLConnection) {
+ ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new TLSSocketFactory(this.instance));
}
- if (httpsURLConnection != null)
- try {
- httpsURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- } else {
- try {
- if (proxy != null)
- httpURLConnection = (HttpURLConnection) url.openConnection(proxy);
- else
- httpURLConnection = (HttpURLConnection) url.openConnection();
- httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- int responseCode = httpURLConnection.getResponseCode();
- // always check HTTP response code first
- if (responseCode >= 200 && responseCode < 400) {
- // opens input stream from the HTTP connection
- return httpURLConnection.getInputStream();
- }
- httpURLConnection.getInputStream().close();
- } catch (IOException ignored) {
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ int responseCode = httpURLConnection.getResponseCode();
+ // always check HTTP response code first
+ if (responseCode >= 200 && responseCode < 400) {
+ // opens input stream from the HTTP connection
+ return httpURLConnection.getInputStream();
}
- if (httpURLConnection != null)
- try {
- httpURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
+ httpURLConnection.getInputStream().close();
+ } catch (IOException | NoSuchAlgorithmException | KeyManagementException ignored) {
}
+ if (httpURLConnection != null)
+ try {
+ httpURLConnection.getInputStream().close();
+ } catch (Exception ignored) {
+ }
return null;
}
@@ -925,128 +698,64 @@ public class HttpsConnection {
}
byte[] postDataBytes = (postData.toString()).getBytes(StandardCharsets.UTF_8);
- if (urlConnection.startsWith("https://")) {
- if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
- else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpsURLConnection.setConnectTimeout(timeout * 1000);
- httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory(this.instance));
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
- httpsURLConnection.setRequestMethod("PATCH");
- } else {
- httpsURLConnection.setRequestProperty("X-HTTP-Method-Override", "PATCH");
- httpsURLConnection.setRequestMethod("POST");
- }
- if (token != null && !token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", "Bearer " + token);
- else if (token != null && token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", token);
- httpsURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
- httpsURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
- httpsURLConnection.setDoOutput(true);
-
- String response;
- OutputStream outputStream = httpsURLConnection.getOutputStream();
- outputStream.write(postDataBytes);
- if (avatar != null) {
- uploadMedia(urlConnection, avatar, null, avatarName);
- }
- if (header != null) {
- uploadMedia(urlConnection, null, header, headerName);
- }
- if (httpsURLConnection.getResponseCode() >= 200 && httpsURLConnection.getResponseCode() < 400) {
- response = converToString(httpsURLConnection.getInputStream());
- } else {
- String error = null;
- if (httpsURLConnection.getErrorStream() != null) {
- InputStream stream = httpsURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpsURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpsURLConnection.getResponseCode();
- try {
- httpsURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- try {
- httpsURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- throw new HttpsConnectionException(responseCode, error);
- }
- httpsURLConnection.getInputStream().close();
- return response;
- } else {
- if (proxy != null)
- httpURLConnection = (HttpsURLConnection) url.openConnection(proxy);
- else
- httpURLConnection = (HttpsURLConnection) url.openConnection();
- httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpURLConnection.setConnectTimeout(timeout * 1000);
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
- httpURLConnection.setRequestMethod("PATCH");
- } else {
- httpURLConnection.setRequestProperty("X-HTTP-Method-Override", "PATCH");
- httpURLConnection.setRequestMethod("POST");
- }
- if (token != null && !token.startsWith("Basic "))
- httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
- else if (token != null && token.startsWith("Basic "))
- httpURLConnection.setRequestProperty("Authorization", token);
- httpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
- httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
- httpURLConnection.setDoOutput(true);
-
-
- OutputStream outputStream = httpURLConnection.getOutputStream();
- outputStream.write(postDataBytes);
- if (avatar != null) {
- uploadMedia(urlConnection, avatar, null, avatarName);
- }
- if (header != null) {
- uploadMedia(urlConnection, null, header, headerName);
- }
- String response;
- if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
- response = converToString(httpsURLConnection.getInputStream());
- } else {
- String error = null;
- if (httpURLConnection.getErrorStream() != null) {
- InputStream stream = httpURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpURLConnection.getResponseCode();
- try {
- httpURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
-
- throw new HttpsConnectionException(responseCode, error);
- }
- httpURLConnection.getInputStream().close();
- return response;
+ if (proxy != null)
+ httpURLConnection = (HttpsURLConnection) url.openConnection(proxy);
+ else
+ httpURLConnection = (HttpsURLConnection) url.openConnection();
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ httpURLConnection.setConnectTimeout(timeout * 1000);
+ if (httpURLConnection instanceof HttpsURLConnection) {
+ ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new TLSSocketFactory(this.instance));
}
+ httpURLConnection.setRequestMethod("PATCH");
+ if (token != null && !token.startsWith("Basic "))
+ httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
+ else if (token != null && token.startsWith("Basic "))
+ httpURLConnection.setRequestProperty("Authorization", token);
+ httpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+ httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
+ httpURLConnection.setDoOutput(true);
+
+ String response;
+ OutputStream outputStream = httpURLConnection.getOutputStream();
+ outputStream.write(postDataBytes);
+ if (avatar != null) {
+ uploadMedia(urlConnection, avatar, null, avatarName);
+ }
+ if (header != null) {
+ uploadMedia(urlConnection, null, header, headerName);
+ }
+ if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
+ response = converToString(httpURLConnection.getInputStream());
+ } else {
+ String error = null;
+ if (httpURLConnection.getErrorStream() != null) {
+ InputStream stream = httpURLConnection.getErrorStream();
+ if (stream == null) {
+ stream = httpURLConnection.getInputStream();
+ }
+ try (Scanner scanner = new Scanner(stream)) {
+ scanner.useDelimiter("\\Z");
+ if (scanner.hasNext()) {
+ error = scanner.next();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ int responseCode = httpURLConnection.getResponseCode();
+ try {
+ httpURLConnection.getInputStream().close();
+ } catch (Exception ignored) {
+ }
+ try {
+ httpURLConnection.getInputStream().close();
+ } catch (Exception ignored) {
+ }
+ throw new HttpsConnectionException(responseCode, error);
+ }
+ httpURLConnection.getInputStream().close();
+ return response;
}
@@ -1071,104 +780,56 @@ public class HttpsConnection {
}
byte[] postDataBytes = postData.toString().getBytes(StandardCharsets.UTF_8);
- if (urlConnection.startsWith("https://")) {
- if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
- else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpsURLConnection.setConnectTimeout(timeout * 1000);
- httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory(this.instance));
- if (token != null && !token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", "Bearer " + token);
- else if (token != null && token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", token);
- httpsURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
-
- httpsURLConnection.setRequestMethod("PUT");
- httpsURLConnection.setDoInput(true);
- httpsURLConnection.setDoOutput(true);
-
- httpsURLConnection.getOutputStream().write(postDataBytes);
- String response;
- if (httpsURLConnection.getResponseCode() >= 200 && httpsURLConnection.getResponseCode() < 400) {
- getSinceMaxId();
- response = converToString(httpsURLConnection.getInputStream());
- } else {
- String error = null;
- if (httpsURLConnection.getErrorStream() != null) {
- InputStream stream = httpsURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpsURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpsURLConnection.getResponseCode();
- try {
- httpsURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- throw new HttpsConnectionException(responseCode, error);
- }
- getSinceMaxId();
- httpsURLConnection.getInputStream().close();
- return response;
- } else {
- if (proxy != null)
- httpURLConnection = (HttpURLConnection) url.openConnection(proxy);
- else
- httpURLConnection = (HttpURLConnection) url.openConnection();
- httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpURLConnection.setConnectTimeout(timeout * 1000);
- if (token != null && !token.startsWith("Basic "))
- httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
- else if (token != null && token.startsWith("Basic "))
- httpURLConnection.setRequestProperty("Authorization", token);
- httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
-
- httpURLConnection.setRequestMethod("PUT");
- httpURLConnection.setDoInput(true);
- httpURLConnection.setDoOutput(true);
-
- httpURLConnection.getOutputStream().write(postDataBytes);
- String response;
- if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
- getSinceMaxId();
- response = converToString(httpURLConnection.getInputStream());
- } else {
- String error = null;
- if (httpURLConnection.getErrorStream() != null) {
- InputStream stream = httpURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpURLConnection.getResponseCode();
- try {
- httpURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- throw new HttpsConnectionException(responseCode, error);
- }
- getSinceMaxId();
- httpURLConnection.getInputStream().close();
- return response;
+ if (proxy != null)
+ httpURLConnection = (HttpsURLConnection) url.openConnection(proxy);
+ else
+ httpURLConnection = (HttpsURLConnection) url.openConnection();
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ httpURLConnection.setConnectTimeout(timeout * 1000);
+ if (httpURLConnection instanceof HttpsURLConnection) {
+ ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new TLSSocketFactory(this.instance));
}
+ if (token != null && !token.startsWith("Basic "))
+ httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
+ else if (token != null && token.startsWith("Basic "))
+ httpURLConnection.setRequestProperty("Authorization", token);
+ httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
+
+ httpURLConnection.setRequestMethod("PUT");
+ httpURLConnection.setDoInput(true);
+ httpURLConnection.setDoOutput(true);
+
+ httpURLConnection.getOutputStream().write(postDataBytes);
+ String response;
+ if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
+ getSinceMaxId();
+ response = converToString(httpURLConnection.getInputStream());
+ } else {
+ String error = null;
+ if (httpURLConnection.getErrorStream() != null) {
+ InputStream stream = httpURLConnection.getErrorStream();
+ if (stream == null) {
+ stream = httpURLConnection.getInputStream();
+ }
+ try (Scanner scanner = new Scanner(stream)) {
+ scanner.useDelimiter("\\Z");
+ if (scanner.hasNext()) {
+ error = scanner.next();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ int responseCode = httpURLConnection.getResponseCode();
+ try {
+ httpURLConnection.getInputStream().close();
+ } catch (Exception ignored) {
+ }
+ throw new HttpsConnectionException(responseCode, error);
+ }
+ getSinceMaxId();
+ httpURLConnection.getInputStream().close();
+ return response;
}
@@ -1193,95 +854,50 @@ public class HttpsConnection {
}
byte[] postDataBytes = postData.toString().getBytes(StandardCharsets.UTF_8);
- if (urlConnection.startsWith("https://")) {
- if (proxy != null)
- httpsURLConnection = (HttpsURLConnection) url.openConnection(proxy);
- else
- httpsURLConnection = (HttpsURLConnection) url.openConnection();
- httpsURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory(this.instance));
- if (token != null && !token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", "Bearer " + token);
- else if (token != null && token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", token);
- httpsURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
- httpsURLConnection.setRequestMethod("DELETE");
- httpsURLConnection.setConnectTimeout(timeout * 1000);
- httpsURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
+ if (proxy != null)
+ httpURLConnection = (HttpsURLConnection) url.openConnection(proxy);
+ else
+ httpURLConnection = (HttpsURLConnection) url.openConnection();
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ if (httpURLConnection instanceof HttpsURLConnection) {
+ ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new TLSSocketFactory(this.instance));
+ }
+ if (token != null && !token.startsWith("Basic "))
+ httpURLConnection.setRequestProperty("Authorization", "Bearer " + token);
+ else if (token != null && token.startsWith("Basic "))
+ httpURLConnection.setRequestProperty("Authorization", token);
+ httpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+ httpURLConnection.setRequestMethod("DELETE");
+ httpURLConnection.setConnectTimeout(timeout * 1000);
+ httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
- httpsURLConnection.getOutputStream().write(postDataBytes);
- if (httpsURLConnection.getResponseCode() >= 200 && httpsURLConnection.getResponseCode() < 400) {
- getSinceMaxId();
- httpsURLConnection.getInputStream().close();
- return httpsURLConnection.getResponseCode();
- } else {
- String error = null;
- if (httpsURLConnection.getErrorStream() != null) {
- InputStream stream = httpsURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpsURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- int responseCode = httpsURLConnection.getResponseCode();
- try {
- httpsURLConnection.getInputStream().close();
- } catch (Exception ignored) {
- }
- throw new HttpsConnectionException(responseCode, error);
- }
+ httpURLConnection.getOutputStream().write(postDataBytes);
+ if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
+ getSinceMaxId();
+ httpURLConnection.getInputStream().close();
+ return httpURLConnection.getResponseCode();
} else {
- if (proxy != null)
- httpURLConnection = (HttpURLConnection) url.openConnection(proxy);
- else
- httpURLConnection = (HttpURLConnection) url.openConnection();
- httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
- if (token != null && !token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", "Bearer " + token);
- else if (token != null && token.startsWith("Basic "))
- httpsURLConnection.setRequestProperty("Authorization", token);
- httpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
- httpURLConnection.setRequestMethod("DELETE");
- httpURLConnection.setConnectTimeout(timeout * 1000);
- httpURLConnection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
-
- httpURLConnection.getOutputStream().write(postDataBytes);
-
-
- if (httpURLConnection.getResponseCode() >= 200 && httpURLConnection.getResponseCode() < 400) {
- getSinceMaxId();
- httpURLConnection.getInputStream().close();
- return httpURLConnection.getResponseCode();
- } else {
- String error = null;
- if (httpURLConnection.getErrorStream() != null) {
- InputStream stream = httpURLConnection.getErrorStream();
- if (stream == null) {
- stream = httpURLConnection.getInputStream();
- }
- try (Scanner scanner = new Scanner(stream)) {
- scanner.useDelimiter("\\Z");
- if (scanner.hasNext()) {
- error = scanner.next();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
+ String error = null;
+ if (httpURLConnection.getErrorStream() != null) {
+ InputStream stream = httpURLConnection.getErrorStream();
+ if (stream == null) {
+ stream = httpURLConnection.getInputStream();
}
- int responseCode = httpURLConnection.getResponseCode();
- try {
- httpURLConnection.getInputStream().close();
- } catch (Exception ignored) {
+ try (Scanner scanner = new Scanner(stream)) {
+ scanner.useDelimiter("\\Z");
+ if (scanner.hasNext()) {
+ error = scanner.next();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
}
- throw new HttpsConnectionException(responseCode, error);
}
+ int responseCode = httpURLConnection.getResponseCode();
+ try {
+ httpURLConnection.getInputStream().close();
+ } catch (Exception ignored) {
+ }
+ throw new HttpsConnectionException(responseCode, error);
}
}
@@ -1297,53 +913,30 @@ public class HttpsConnection {
private void getSinceMaxId() {
if (Helper.getLiveInstanceWithProtocol(context) == null)
return;
- if (Helper.getLiveInstanceWithProtocol(context).startsWith("https://")) {
- if (httpsURLConnection == null)
- return;
- Map> map = httpsURLConnection.getHeaderFields();
+ if (httpURLConnection == null)
+ return;
+ Map> map = httpURLConnection.getHeaderFields();
- for (Map.Entry> entry : map.entrySet()) {
- if (entry.toString().startsWith("Link") || entry.toString().startsWith("link")) {
- Pattern patternMaxId = Pattern.compile("max_id=([0-9a-zA-Z]+).*");
- Matcher matcherMaxId = patternMaxId.matcher(entry.toString());
- if (matcherMaxId.find()) {
- max_id = matcherMaxId.group(1);
- }
- if (entry.toString().startsWith("Link")) {
- Pattern patternSinceId = Pattern.compile("since_id=([0-9a-zA-Z]+).*");
- Matcher matcherSinceId = patternSinceId.matcher(entry.toString());
- if (matcherSinceId.find()) {
- since_id = matcherSinceId.group(1);
- }
-
- }
- } else if (entry.toString().startsWith("Min-Id") || entry.toString().startsWith("min-id")) {
- Pattern patternMaxId = Pattern.compile("min-id=\\[([0-9a-zA-Z]+).*]");
- Matcher matcherMaxId = patternMaxId.matcher(entry.toString());
- if (matcherMaxId.find()) {
- max_id = matcherMaxId.group(1);
- }
+ for (Map.Entry> entry : map.entrySet()) {
+ if (entry.toString().startsWith("Link") || entry.toString().startsWith("link")) {
+ Pattern patternMaxId = Pattern.compile("max_id=([0-9a-zA-Z]+).*");
+ Matcher matcherMaxId = patternMaxId.matcher(entry.toString());
+ if (matcherMaxId.find()) {
+ max_id = matcherMaxId.group(1);
}
- }
- } else {
- if (httpURLConnection == null)
- return;
- Map> map = httpURLConnection.getHeaderFields();
- for (Map.Entry> entry : map.entrySet()) {
- if (entry.toString().startsWith("Link") || entry.toString().startsWith("link")) {
- Pattern patternMaxId = Pattern.compile("max_id=([0-9a-zA-Z]+).*");
- Matcher matcherMaxId = patternMaxId.matcher(entry.toString());
- if (matcherMaxId.find()) {
- max_id = matcherMaxId.group(1);
+ if (entry.toString().startsWith("Link")) {
+ Pattern patternSinceId = Pattern.compile("since_id=([0-9a-zA-Z]+).*");
+ Matcher matcherSinceId = patternSinceId.matcher(entry.toString());
+ if (matcherSinceId.find()) {
+ since_id = matcherSinceId.group(1);
}
- if (entry.toString().startsWith("Link")) {
- Pattern patternSinceId = Pattern.compile("since_id=([0-9a-zA-Z]+).*");
- Matcher matcherSinceId = patternSinceId.matcher(entry.toString());
- if (matcherSinceId.find()) {
- since_id = matcherSinceId.group(1);
- }
- }
+ }
+ } else if (entry.toString().startsWith("Min-Id") || entry.toString().startsWith("min-id")) {
+ Pattern patternMaxId = Pattern.compile("min-id=\\[([0-9a-zA-Z]+).*]");
+ Matcher matcherMaxId = patternMaxId.matcher(entry.toString());
+ if (matcherMaxId.find()) {
+ max_id = matcherMaxId.group(1);
}
}
}
@@ -1355,18 +948,10 @@ public class HttpsConnection {
}
int getActionCode() {
- if (Helper.getLiveInstanceWithProtocol(context).startsWith("https://")) {
- try {
- return httpsURLConnection.getResponseCode();
- } catch (IOException e) {
- return -1;
- }
- } else {
- try {
- return httpURLConnection.getResponseCode();
- } catch (IOException e) {
- return -1;
- }
+ try {
+ return httpURLConnection.getResponseCode();
+ } catch (IOException e) {
+ return -1;
}
}
diff --git a/app/src/main/java/app/fedilab/android/fragments/ContentSettingsFragment.java b/app/src/main/java/app/fedilab/android/fragments/ContentSettingsFragment.java
index dbb7dbd3c..4479b76df 100644
--- a/app/src/main/java/app/fedilab/android/fragments/ContentSettingsFragment.java
+++ b/app/src/main/java/app/fedilab/android/fragments/ContentSettingsFragment.java
@@ -127,7 +127,6 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
private final List translators = new ArrayList<>();
private type type;
private Context context;
- private AsyncTask asyncTask;
private int countTrans, countLanguage, notificationCount, ledCount, videoSpinnerCount, liveNotificationCount;
private AccountSearchDevAdapter translatorManager;
private TextView set_folder;
@@ -136,11 +135,9 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
//From: https://gist.github.com/asifmujteba/d89ba9074bc941de1eaa#file-asfurihelper
- @TargetApi(Build.VERSION_CODES.KITKAT)
public static String getPath(final Context context, final Uri uri) {
- final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
// DocumentProvider
- if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
+ if (DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
@@ -607,6 +604,7 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
boolean notif_mention = sharedpreferences.getBoolean(Helper.SET_NOTIF_MENTION, true);
boolean notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE, true);
boolean notif_poll = sharedpreferences.getBoolean(Helper.SET_NOTIF_POLL, true);
+ boolean notif_status = sharedpreferences.getBoolean(Helper.SET_NOTIF_STATUS, true);
boolean notif_wifi = sharedpreferences.getBoolean(Helper.SET_WIFI_ONLY, false);
boolean notif_silent = sharedpreferences.getBoolean(Helper.SET_NOTIF_SILENT, false);
@@ -621,7 +619,7 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
final SwitchCompat set_notif_follow_mention = rootView.findViewById(R.id.set_notif_follow_mention);
final SwitchCompat set_notif_follow_share = rootView.findViewById(R.id.set_notif_follow_share);
final SwitchCompat set_notif_follow_poll = rootView.findViewById(R.id.set_notif_follow_poll);
-
+ final SwitchCompat set_notif_status = rootView.findViewById(R.id.set_notif_status);
final SwitchCompat switchCompatWIFI = rootView.findViewById(R.id.set_wifi_only);
final SwitchCompat switchCompatSilent = rootView.findViewById(R.id.set_silence);
@@ -637,6 +635,8 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
final Button sound_poll = rootView.findViewById(R.id.sound_poll);
final Button sound_backup = rootView.findViewById(R.id.sound_backup);
final Button sound_media = rootView.findViewById(R.id.sound_media);
+ final Button sound_status = rootView.findViewById(R.id.sound_status);
+
final ImageButton set_hide_status_bar = rootView.findViewById(R.id.set_hide_status_bar);
Button set_notif_sound = rootView.findViewById(R.id.set_notif_sound);
@@ -703,6 +703,12 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
intent.putExtra(Settings.EXTRA_CHANNEL_ID, "channel_store");
startActivity(intent);
});
+ sound_status.setOnClickListener(v -> {
+ Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
+ intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
+ intent.putExtra(Settings.EXTRA_CHANNEL_ID, "channel_status");
+ startActivity(intent);
+ });
} else {
set_notif_sound.setVisibility(View.VISIBLE);
channels_container.setVisibility(View.GONE);
@@ -817,7 +823,7 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
set_notif_follow_mention.setChecked(notif_mention);
set_notif_follow_share.setChecked(notif_share);
set_notif_follow_poll.setChecked(notif_poll);
-
+ set_notif_status.setChecked(notif_status);
switchCompatWIFI.setChecked(notif_wifi);
switchCompatSilent.setChecked(notif_silent);
@@ -848,7 +854,11 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
editor.putBoolean(Helper.SET_NOTIF_POLL, set_notif_follow_poll.isChecked());
editor.apply();
});
-
+ set_notif_status.setOnClickListener(v -> {
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ editor.putBoolean(Helper.SET_NOTIF_STATUS, set_notif_status.isChecked());
+ editor.apply();
+ });
switchCompatWIFI.setOnCheckedChangeListener((buttonView, isChecked) -> {
// Save the state here
@@ -2112,7 +2122,7 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
update_tracking_domains.setOnClickListener(v -> {
update_tracking_domains.setEnabled(false);
Intent scriptIntent = new Intent(context, DownloadTrackingDBScriptsService.class);
- ((Activity) context).startService(scriptIntent);
+ context.startService(scriptIntent);
}
);
@@ -2557,10 +2567,6 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
public void onDestroy() {
super.onDestroy();
- if (type == LANGUAGE) {
- if (asyncTask != null && asyncTask.getStatus() == AsyncTask.Status.RUNNING)
- asyncTask.cancel(true);
- }
}
public enum type {
diff --git a/app/src/main/java/app/fedilab/android/fragments/DisplayNotificationsFragment.java b/app/src/main/java/app/fedilab/android/fragments/DisplayNotificationsFragment.java
index d7b598de2..054b8ba9c 100644
--- a/app/src/main/java/app/fedilab/android/fragments/DisplayNotificationsFragment.java
+++ b/app/src/main/java/app/fedilab/android/fragments/DisplayNotificationsFragment.java
@@ -501,6 +501,7 @@ public class DisplayNotificationsFragment extends Fragment implements OnRetrieve
MENTION,
FAVORITE,
BOOST,
+ STATUS,
POLL,
FOLLOW
}
diff --git a/app/src/main/java/app/fedilab/android/fragments/TabLayoutNotificationsFragment.java b/app/src/main/java/app/fedilab/android/fragments/TabLayoutNotificationsFragment.java
index 49c67216f..e249602f3 100644
--- a/app/src/main/java/app/fedilab/android/fragments/TabLayoutNotificationsFragment.java
+++ b/app/src/main/java/app/fedilab/android/fragments/TabLayoutNotificationsFragment.java
@@ -33,6 +33,8 @@ import androidx.viewpager.widget.ViewPager;
import com.google.android.material.tabs.TabLayout;
+import org.jetbrains.annotations.NotNull;
+
import java.util.Objects;
import app.fedilab.android.R;
@@ -67,6 +69,7 @@ public class TabLayoutNotificationsFragment extends Fragment {
TabLayout.Tab tabMention = tabLayout.newTab();
TabLayout.Tab tabFav = tabLayout.newTab();
TabLayout.Tab tabBoost = tabLayout.newTab();
+ TabLayout.Tab tabStatus = tabLayout.newTab();
TabLayout.Tab tabPoll = tabLayout.newTab();
TabLayout.Tab tabFollow = tabLayout.newTab();
@@ -75,8 +78,10 @@ public class TabLayoutNotificationsFragment extends Fragment {
tabFav.setCustomView(R.layout.tab_badge);
if (MainActivity.social != UpdateAccountInfoAsyncTask.SOCIAL.FRIENDICA)
tabBoost.setCustomView(R.layout.tab_badge);
- if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON)
+ if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
tabPoll.setCustomView(R.layout.tab_badge);
+ tabStatus.setCustomView(R.layout.tab_badge);
+ }
tabFollow.setCustomView(R.layout.tab_badge);
@@ -100,13 +105,19 @@ public class TabLayoutNotificationsFragment extends Fragment {
iconBoost.setImageResource(R.drawable.ic_repeat_notif_tab);
}
+ ImageView iconStatus = null;
+ if (tabStatus.getCustomView() != null) {
+ iconStatus = tabStatus.getCustomView().findViewById(R.id.tab_icon);
+ iconStatus.setImageResource(R.drawable.ic_baseline_home_notif);
+ }
+
ImageView iconPoll = null;
if (tabPoll.getCustomView() != null) {
iconPoll = tabPoll.getCustomView().findViewById(R.id.tab_icon);
iconPoll.setImageResource(R.drawable.ic_view_list_poll_notif);
}
- @SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
+ @SuppressLint("CutPasteId")
ImageView iconFollow = tabFollow.getCustomView().findViewById(R.id.tab_icon);
iconFollow.setImageResource(R.drawable.ic_follow_notif_tab);
@@ -116,8 +127,11 @@ public class TabLayoutNotificationsFragment extends Fragment {
tabLayout.addTab(tabFav);
if (tabBoost.getCustomView() != null)
tabLayout.addTab(tabBoost);
+ if (tabStatus.getCustomView() != null)
+ tabLayout.addTab(tabStatus);
if (tabPoll.getCustomView() != null)
tabLayout.addTab(tabPoll);
+
tabLayout.addTab(tabFollow);
if (theme == Helper.THEME_BLACK)
@@ -133,6 +147,8 @@ public class TabLayoutNotificationsFragment extends Fragment {
iconBoost.setColorFilter(ContextCompat.getColor(context, R.color.action_light_header), PorterDuff.Mode.SRC_IN);
if (iconPoll != null)
iconPoll.setColorFilter(ContextCompat.getColor(context, R.color.action_light_header), PorterDuff.Mode.SRC_IN);
+ if (iconStatus != null)
+ iconStatus.setColorFilter(ContextCompat.getColor(context, R.color.action_light_header), PorterDuff.Mode.SRC_IN);
iconFollow.setColorFilter(ContextCompat.getColor(context, R.color.action_light_header), PorterDuff.Mode.SRC_IN);
} else {
iconMention.setColorFilter(ContextCompat.getColor(context, R.color.dark_text), PorterDuff.Mode.SRC_IN);
@@ -142,14 +158,15 @@ public class TabLayoutNotificationsFragment extends Fragment {
iconBoost.setColorFilter(ContextCompat.getColor(context, R.color.dark_text), PorterDuff.Mode.SRC_IN);
if (iconPoll != null)
iconPoll.setColorFilter(ContextCompat.getColor(context, R.color.dark_text), PorterDuff.Mode.SRC_IN);
+ if (iconStatus != null)
+ iconStatus.setColorFilter(ContextCompat.getColor(context, R.color.dark_text), PorterDuff.Mode.SRC_IN);
iconFollow.setColorFilter(ContextCompat.getColor(context, R.color.dark_text), PorterDuff.Mode.SRC_IN);
}
viewPager = inflatedView.findViewById(R.id.viewpager);
viewPager.setEnableSwipe(false);
- viewPager.setAdapter(new PagerAdapter
- (getChildFragmentManager(), tabLayout.getTabCount()));
+ viewPager.setAdapter(new PagerAdapter(getChildFragmentManager(), tabLayout.getTabCount()));
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
@@ -180,7 +197,7 @@ public class TabLayoutNotificationsFragment extends Fragment {
}
@Override
- public void onAttach(Context context) {
+ public void onAttach(@NotNull Context context) {
super.onAttach(context);
this.context = context;
}
@@ -206,7 +223,7 @@ public class TabLayoutNotificationsFragment extends Fragment {
/**
* Page Adapter for settings
*/
- private class PagerAdapter extends FragmentStatePagerAdapter {
+ private static class PagerAdapter extends FragmentStatePagerAdapter {
int mNumOfTabs;
private PagerAdapter(FragmentManager fm, int NumOfTabs) {
@@ -215,7 +232,7 @@ public class TabLayoutNotificationsFragment extends Fragment {
}
@Override
- public Fragment getItem(int position) {
+ public @NotNull Fragment getItem(int position) {
DisplayNotificationsFragment displayNotificationsFragment = new DisplayNotificationsFragment();
DisplayNotificationsFragment.Type type = null;
String tag = "";
@@ -244,12 +261,15 @@ public class TabLayoutNotificationsFragment extends Fragment {
type = DisplayNotificationsFragment.Type.BOOST;
break;
case 4:
+ type = DisplayNotificationsFragment.Type.STATUS;
+ break;
+ case 5:
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON)
type = DisplayNotificationsFragment.Type.POLL;
else
type = DisplayNotificationsFragment.Type.FOLLOW;
break;
- case 5:
+ case 6:
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON)
type = DisplayNotificationsFragment.Type.FOLLOW;
default:
diff --git a/app/src/main/java/app/fedilab/android/helper/BaseHelper.java b/app/src/main/java/app/fedilab/android/helper/BaseHelper.java
index 82baa0ef0..b89a79e16 100644
--- a/app/src/main/java/app/fedilab/android/helper/BaseHelper.java
+++ b/app/src/main/java/app/fedilab/android/helper/BaseHelper.java
@@ -426,11 +426,13 @@ public class BaseHelper {
public static final String SET_NOTIF_MENTION = "set_notif_follow_mention";
public static final String SET_NOTIF_SHARE = "set_notif_follow_share";
public static final String SET_NOTIF_POLL = "set_notif_follow_poll";
+ public static final String SET_NOTIF_STATUS = "set_notif_follow_status";
public static final String SET_NOTIF_FOLLOW_FILTER = "set_notif_follow_filter";
public static final String SET_NOTIF_ADD_FILTER = "set_notif_follow_add_filter";
public static final String SET_NOTIF_MENTION_FILTER = "set_notif_follow_mention_filter";
public static final String SET_NOTIF_SHARE_FILTER = "set_notif_follow_share_filter";
public static final String SET_NOTIF_POLL_FILTER = "set_notif_follow_poll_filter";
+ public static final String SET_NOTIF_STATUS_FILTER = "set_notif_follow_status_filter";
public static final String SET_FILTER_REGEX_HOME = "set_filter_regex_home";
public static final String SET_FILTER_REGEX_LOCAL = "set_filter_regex_local";
public static final String SET_FILTER_REGEX_PUBLIC = "set_filter_regex_public";
@@ -1137,8 +1139,8 @@ public class BaseHelper {
channelTitle = context.getString(R.string.channel_notif_media);
break;
case TOOT:
- channelId = "channel_toot";
- channelTitle = context.getString(R.string.channel_notif_toot);
+ channelId = "channel_status";
+ channelTitle = context.getString(R.string.channel_notif_status);
break;
default:
channelId = "channel_boost";
@@ -3452,16 +3454,26 @@ public class BaseHelper {
ContentResolver resolver = context.getContentResolver();
Cursor returnCursor =
resolver.query(uri, null, null, null, null);
- assert returnCursor != null;
- try {
- int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
- returnCursor.moveToFirst();
- String name = returnCursor.getString(nameIndex);
- returnCursor.close();
- Random r = new Random();
- int suf = r.nextInt(9999 - 1000) + 1000;
- return suf + name;
- } catch (Exception e) {
+ if (returnCursor != null) {
+ try {
+ int nameIndex = returnCursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
+ returnCursor.moveToFirst();
+ String name = returnCursor.getString(nameIndex);
+ returnCursor.close();
+ Random r = new Random();
+ int suf = r.nextInt(9999 - 1000) + 1000;
+ return suf + name;
+ } catch (Exception e) {
+ Random r = new Random();
+ int suf = r.nextInt(9999 - 1000) + 1000;
+ ContentResolver cr = context.getContentResolver();
+ String mime = cr.getType(uri);
+ if (mime != null && mime.split("/").length > 1)
+ return "__" + suf + "." + mime.split("/")[1];
+ else
+ return "__" + suf + ".jpg";
+ }
+ } else {
Random r = new Random();
int suf = r.nextInt(9999 - 1000) + 1000;
ContentResolver cr = context.getContentResolver();
@@ -4482,6 +4494,7 @@ public class BaseHelper {
BOOST,
FAV,
POLL,
+ STATUS,
BACKUP,
STORE,
TOOT
diff --git a/app/src/main/java/app/fedilab/android/jobs/BaseNotificationsSyncJob.java b/app/src/main/java/app/fedilab/android/jobs/BaseNotificationsSyncJob.java
index 3d1e7b86e..de23862ef 100644
--- a/app/src/main/java/app/fedilab/android/jobs/BaseNotificationsSyncJob.java
+++ b/app/src/main/java/app/fedilab/android/jobs/BaseNotificationsSyncJob.java
@@ -161,6 +161,7 @@ public class BaseNotificationsSyncJob extends Job {
boolean notif_mention = sharedpreferences.getBoolean(Helper.SET_NOTIF_MENTION, true);
boolean notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE, true);
boolean notif_poll = sharedpreferences.getBoolean(Helper.SET_NOTIF_POLL, true);
+ boolean notif_status = sharedpreferences.getBoolean(Helper.SET_NOTIF_STATUS, true);
final String max_id = sharedpreferences.getString(Helper.LAST_NOTIFICATION_MAX_ID + account.getId() + account.getInstance(), null);
final List notifications = new ArrayList<>();
int pos = 0;
@@ -178,6 +179,7 @@ public class BaseNotificationsSyncJob extends Job {
int newMentions = 0;
int newShare = 0;
int newPolls = 0;
+ int newStatus = 0;
String notificationUrl = null;
String title = null;
final String message;
@@ -199,6 +201,19 @@ public class BaseNotificationsSyncJob extends Job {
}
}
break;
+ case "status":
+ notifType = Helper.NotifType.STATUS;
+ if (notif_status) {
+ newStatus++;
+ if (notificationUrl == null) {
+ notificationUrl = notification.getAccount().getAvatar();
+ if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
+ title = String.format("%s %s", notification.getAccount().getDisplay_name(), getContext().getString(R.string.notif_mention));
+ else
+ title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_mention));
+ }
+ }
+ break;
case "reblog":
notifType = Helper.NotifType.BOOST;
if (notif_share) {
@@ -272,7 +287,7 @@ public class BaseNotificationsSyncJob extends Job {
}
}
- int allNotifCount = newFollows + newAdds + newMentions + newShare + newPolls;
+ int allNotifCount = newFollows + newAdds + newMentions + newShare + newPolls + newStatus;
if (allNotifCount > 0) {
//Some others notification
int other = allNotifCount - 1;
diff --git a/app/src/main/java/app/fedilab/android/services/BackupStatusService.java b/app/src/main/java/app/fedilab/android/services/BackupStatusService.java
index 901b42dbd..a4ec2eca9 100644
--- a/app/src/main/java/app/fedilab/android/services/BackupStatusService.java
+++ b/app/src/main/java/app/fedilab/android/services/BackupStatusService.java
@@ -67,12 +67,10 @@ public class BackupStatusService extends IntentService {
*
* @param name Used to name the worker thread, important only for debugging.
*/
- @SuppressWarnings("unused")
public BackupStatusService(String name) {
super(name);
}
- @SuppressWarnings("unused")
public BackupStatusService() {
super("BackupStatusService");
}
diff --git a/app/src/main/java/app/fedilab/android/services/BaseLiveNotificationService.java b/app/src/main/java/app/fedilab/android/services/BaseLiveNotificationService.java
index 5eadc548f..0665bb38d 100644
--- a/app/src/main/java/app/fedilab/android/services/BaseLiveNotificationService.java
+++ b/app/src/main/java/app/fedilab/android/services/BaseLiveNotificationService.java
@@ -56,8 +56,6 @@ import com.koushikdutta.async.http.WebSocket;
import org.json.JSONException;
import org.json.JSONObject;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
@@ -67,7 +65,6 @@ import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.client.API;
import app.fedilab.android.client.Entities.Account;
import app.fedilab.android.client.Entities.Notification;
-import app.fedilab.android.client.TLSSocketFactory;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.sqlite.AccountDAO;
import app.fedilab.android.sqlite.Sqlite;
@@ -231,14 +228,6 @@ public abstract class BaseLiveNotificationService extends Service implements Net
String urlKey = "wss://" + account.getInstance() + "/api/v1/streaming/?stream=" + notif_url + "&access_token=" + account.getToken();
Uri url = Uri.parse(urlKey);
AsyncHttpRequest.setDefaultHeaders(headers, url);
- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
- try {
- AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setSSLContext(new TLSSocketFactory(account.getInstance()).getSSLContext());
- AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setConnectAllAddresses(true);
- } catch (KeyManagementException | NoSuchAlgorithmException e) {
- e.printStackTrace();
- }
- }
String key = account.getAcct() + "@" + account.getInstance();
if (webSocketFutures.get(key) == null || !Objects.requireNonNull(webSocketFutures.get(key)).isOpen()) {
AsyncHttpClient.getDefaultInstance().websocket("wss://" + account.getInstance() + "/api/v1/streaming/?stream=" + notif_url + "&access_token=" + account.getToken(), "wss", (ex, webSocket) -> {
@@ -353,8 +342,9 @@ public abstract class BaseLiveNotificationService extends Service implements Net
boolean notif_add = sharedpreferences.getBoolean(Helper.SET_NOTIF_ADD, true);
boolean notif_mention = sharedpreferences.getBoolean(Helper.SET_NOTIF_MENTION, true);
boolean notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE, true);
+ boolean notif_status = sharedpreferences.getBoolean(Helper.SET_NOTIF_STATUS, true);
boolean notif_poll = sharedpreferences.getBoolean(Helper.SET_NOTIF_POLL, true);
- boolean somethingToPush = (notif_follow || notif_add || notif_mention || notif_share || notif_poll);
+ boolean somethingToPush = (notif_follow || notif_add || notif_mention || notif_share || notif_poll || notif_status);
String message = null;
if (somethingToPush) {
switch (notification.getType()) {
@@ -382,6 +372,30 @@ public abstract class BaseLiveNotificationService extends Service implements Net
canSendBroadCast = false;
}
break;
+ case "status":
+ notifType = Helper.NotifType.STATUS;
+ if (notif_status) {
+ if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
+ message = String.format("%s %s", notification.getAccount().getDisplay_name(), getString(R.string.notif_status));
+ else
+ message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_status));
+ if (notification.getStatus() != null) {
+ if (notification.getStatus().getSpoiler_text() != null && notification.getStatus().getSpoiler_text().length() > 0) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
+ message = "\n" + new SpannableString(Html.fromHtml(notification.getStatus().getSpoiler_text(), FROM_HTML_MODE_LEGACY));
+ else
+ message = "\n" + new SpannableString(Html.fromHtml(notification.getStatus().getSpoiler_text()));
+ } else {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
+ message = "\n" + new SpannableString(Html.fromHtml(notification.getStatus().getContent(), FROM_HTML_MODE_LEGACY));
+ else
+ message = "\n" + new SpannableString(Html.fromHtml(notification.getStatus().getContent()));
+ }
+ }
+ } else {
+ canSendBroadCast = false;
+ }
+ break;
case "reblog":
notifType = Helper.NotifType.BOOST;
if (notif_share) {
diff --git a/app/src/main/java/app/fedilab/android/services/BaseStreamingFederatedTimelineService.java b/app/src/main/java/app/fedilab/android/services/BaseStreamingFederatedTimelineService.java
index fa7c57031..25a2ce323 100644
--- a/app/src/main/java/app/fedilab/android/services/BaseStreamingFederatedTimelineService.java
+++ b/app/src/main/java/app/fedilab/android/services/BaseStreamingFederatedTimelineService.java
@@ -60,12 +60,10 @@ public abstract class BaseStreamingFederatedTimelineService extends IntentServic
*
* @param name Used to name the worker thread, important only for debugging.
*/
- @SuppressWarnings("unused")
public BaseStreamingFederatedTimelineService(String name) {
super(name);
}
- @SuppressWarnings("unused")
public BaseStreamingFederatedTimelineService() {
super("StreamingFederatedTimelineService");
}
diff --git a/app/src/main/java/app/fedilab/android/services/BaseStreamingHomeTimelineService.java b/app/src/main/java/app/fedilab/android/services/BaseStreamingHomeTimelineService.java
index f77d90f33..818602db5 100644
--- a/app/src/main/java/app/fedilab/android/services/BaseStreamingHomeTimelineService.java
+++ b/app/src/main/java/app/fedilab/android/services/BaseStreamingHomeTimelineService.java
@@ -60,12 +60,10 @@ public abstract class BaseStreamingHomeTimelineService extends IntentService {
*
* @param name Used to name the worker thread, important only for debugging.
*/
- @SuppressWarnings("unused")
public BaseStreamingHomeTimelineService(String name) {
super(name);
}
- @SuppressWarnings("unused")
public BaseStreamingHomeTimelineService() {
super("StreamingHomeTimelineService");
}
@@ -104,14 +102,6 @@ public abstract class BaseStreamingHomeTimelineService extends IntentService {
Uri url = Uri.parse("wss://" + accountStream.getInstance() + "/api/v1/streaming/?stream=user&access_token=" + accountStream.getToken());
AsyncHttpRequest.setDefaultHeaders(headers, url);
Account finalAccountStream = accountStream;
- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
- try {
- AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setSSLContext(new TLSSocketFactory(accountStream.getInstance()).getSSLContext());
- AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setConnectAllAddresses(true);
- } catch (KeyManagementException | NoSuchAlgorithmException e) {
- e.printStackTrace();
- }
- }
AsyncHttpClient.getDefaultInstance().websocket("wss://" + accountStream.getInstance() + "/api/v1/streaming/?stream=user&access_token=" + accountStream.getToken(), "wss", (ex, webSocket) -> {
if (ex != null) {
ex.printStackTrace();
diff --git a/app/src/main/java/app/fedilab/android/services/BaseStreamingLocalTimelineService.java b/app/src/main/java/app/fedilab/android/services/BaseStreamingLocalTimelineService.java
index c61f2db17..614601c87 100644
--- a/app/src/main/java/app/fedilab/android/services/BaseStreamingLocalTimelineService.java
+++ b/app/src/main/java/app/fedilab/android/services/BaseStreamingLocalTimelineService.java
@@ -104,14 +104,6 @@ public abstract class BaseStreamingLocalTimelineService extends IntentService {
Uri url = Uri.parse("wss://" + accountStream.getInstance() + "/api/v1/streaming/?stream=public:local&access_token=" + accountStream.getToken());
AsyncHttpRequest.setDefaultHeaders(headers, url);
Account finalAccountStream = accountStream;
- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
- try {
- AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setSSLContext(new TLSSocketFactory(accountStream.getInstance()).getSSLContext());
- AsyncHttpClient.getDefaultInstance().getSSLSocketMiddleware().setConnectAllAddresses(true);
- } catch (KeyManagementException | NoSuchAlgorithmException e) {
- e.printStackTrace();
- }
- }
AsyncHttpClient.getDefaultInstance().websocket("wss://" + accountStream.getInstance() + "/api/v1/streaming/?stream=public:local&access_token=" + accountStream.getToken(), "wss", (ex, webSocket) -> {
if (ex != null) {
ex.printStackTrace();
diff --git a/app/src/main/java/app/fedilab/android/services/LiveNotificationDelayedService.java b/app/src/main/java/app/fedilab/android/services/LiveNotificationDelayedService.java
index 02522e06e..f4ddeeb7b 100644
--- a/app/src/main/java/app/fedilab/android/services/LiveNotificationDelayedService.java
+++ b/app/src/main/java/app/fedilab/android/services/LiveNotificationDelayedService.java
@@ -214,11 +214,10 @@ public class LiveNotificationDelayedService extends Service {
private void startThread(Account accountStream, String key) {
Thread thread = new Thread() {
- @SuppressWarnings("ConstantConditions")
@Override
public void run() {
while (fetch) {
- taks(accountStream);
+ task(accountStream);
fetch = (Helper.liveNotifType(LiveNotificationDelayedService.this) == Helper.NOTIF_DELAYED);
if (sleeps.containsKey(key) && sleeps.get(key) != null) {
try {
@@ -241,8 +240,7 @@ public class LiveNotificationDelayedService extends Service {
}
- @SuppressWarnings("ConstantConditions")
- private void taks(Account account) {
+ private void task(Account account) {
String key = account.getUsername() + "@" + account.getInstance();
APIResponse apiResponse;
@@ -341,8 +339,9 @@ public class LiveNotificationDelayedService extends Service {
boolean notif_add = sharedpreferences.getBoolean(Helper.SET_NOTIF_ADD, true);
boolean notif_mention = sharedpreferences.getBoolean(Helper.SET_NOTIF_MENTION, true);
boolean notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE, true);
+ boolean notif_status = sharedpreferences.getBoolean(Helper.SET_NOTIF_STATUS, true);
boolean notif_poll = sharedpreferences.getBoolean(Helper.SET_NOTIF_POLL, true);
- boolean somethingToPush = (notif_follow || notif_add || notif_mention || notif_share || notif_poll);
+ boolean somethingToPush = (notif_follow || notif_add || notif_mention || notif_share || notif_poll || notif_status);
String message = null;
if (somethingToPush) {
@@ -371,6 +370,30 @@ public class LiveNotificationDelayedService extends Service {
canSendBroadCast = false;
}
break;
+ case "status":
+ notifType = Helper.NotifType.STATUS;
+ if (notif_status) {
+ if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
+ message = String.format("%s %s", notification.getAccount().getDisplay_name(), getString(R.string.notif_status));
+ else
+ message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_status));
+ if (notification.getStatus() != null) {
+ if (notification.getStatus().getSpoiler_text() != null && notification.getStatus().getSpoiler_text().length() > 0) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
+ message = "\n" + new SpannableString(Html.fromHtml(notification.getStatus().getSpoiler_text(), FROM_HTML_MODE_LEGACY));
+ else
+ message = "\n" + new SpannableString(Html.fromHtml(notification.getStatus().getSpoiler_text()));
+ } else {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
+ message = "\n" + new SpannableString(Html.fromHtml(notification.getStatus().getContent(), FROM_HTML_MODE_LEGACY));
+ else
+ message = "\n" + new SpannableString(Html.fromHtml(notification.getStatus().getContent()));
+ }
+ }
+ } else {
+ canSendBroadCast = false;
+ }
+ break;
case "reblog":
notifType = Helper.NotifType.BOOST;
if (notif_share) {
diff --git a/app/src/main/res/drawable/ic_baseline_home_notif.xml b/app/src/main/res/drawable/ic_baseline_home_notif.xml
new file mode 100644
index 000000000..3a4c7dac9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_baseline_home_notif.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_baseline_notifications_account_none.xml b/app/src/main/res/drawable/ic_baseline_notifications_account_none.xml
new file mode 100644
index 000000000..6cd3b4273
--- /dev/null
+++ b/app/src/main/res/drawable/ic_baseline_notifications_account_none.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_baseline_notifications_account_yes.xml b/app/src/main/res/drawable/ic_baseline_notifications_account_yes.xml
new file mode 100644
index 000000000..c3204226d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_baseline_notifications_account_yes.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/app/src/main/res/layout-sw600dp/activity_show_account.xml b/app/src/main/res/layout-sw600dp/activity_show_account.xml
index 14c2d99db..75c96179e 100644
--- a/app/src/main/res/layout-sw600dp/activity_show_account.xml
+++ b/app/src/main/res/layout-sw600dp/activity_show_account.xml
@@ -77,6 +77,7 @@
android:layout_height="45dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
+ android:contentDescription="@string/make_an_action"
android:scaleType="fitCenter"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@id/account_pp"
@@ -90,6 +91,7 @@
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:scaleType="fitCenter"
+ android:contentDescription="@string/edit_profile"
android:src="@drawable/ic_edit"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@id/account_pp"
@@ -104,10 +106,25 @@
android:layout_marginTop="10dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_note"
+ android:contentDescription="@string/action_add_notes"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@id/account_follow"
app:layout_constraintTop_toBottomOf="@id/banner_pp" />
+
+
+ android:visibility="gone"
+ tools:ignore="HardcodedText" />
+
+
+
+ android:gravity="center"
+ android:singleLine="true"
+ android:text="@string/channel_notif_status"
+ android:tint="@android:color/white" />
@@ -492,6 +497,30 @@
+
+
+
+
+
+
+
+
+
+
-
لا توجد هناك إخطارات للعرض
أشار إليك
+ wrote a new message
رقى تبويقك
أُعجِب بتبويقك
يتابعك
@@ -310,6 +311,7 @@
إخطاري عندما يُعجَب أحدهم بأحد منشوراتي
إخطاري عندما يُشار إليّ
أرسل إشعاراً عند انتهاء استطلاع الرأي
+ Notify for new posts
عرض مربع حوار للتأكيد قبل ترقية أي تبويق
عرض مربع حوار للتأكيد قبل إضافة أي تبويق إلى المفضلة
تفعيل الإخطار في وضع الواي فاي فقط
@@ -542,6 +544,7 @@
انتهى استطلاع الرأي
تبويق جديد
النسخ الاحتياطي للتبويقات
+ New posts
تنزيل الوسائط
تغيير الإشعار الصوتي
اختيار نغمة
diff --git a/app/src/main/res/values-ber/strings.xml b/app/src/main/res/values-ber/strings.xml
index efb2f4d36..9a1f819e3 100644
--- a/app/src/main/res/values-ber/strings.xml
+++ b/app/src/main/res/values-ber/strings.xml
@@ -216,6 +216,7 @@
No notification to display
mentioned you
+ wrote a new message
boosted your status
favourited your status
followed you
@@ -286,6 +287,7 @@
Notify when someone favourites your status
Notify when someone mentions you
Notify when a poll ended
+ Notify for new posts
Show confirmation dialog before boosting
Show confirmation dialog before adding to favourites
Notify in WIFI only
@@ -519,6 +521,7 @@
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-bn/strings.xml b/app/src/main/res/values-bn/strings.xml
index f868eaebd..a67bead13 100644
--- a/app/src/main/res/values-bn/strings.xml
+++ b/app/src/main/res/values-bn/strings.xml
@@ -216,6 +216,7 @@
No notification to display
mentioned you
+ wrote a new message
boosted your status
favourited your status
followed you
@@ -286,6 +287,7 @@
Notify when someone favourites your status
Notify when someone mentions you
Notify when a poll ended
+ Notify for new posts
Show confirmation dialog before boosting
Show confirmation dialog before adding to favourites
Notify in WIFI only
@@ -519,6 +521,7 @@
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-br/strings.xml b/app/src/main/res/values-br/strings.xml
index 09ad18835..4aec5de5e 100644
--- a/app/src/main/res/values-br/strings.xml
+++ b/app/src/main/res/values-br/strings.xml
@@ -228,6 +228,7 @@
No notification to display
mentioned you
+ wrote a new message
boosted your status
favourited your status
followed you
@@ -304,6 +305,7 @@
Notify when someone favourites your status
Notify when someone mentions you
Notify when a poll ended
+ Notify for new posts
Show confirmation dialog before boosting
Show confirmation dialog before adding to favourites
Notify in WIFI only
@@ -537,6 +539,7 @@
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml
index 6c3d5384d..121e511be 100644
--- a/app/src/main/res/values-ca/strings.xml
+++ b/app/src/main/res/values-ca/strings.xml
@@ -216,6 +216,7 @@
No hi ha notificacions per mostrar
t\'ha mencionat
+ wrote a new message
ha difós el teu missatge
ha marcat com a preferit el teu missatge
t\'ha començat a seguir
@@ -286,6 +287,7 @@
Avisa quan algú marqui el teu missatge com a preferit
Avisa quan algú et mencioni
Avisar quan una enquesta finalitzi
+ Notify for new posts
Demana confirmació abans de difondre
Demana confirmació abans d\'afegir a preferits
Enviar avisos només amb WIFI
@@ -511,6 +513,7 @@ Quan s\'esborra l\'aplicació s\'eliminen les dades immediatament.\n
Enquesta finalitzada
Bram nou
Còpia de seguretat de brams
+ New posts
Baixada de mèdia
Canvi del so d\'avís
Selecciona el so
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index 50a2fc240..9c37afec8 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -224,6 +224,7 @@
Žádné upozornění k zobrazení
vás zmínil/a
+ wrote a new message
boostnul/a váš toot
si oblíbil/a váš toot
vás sleduje
@@ -298,6 +299,7 @@
Oznámení v případě oblíbení vašeho tootu
Oznámení v případě, že vás někdo zmíní
Oznámení po skončení ankety
+ Notify for new posts
Zobrazit potvrzení před boostnutí
Zobrazit potvrzení před oblíbením
Oznámení pouze na WIFI
@@ -529,6 +531,7 @@ Uživatelské jméno a heslo nejsou nikdy ukládány. Jsou použity pouze během
Anketa skončila
Nový toot
Záloha tootů
+ New posts
Stahování médií
Výchozí zvuk oznámení
Vybrat tón
diff --git a/app/src/main/res/values-cy/strings.xml b/app/src/main/res/values-cy/strings.xml
index 8ad1adfdd..a6d3402f6 100644
--- a/app/src/main/res/values-cy/strings.xml
+++ b/app/src/main/res/values-cy/strings.xml
@@ -232,6 +232,7 @@
Dim hysbysiad i\'w arddangos
wedi\'ch crybwyll
+ wrote a new message
wedi hybu\'ch tŵt
wedi nodi\'ch tŵt yn ffefryn
wedi\'ch dilyn chi
@@ -310,6 +311,7 @@
Hysbysu pan mae rhywun yn ffefrynnu eich statws
Hysbysu pan mae rhywun yn sôn amdanoch chi
Notify when a poll ended
+ Notify for new posts
Dangos deialog cadarnhau cyn hybu
Dangos deialog cadarnhau cyn ychwanegu i\'r ffefrynnau
Ond hysbysu pan yn gysylltiedig i WIFI
@@ -542,6 +544,7 @@
Poll Ended
Tŵt Newydd
Tŵtiau wrth gefn
+ New posts
Lawrlwytho Cyfryngau
Newid swn hsybysu
Dewis tôn
diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml
index 48340a433..a0f49fd9c 100644
--- a/app/src/main/res/values-da/strings.xml
+++ b/app/src/main/res/values-da/strings.xml
@@ -216,6 +216,7 @@
Ingen notifikationer at vise
nævnte dig
+ wrote a new message
boostede din status
favoriserede din status
fulgte dig
@@ -286,6 +287,7 @@
Notificér, når nogen favoriserer din status
Notificér, når nogen nævner dig
Advisér, når en afstemning er afsluttet
+ Notify for new posts
Vis bekræftelsesdialog inden boosting
Vis bekræftelsesdialog inden favorittilføjelse
Notificér kun via Wi-Fi
@@ -519,6 +521,7 @@
Afstemning afsluttet
Nyt toot
Toot-sikkerhedskopiering
+ New posts
Medie-download
Skift notifikationslyd
Vælg lyd
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index c28e61191..855f4a377 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -216,6 +216,7 @@
Keine Benachrichtigungen
hat dich erwähnt
+ wrote a new message
hat deinen Beitrag geteilt
hat deinen Status favorisiert
folgt dir
@@ -286,6 +287,7 @@
jemand meinen Beitrag favorisiert
ich erwähnt werde
Benachrichtigen, sobald eine Umfrage beendet ist
+ Notify for new posts
Bestätigungsdialog vor dem Teilen anzeigen
Bestätigungsdialog vor dem Favorisieren anzeigen
Nur bei WLAN benachrichtigen
@@ -512,6 +514,7 @@ Durch das Löschen der Anwendung werden diese Daten sofort entfernt.\n
Umfrage beendet
Neuer Toot
Toots Backup
+ New posts
Medien Download
Ändere Ton für Benachrichtigungen
Klingelton auswählen
diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml
index a3c0ac5f4..36cecd254 100644
--- a/app/src/main/res/values-el/strings.xml
+++ b/app/src/main/res/values-el/strings.xml
@@ -216,6 +216,7 @@
Καμία ειδοποίηση προς εμφάνιση
σε ανέφερε
+ wrote a new message
ενίσχυσε την κατάστασή σου
έδειξε προτίμηση στην κατάστασή σου
άρχισε να σε παρακολουθεί
@@ -286,6 +287,7 @@
Ειδοποίηση όταν σε κάποιον αρέσει η κατάστασή σου
Ειδοποίηση όταν κάποιος σε αναφέρει
Ειδοποίηση όταν τελειώνει μια ψηφοφορία
+ Notify for new posts
Προβολή του διαλόγου επιβεβαίωσης, πριν από την ενίσχυση
Προβολή του διαλόγου επιβεβαίωσης, πριν να γίνει προσθήκη στα Αγαπημένα
Ειδοποίηση μόνο όταν σε Γουάι-Φάι
@@ -519,6 +521,7 @@
Η Ψηφοφορία Τελείωσε
Νέα Φωνή
Αντίγραφο των Φωνών
+ New posts
Κατέβασμα Πολυμέσων
Αλλαγή του ήχου των ειδοποιήσεων
Επιλογή Τόνου
diff --git a/app/src/main/res/values-eo/strings.xml b/app/src/main/res/values-eo/strings.xml
index 4bcc93ad7..a006323cb 100644
--- a/app/src/main/res/values-eo/strings.xml
+++ b/app/src/main/res/values-eo/strings.xml
@@ -216,6 +216,7 @@
Neniun sciigon por montri
%s menciis vin
+ wrote a new message
{name} diskonigis vian mesaĝon
{name} stelumis vian mesaĝon
%s eksekvis vin
@@ -286,6 +287,7 @@
Notify when someone favourites your status
Notify when someone mentions you
Notify when a poll ended
+ Notify for new posts
Show confirmation dialog before boosting
Show confirmation dialog before adding to favourites
Notify in WIFI only
@@ -519,6 +521,7 @@
Voĉdonado Finiĝis
Nova Hup
Toots Backup
+ New posts
Media Download
Change notification sound
Elekti Tono
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index c2a2ec6eb..1b258ebef 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -216,6 +216,7 @@
Ninguna notificación para mostrar
te mencionó
+ wrote a new message
impulsó tu estado
marcó como favorito tu estado
te siguió
@@ -286,6 +287,7 @@
Notificar cuando alguien agrega a favoritos tu estado
Notificar cuando alguien te mencione
Notificar cuando termine una encuesta
+ Notify for new posts
Mostrar diálogo de confirmación antes de impulsar
Mostrar diálogo de confirmación antes de agregar a favoritos
Notificaciones en WI-FI solamente
@@ -514,6 +516,7 @@ https://yandex.ru/legal/confidential/?lang=en
Encuesta Terminada
Nuevo Toot
Respaldo de toots
+ New posts
Descargar contenido multimedia
Modificar la notificación de sonido
Seleccionar tono
diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml
index b08437d36..1875fb203 100644
--- a/app/src/main/res/values-eu/strings.xml
+++ b/app/src/main/res/values-eu/strings.xml
@@ -216,6 +216,7 @@
Jakinarazpenik ez bistaratzeko
erabiltzaileak aipatu zaitu
+ wrote a new message
erabiltzaileak zure mezuari bultzada eman dio
erabiltzaileak zure mezua gogoko du
zu jarraitzen hasi da
@@ -286,6 +287,7 @@
Jakinarazi norbaitek zure mezua gogoko duenean
Jakinarazi norbaitek aipatzen zaituenean
Jakinarazi inkesta bat amaitu denean
+ Notify for new posts
Baieztatu bultzada eman aurretik
Baieztatu gogokoetara gehitu aurretik
Jakinarazi WIFI bidez besterik ez
@@ -519,6 +521,7 @@
Inkesta amaituta
Toot berria
Toot-en babes-kopia
+ New posts
Multimediaren deskarga
Aldatu jakinarazpen-soinua
Hautatu doinua
diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml
index f6ec78326..6cbff0c2c 100644
--- a/app/src/main/res/values-fa/strings.xml
+++ b/app/src/main/res/values-fa/strings.xml
@@ -216,6 +216,7 @@
No notification to display
mentioned you
+ wrote a new message
boosted your status
favourited your status
followed you
@@ -286,6 +287,7 @@
Notify when someone favourites your status
Notify when someone mentions you
Notify when a poll ended
+ Notify for new posts
Show confirmation dialog before boosting
Show confirmation dialog before adding to favourites
Notify in WIFI only
@@ -519,6 +521,7 @@
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 86321f300..1f9347a95 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -216,6 +216,7 @@
Aucune notification à afficher
vous a mentionné
+ wrote a new message
a partagé votre pouet
a ajouté votre pouet à ses favoris
vous suit
@@ -286,6 +287,7 @@
Notifier lorsque quelqu’un ajoute mes pouets à ses favoris
Notifier lorsque quelqu’un me mentionne
Me notifier lorsqu’un sondage est terminé
+ Notify for new posts
Confirmer avant de partager
Confirmer avant d’ajouter aux favoris
Notifier en WIFI seulement
@@ -517,6 +519,7 @@
Sondage terminé
Nouveau pouet
Sauvegarde des Pouets
+ New posts
Téléchargement des Médias
Changer le son des notifications
Choisir une sonnerie
diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml
index 901ccb834..eed890aee 100644
--- a/app/src/main/res/values-gl/strings.xml
+++ b/app/src/main/res/values-gl/strings.xml
@@ -216,6 +216,7 @@
Sen notificación que mostrar
mencionouna
+ wrote a new message
promoveu o seu estado
favoreceu o seu estado
segueuna
@@ -286,6 +287,7 @@
Notificar cando alguén favorece un dos seus estados
Notificar cando alguén a menciona
Notificar cando remate unha sondaxe
+ Notify for new posts
Solicitar confirmación antes de promover
Solicitar confirmación antes de engadir a favoritos
Notificar só cando WiFi
@@ -519,6 +521,7 @@
Rematou a sondaxe
Novo Toot
Respaldo de Toots
+ New posts
Descarga de medios
Cambiar o tono de notificación
Escoller Tono
diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml
index 203f10ca7..8bd4dd36c 100644
--- a/app/src/main/res/values-hi/strings.xml
+++ b/app/src/main/res/values-hi/strings.xml
@@ -216,6 +216,7 @@
कोई सूचना मौजूद नहीं है
आपका उल्लेख किया
+ wrote a new message
आपका लेख बूस्ट किया
आपका लेख पसंद किया
आपका अनुसरण किया
@@ -286,6 +287,7 @@
आपके लेख पसंद होने पर सूचित करें
आपका उल्लेख होने पर सूचित करें
Notify when a poll ended
+ Notify for new posts
बूस्ट करने से पहले पूछें
पसंद करने से पहले पूछें
केवल वाईफ़ाई पे सूचित करें
@@ -512,6 +514,7 @@
चुनाव समाप्त हो गया
नया लेख
लेखों का बैकअप
+ New posts
मीडिया डाउंलोड
सूचना संगीत को बदलें
टोन चुनें
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index f4bf1add1..2314c6e5d 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -216,6 +216,7 @@
Nincs megjelenítendő értesítés
megemlített téged
+ wrote a new message
megismételte posztodat
lájkolta a posztodat
követett téged
@@ -286,6 +287,7 @@
Értesíts, ha valaki lájkolja a posztodat
Értesíts, amikor valaki megemlít téged
Értesíts, amikor egy szavazás végetér
+ Notify for new posts
Kérdezz vissza újratootolás előtt
Megerősítés kérése kedvencekhez hozzáadás előtt
Értesítés csak WiFi használatakor
@@ -517,6 +519,7 @@ A Yandexnek megvan a saját adatvédelmi szabályzata, ami itt található: http
A szavazás véget ért
Új toot
Tootok elmentése
+ New posts
Média letöltése
Értesítési hang megváltoztatása
Hang kiválasztása
diff --git a/app/src/main/res/values-hy/strings.xml b/app/src/main/res/values-hy/strings.xml
index f44e53f74..e99f11e33 100644
--- a/app/src/main/res/values-hy/strings.xml
+++ b/app/src/main/res/values-hy/strings.xml
@@ -216,6 +216,7 @@
Ծանուցում չկա
-ը հիշատակել է քեզ
+ wrote a new message
-ը խրախուսել է քո թութը
-ը գրառումդ ավելացրել է նախընտրումներին
-ը հետևում է քեզ
@@ -286,6 +287,7 @@
Տեղեկացնել, երբ որևէ մեկը հավանում է թութդ
Տեղեկացնել, երբ որևէ մեկը նշում է քեզ
Notify when a poll ended
+ Notify for new posts
Ցուցադրել հաստատման պատուհանը տարածելուց առաջ
Ցուցադրել հաստատման պատուհանը հավանածներին ավելացնելուց առաջ
Ծանուցել միայն WIFI-ին կպած
@@ -518,6 +520,7 @@
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-id/strings.xml b/app/src/main/res/values-id/strings.xml
index a6f9c1b93..2c10e7436 100644
--- a/app/src/main/res/values-id/strings.xml
+++ b/app/src/main/res/values-id/strings.xml
@@ -212,6 +212,7 @@
Tidak ada pemberitahuan untuk ditampilkan
menyebutmu
+ wrote a new message
tingkatkan status Kamu
status kesukaan Kamu
mengikutimu
@@ -280,6 +281,7 @@
Beritahu ketika seseorang menyukai status Anda
Beritahu ketika seseorang menyebut Anda
Beritahu ketika pemilihan berakhir
+ Notify for new posts
Tampilkan dialog konfirmasi sebelum meningkatkan
Tampilkan dialog konfirmasi sebelum menambahkan ke favorit
Beritahu hanya di WIFI
@@ -515,6 +517,7 @@ https://yandex.ru/legal/confidential/?lang=en
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 90a12a496..2d1b98d38 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -216,6 +216,7 @@
Nessuna notifica da visualizzare
ti ha menzionato
+ wrote a new message
ha ricondiviso il tuo stato
ha messo tra i preferiti il tuo stato
ti segue
@@ -286,6 +287,7 @@
Notifica quando qualcuno mette tra i preferiti il tuo stato
Notifica quando qualcuno ti menziona
Notifica quando termina un sondaggio
+ Notify for new posts
Mostra finestra di dialogo prima della ricondivisione
Mostra finestra di dialogo prima di aggiungere ai preferiti
Notifica solo in WIFI
@@ -519,6 +521,7 @@
Sondaggio terminato
Un nuovo toot
Backup dei toot
+ New posts
Scarica i media
Cambia il suono di notifica
Seleziona tono
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 810549eec..00cc800a1 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -212,6 +212,7 @@
通知はありません
にメンションされました
+ wrote a new message
がブーストしました
がお気に入りに登録しました
があなたをフォローしました
@@ -280,6 +281,7 @@
トゥートがお気に入りに追加されたときに通知する
メンションを受け取ったときに通知する
投票が終了したら通知する
+ Notify for new posts
ブースト前に確認ダイアログを表示する
お気に入りに追加する前に確認ダイアログを表示する
WIFI接続時のみ通知
@@ -507,6 +509,7 @@
投票終了
新しいトゥート
トゥート バックアップ
+ New posts
メディアのダウンロード
通知サウンドを変更
音の選択
diff --git a/app/src/main/res/values-kab/strings.xml b/app/src/main/res/values-kab/strings.xml
index b4fac2dab..4cdbaa019 100644
--- a/app/src/main/res/values-kab/strings.xml
+++ b/app/src/main/res/values-kab/strings.xml
@@ -216,6 +216,7 @@
No notification to display
yuder-ik id
+ wrote a new message
boosted your status
favourited your status
i ḍferek id
@@ -286,6 +287,7 @@
Notify when someone favourites your status
Notify when someone mentions you
Notify when a poll ended
+ Notify for new posts
Show confirmation dialog before boosting
Show confirmation dialog before adding to favourites
Notify in WIFI only
@@ -519,6 +521,7 @@
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index 8889a5a5b..2b01e6283 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -212,6 +212,7 @@
표시할 알림이 없습니다
당신을 언급했습니다
+ wrote a new message
당신의 게시물을 부스트 했습니다
당신의 상태를 마음에 들어했습니다
당신을 팔로우 했습니다
@@ -280,6 +281,7 @@
누군가 내 게시물을 마음에 들어 할 때 알림
누군가 나를 언급할 때 알림
투표가 끝나면 알림
+ Notify for new posts
부스트 하기 전에 확인창 표시
Show confirmation dialog before adding to favourites
Wi-Fi에 연결 되었을 때만 알림
@@ -513,6 +515,7 @@
투표 종료
새 툿
툿 백업
+ New posts
미디어 다운로드
알림음 변경
Select Tone
diff --git a/app/src/main/res/values-ml/strings.xml b/app/src/main/res/values-ml/strings.xml
index 1bc70855e..fc52acdc8 100644
--- a/app/src/main/res/values-ml/strings.xml
+++ b/app/src/main/res/values-ml/strings.xml
@@ -216,6 +216,7 @@
പ്രദർശിപ്പിക്കാൻ അറിയിപ്പുകൾ ഇല്ല
താങ്കളെ പ്രതിപാദിച്ചിരിക്കുന്നു
+ wrote a new message
തങ്ങളുടെ സ്റ്റാറ്റസ് ബൂസ്റ്റ് ചെയ്യപ്പെട്ടിരിക്കുന്നു
താങ്കളുടെ സ്റ്റാറ്റസ് പ്രിയപെട്ടവയിൽ ചേർത്തിരിക്കുന്നു
നിങ്ങളെ പിന്തുടരുന്നു
@@ -286,6 +287,7 @@
ആരെങ്കിലും നിങ്ങളുടെ സ്റ്റാറ്റസ് പ്രിയപ്പെട്ടതാക്കിയാൽ അറിയിക്കുക
ആരെങ്കിലും നിങ്ങളെ പരാമർശിച്ചാൽ അറിയിക്കുക
വോട്ടെടുപ്പു് അവസാനിച്ചാൽ അറിയിക്കുക
+ Notify for new posts
ബൂസ്റ്റുചെയ്യുന്നതിനു് മുന്പു് സ്ഥിരീകരിയ്ക്കുക
പ്രിയങ്കരങ്ങളിലേക്ക് ചേർക്കുന്നതിന് മുമ്പ് സ്ഥിരീകരണ ഡയലോഗ് കാണിക്കുക
വൈഫൈയിൽ മാത്രം അറിയിപ്പുകള് കാണിയ്ക്കുക
@@ -519,6 +521,7 @@
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index 2c357615c..b043050da 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -216,6 +216,7 @@
Je hebt nog geen meldingen
vermeldde jou
+ wrote a new message
boostte jouw toot
markeerde jouw toot als favoriet
volgt jou nu
@@ -286,6 +287,7 @@
Geef een melding wanneer jouw toot als favoriet is gemarkeerd
Geef een melding wanneer iemand jou vermeldt
Geef een melding wanneer een poll is beëindigd
+ Notify for new posts
Vraag voor het boosten een bevestiging
Vraag voor het markeren als favoriet een bevestiging
Alleen met Wifi meldingen tonen
@@ -519,6 +521,7 @@
Poll is beëindigd
Nieuwe toot
Toots back-uppen
+ New posts
Media downloaden
Meldingsgeluid veranderen
Selecteer toon
diff --git a/app/src/main/res/values-no/strings.xml b/app/src/main/res/values-no/strings.xml
index 8900d0d7a..ff3d7affc 100644
--- a/app/src/main/res/values-no/strings.xml
+++ b/app/src/main/res/values-no/strings.xml
@@ -216,6 +216,7 @@
Ingen varslinger for å vise
nevnte deg
+ wrote a new message
boostet tootet ditt
favoriserte tootet ditt
fulgte deg
@@ -286,6 +287,7 @@
Varsle når noen favoriserer tootene dine
Varsle når noen nevner deg
Varsle når en avstemming er avsluttet
+ Notify for new posts
Vis bekreftelsesdialog før du booster
Vis bekreftelsesdialog før du legger til i favoritter
Varsle kun på WIFI
@@ -511,6 +513,7 @@ Du kan aktivere eller deaktivere disse meldingene senere i innstillingene (Meldi
Avstemming avsluttet
Ny toot
Backup av toots
+ New posts
Last ned media
Endre varsellyd
Velg varsellyd
diff --git a/app/src/main/res/values-oc/strings.xml b/app/src/main/res/values-oc/strings.xml
index 51042a0b1..d463b31db 100644
--- a/app/src/main/res/values-oc/strings.xml
+++ b/app/src/main/res/values-oc/strings.xml
@@ -216,6 +216,7 @@
No notification to display
mentioned you
+ wrote a new message
boosted your status
favourited your status
followed you
@@ -286,6 +287,7 @@
Notify when someone favourites your status
Notify when someone mentions you
Notify when a poll ended
+ Notify for new posts
Show confirmation dialog before boosting
Show confirmation dialog before adding to favourites
Notify in WIFI only
@@ -519,6 +521,7 @@
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 8fe786460..1435945d1 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -224,6 +224,7 @@
Brak powiadomień do wyświetlenia
wspomniał o tobie
+ wrote a new message
podbił twój wpis
dodał(a) Twój wpis do ulubionych
zaczął(-ęła) Cię śledzić
@@ -298,6 +299,7 @@
Powiadom mnie, gdy ktoś polubi mój wpis
Powiadom mnie, gdy ktoś mnie wspomni
Powiadom kiedy głosowanie zostanie zakończone
+ Notify for new posts
Proś o potwierdzenie przed podbiciem
Proś o potwierdzenie przed dodaniem wpisu do ulubionych
Powiadamiaj tylko w sieci WiFi
@@ -529,6 +531,7 @@
Głosowanie zakończone
Nowy Wpis
Kopia zapasowa wpisów
+ New posts
Pobrane Media
Zmień dźwięk powiadomień
Wybierz Dźwięk
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 7afbbd24b..fecdf65cd 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -216,6 +216,7 @@
Sem notificações
te mencionou
+ wrote a new message
deu boost no seu toot
favoritou seu toot
te seguiu
@@ -286,6 +287,7 @@
Notificar quando alguém favoritar seus toots
Notificar quando alguém te mencionar
Notificar quando uma sondagem terminar
+ Notify for new posts
Mostrar diálogo antes de dar boost
Mostrar diálogo antes de favoritar
Notificar somente em Wi-Fi
@@ -519,6 +521,7 @@
Sondagem terminada
Novo toot
Backup de Toots
+ New posts
Baixar mídia
Alterar som de notificação
Selecionar toque
diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml
index d897d5b20..ab6248538 100644
--- a/app/src/main/res/values-ro/strings.xml
+++ b/app/src/main/res/values-ro/strings.xml
@@ -220,6 +220,7 @@
Nici o notificare de afişat
ai fost menționat
+ wrote a new message
a amplificat statusul tău
a favorizat statusul tău
vă urmărește
@@ -292,6 +293,7 @@
Notifica atunci când cineva favorizează statusul tău
Notifică atunci când cineva vă menţionează
Notify when a poll ended
+ Notify for new posts
Arată caseta de confirmare înainte de amplificare
Arată caseta de confirmare înainte de a adăuga la favorite
Notifică doar în WIFI
@@ -523,6 +525,7 @@ Aceste date sunt strict confidențiale și pot fi folosite doar de aplicație.
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index a2e5bb9af..651e29996 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -224,6 +224,7 @@
Нет уведомлений для отображения
упомянул(а) вас
+ wrote a new message
ваш статус продвинут
добавил ваш статус в избранные
подписался на вас
@@ -298,6 +299,7 @@
Уведомлять, если кто-то добавил ваш статус в избранное
Уведомлять, когда кто-то вас упоминает
Уведомлять об окончании опроса
+ Notify for new posts
Предупреждать перед тем как продвинуть
Предупреждать перед добавлением в избранные
Уведомлять только в сети WIFI
@@ -531,6 +533,7 @@
Опрос закончен
Новый тут
Резервирование тутов
+ New posts
Загрузка медиа
Изменить звук уведомления
Выбрать сигнал
diff --git a/app/src/main/res/values-sc/strings.xml b/app/src/main/res/values-sc/strings.xml
index f10704ec4..29822981d 100644
--- a/app/src/main/res/values-sc/strings.xml
+++ b/app/src/main/res/values-sc/strings.xml
@@ -216,6 +216,7 @@
Peruna notìfica de ammustrare
t\'at mentovadu
+ wrote a new message
at cumpartzidu s\'istadu tuo
at agiuntu s\'istadu tuo a is preferidos suos
at comintzadu a ti sighire
@@ -286,6 +287,7 @@
Notìfica cando calicunu ponet s\'istadu tuo in is preferidos suos
Notìfica cando calicunu ti mentovat
Notìfica cando acabat unu sondàgiu
+ Notify for new posts
Ammustra una ventanedda de diàlogu de cunfirma in antis de cumpartzire
Ammustra una ventanedda de diàlogu de cunfirma in antis de agiùnghere a is preferidos
Notìfica sceti cun su WIFI
@@ -490,6 +492,7 @@
Sondàgiu acabadu
Tut nou
Còpia de seguresa de is tuts
+ New posts
Iscàrriga is mèdios
Càmbia su sonu de notìfica
Seletziona sa soneria
diff --git a/app/src/main/res/values-si/strings.xml b/app/src/main/res/values-si/strings.xml
index 68cb0cce5..e610a2635 100644
--- a/app/src/main/res/values-si/strings.xml
+++ b/app/src/main/res/values-si/strings.xml
@@ -216,6 +216,7 @@
පෙන්වීමට දැනුම්දීම් නැත
ඔබව සඳහන් කළා
+ wrote a new message
boosted your status
favourited your status
followed you
@@ -286,6 +287,7 @@
Notify when someone favourites your status
Notify when someone mentions you
Notify when a poll ended
+ Notify for new posts
Show confirmation dialog before boosting
Show confirmation dialog before adding to favourites
Notify in WIFI only
@@ -519,6 +521,7 @@
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
ගීත කණ්ඩය තෝරාගන්න
diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml
index d08d355d5..946744b31 100644
--- a/app/src/main/res/values-sl/strings.xml
+++ b/app/src/main/res/values-sl/strings.xml
@@ -224,6 +224,7 @@
Ni obvestil za prikaz
vas omenja
+ wrote a new message
je ojačal tvoj status
je všeč tvoja objava
spremlja vas
@@ -298,6 +299,7 @@
Obveščaj me, ko kdo moj status doda med priljubljene
Obveščaj me, ko me kdo omeni
Notify when a poll ended
+ Notify for new posts
Vprašaj me za potrditev preden ojačam
Pred dodajanjem med priljubljene me vprašaj za potrditev
Obveščanj le v omrežju WiFi
@@ -531,6 +533,7 @@
Poll Ended
Nova objava Toot
Arhivirani Tooti
+ New posts
Prenos vsebine
Spremeni zvok ob obvestilih
Izberite zvok
diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml
index 022c1554f..6b574837f 100644
--- a/app/src/main/res/values-sr/strings.xml
+++ b/app/src/main/res/values-sr/strings.xml
@@ -220,6 +220,7 @@
Нема обавештења за приказ
Вас је поменуо
+ wrote a new message
је подржао Ваш статус
је ставио Ваш статус као омиљени
Вас је запратио
@@ -292,6 +293,7 @@
Обавести када неко стави да му је Ваш статус омиљен
Обавести када Вас неко помене
Notify when a poll ended
+ Notify for new posts
Прикажи потврду пре давања подршке некоме
Прикажи дијалог за потврду пре додавања у омиљене
Обавештавај само на бежичној мрежи
@@ -525,6 +527,7 @@
Poll Ended
Нови тут
Резервне копије тутова
+ New posts
Преузимање мултимедије
Промени звук обавештења
Изаберите тон
diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml
index 3bff114ea..16e023810 100644
--- a/app/src/main/res/values-sv/strings.xml
+++ b/app/src/main/res/values-sv/strings.xml
@@ -216,6 +216,7 @@
Ingen anmälan att Visa
nämnde dig
+ wrote a new message
ökat din status
favourited din status
följt dig
@@ -286,6 +287,7 @@
Meddela när någon favoriter din status
Meddela när någon nämner dig
Meddela när en röstning slutar
+ Notify for new posts
Visa en bekräftelsedialogruta före boostning
Visa bekräftelsedialogrutan innan du lägger till favoriter
Notifiera endast över WIFI
@@ -519,6 +521,7 @@
Röstning avslutad
Ny Toot
Backup av Toot
+ New posts
Ladda ner media
Ändra notifieringsljud
Välj ton
diff --git a/app/src/main/res/values-szl/strings.xml b/app/src/main/res/values-szl/strings.xml
index e79d7ae7a..bb03e6017 100644
--- a/app/src/main/res/values-szl/strings.xml
+++ b/app/src/main/res/values-szl/strings.xml
@@ -224,6 +224,7 @@
Żodnych powiadōmiyń do pokozanio
spōmino cie
+ wrote a new message
rozgłoszo twōj status
lubi twōj status
śledzi cie
@@ -298,6 +299,7 @@
Powiadōm, jak ftoś lubi mōj status
Powiadōm, jak ftoś mie spōmino
Powiadōm, jak anketa sie skōńczy
+ Notify for new posts
Pytej ô potwiyrdzynie przed rozgłoszyniym
Pytej ô potwiyrdzynie przed polubiyniym
Powiadōm ino przi Wifi
@@ -531,6 +533,7 @@
Anketa skōńczōno
Nowy tut
Kopijo ibryczno tutōw
+ New posts
Ściōnganie mediōw
Zmiyń klang powiadōmiyń
Wybier tōn
@@ -1137,6 +1140,6 @@
Przidej reakcyjo
Użyj swojij preferowanyj przeglōndarki we aplikacyji. Ôdznacz ta funkcyjo, żeby ôtwiyrać linki zewnyntrznie.
Cache wideo we MB, zero znaczy brak cache.
- Watermarks
- Automatically add a watermark at the bottom of pictures. The text can be customized for each account.
+ Znaki wodne
+ Dodej autōmatycznie znak wodny na spodku ôbrozkōw. Inkszy tekst może być nasztalowany do kożdego kōnta.
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index 08e9f719c..8a7add7cb 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -216,6 +216,7 @@
Görüntülenecek bildirim yok
senden bahsetti
+ wrote a new message
durumunu arttırdı
durumunu favorilere ekledi
seni takip etti
@@ -286,6 +287,7 @@
Biri durumunuzu favorilere eklerse bildir
Biri kullanıcıyı takip ettiğinde bildir
Bir anket sona erdiğinde bildir
+ Notify for new posts
Toot arttırmadan önce onay kutusu göster
Favorilere eklemeden önce onay kutusu göster
Sadece Wi-Fi bağlı iken bildirimleri aç
@@ -513,6 +515,7 @@
Anket Sona Erdi
Yeni Toot
Toot Yedekleme
+ New posts
Medya İndirme
Bildirim sesini değiştir
Ton Seçin
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index e888fe619..1494e4791 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -224,6 +224,7 @@
Немає сповіщень для показу
згадав вас
+ wrote a new message
передмухнув ваш статус
додав до обраного ваш статус
підписався(-лась) на вас
@@ -298,6 +299,7 @@
Сповіщати, якщо хтось додав статус до обраного
Сповіщати, якщо хтось згадує вас
Notify when a poll ended
+ Notify for new posts
Показати діалогове вікно підтвердження перед тим, як передмухнути
Показати діалогове вікно підтвердження перед тим, як додати до обраного
Повідомити тільки при Wi-Fi
@@ -521,6 +523,7 @@
Poll Ended
Новий гудок
Toots Backup
+ New posts
Медіа завантаження
Змінити звук сповіщення
Оберіть сигнал
diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml
index 006a02374..e13158ff5 100644
--- a/app/src/main/res/values-vi/strings.xml
+++ b/app/src/main/res/values-vi/strings.xml
@@ -212,6 +212,7 @@
Không có thông báo để hiển thị
đề cập đến bạn
+ wrote a new message
đẩy mạnh tình trạng của bạn
ưu đãi tình trạng của bạn
đã theo bạn
@@ -281,6 +282,7 @@ và %d thông báo khác
Thông báo khi ai đó yêu thích trạng thái của bạn
Thông báo khi ai đó đề cập đến bạn
Notify when a poll ended
+ Notify for new posts
Hiển thị hộp thoại xác nhận trước khi tăng
Hiển thị hộp thoại xác nhận trước khi thêm vào mục yêu thích
Chỉ thông báo bằng WIFI
@@ -510,6 +512,7 @@ và %d thông báo khác
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index de4032cef..4155a9225 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -212,6 +212,7 @@
没有通知可以显示
提及了您
+ wrote a new message
转嘟了您的状态
收藏了您的状态
关注了您
@@ -280,6 +281,7 @@
当某人收藏您的状态时通知
当有人提到您时通知
当投票结束发出通知
+ Notify for new posts
转嘟前显示确认对话框
添加到收藏夹前显示确认对话框
仅当使用 WiFi 时通知
@@ -513,6 +515,7 @@
投票已结束
新的嘟文
嘟文备份
+ New posts
媒体下载
更改通知提示音
选择铃声
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index e8fea18fa..ed0902f29 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -212,6 +212,7 @@
沒有通知
提及您
+ wrote a new message
已轉嘟您的嘟文
將您的嘟文加到最愛
關注了您
@@ -280,6 +281,7 @@
當有人收藏您的嘟文時通知您
當有人提及您時通知
投票結束時通知
+ Notify for new posts
在轉嘟前顯示確認對話框
在新增至最愛前顯示確認對話框
僅在使用 Wi-Fi 時才啟用通知
@@ -513,6 +515,7 @@ Yandex 有適當的隱私權政策,可以在這裡找到:https://yandex.ru/l
投票結束
新嘟文
嘟文備份
+ New posts
媒體下載
變更通知音效
選取鈴聲
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index baed21543..ceb07e1d1 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -236,6 +236,7 @@
No notification to display
mentioned you
+ wrote a new message
boosted your status
favourited your status
followed you
@@ -306,6 +307,7 @@
Notify when someone favourites your status
Notify when someone mentions you
Notify when a poll ended
+ Notify for new posts
Show confirmation dialog before boosting
Show confirmation dialog before adding to favourites
Notify in WIFI only
@@ -589,6 +591,7 @@
Poll Ended
New Toot
Toots Backup
+ New posts
Media Download
Change notification sound
Select Tone
diff --git a/src/fdroid/fastlane/metadata/android/ar/full_description.txt b/src/fdroid/fastlane/metadata/android/ar/full_description.txt
index 68ef278ac..e1a0972b1 100644
--- a/src/fdroid/fastlane/metadata/android/ar/full_description.txt
+++ b/src/fdroid/fastlane/metadata/android/ar/full_description.txt
@@ -7,7 +7,7 @@
- يدعم الحسابات المتعددة
- برمجة الرسائل من خلال الجهاز
- برمجة الترقيات والمشاركات
-- إضافة المنشورات إلى الفواصل المرجعية
+- خطوط للفيديوهات
- المتابعة والتفاعل مع الخوادم البعيدة
- ميزة للكتم المؤقت للحسابات
- إجراءات ما بين الحسابات بواسطة الضغط المطوّل
diff --git a/src/fdroid/fastlane/metadata/android/ca/full_description.txt b/src/fdroid/fastlane/metadata/android/ca/full_description.txt
index 7bca00395..77a1d5b21 100644
--- a/src/fdroid/fastlane/metadata/android/ca/full_description.txt
+++ b/src/fdroid/fastlane/metadata/android/ca/full_description.txt
@@ -10,7 +10,7 @@ L'aplicació té funcionalitats avançades (sobretot per a Pleroma i Mastodont):
- Marcar missatges
- Seguir i interactuar amb instàncies remotes
- Silenciar comptes temporalment
-- Executar accions entre els comptes amb pitjada llarga
+- Determinar el compte d'una acció fent una pitjada llarga
- Funcionalitat de traducció
- Pissarres amb Art
- Pissarres de vídeo
diff --git a/src/fdroid/fastlane/metadata/android/ca/short_description.txt b/src/fdroid/fastlane/metadata/android/ca/short_description.txt
index bc6f0a9cb..66b585ebb 100644
--- a/src/fdroid/fastlane/metadata/android/ca/short_description.txt
+++ b/src/fdroid/fastlane/metadata/android/ca/short_description.txt
@@ -1 +1 @@
-Fedilab és un client Android muntifuncional per a l'accés al Fedivers distribuït, permet el microblogging, compartir fotos i allotjament de videos.
+Fedilab és un client Android muntifuncional per a l'accés al Fedivers distribuït, permet el microblogging, compartir fotos i allotjar videos.
diff --git a/src/fdroid/fastlane/metadata/android/en-US/changelogs/380.txt b/src/fdroid/fastlane/metadata/android/en-US/changelogs/380.txt
new file mode 100644
index 000000000..79a8c8a35
--- /dev/null
+++ b/src/fdroid/fastlane/metadata/android/en-US/changelogs/380.txt
@@ -0,0 +1,6 @@
+Added:
+- notify when a followed user posts (subscribe by clicking the bell icon on profiles).
+
+Fixed:
+- Crash when importing media due to photo editor
+- Some crashes when doing actions
\ No newline at end of file
diff --git a/src/fdroid/fastlane/metadata/android/eo/short_description.txt b/src/fdroid/fastlane/metadata/android/eo/short_description.txt
index b5458a109..a48c21b4e 100644
--- a/src/fdroid/fastlane/metadata/android/eo/short_description.txt
+++ b/src/fdroid/fastlane/metadata/android/eo/short_description.txt
@@ -1 +1 @@
-Fedilab is a multifunctional Android client to access the distributed Fediverse, consisting of micro blogging, photo sharing and video hosting.
+Fedilab estas multfunkcia klienta de Androido aliri la distribuita Fediverse, konsistanta mikraj blogoj, foto dividanta kaj video gastigado.
diff --git a/src/fdroid/fastlane/metadata/android/pt/short_description.txt b/src/fdroid/fastlane/metadata/android/pt/short_description.txt
index b5458a109..844600d24 100644
--- a/src/fdroid/fastlane/metadata/android/pt/short_description.txt
+++ b/src/fdroid/fastlane/metadata/android/pt/short_description.txt
@@ -1 +1 @@
-Fedilab is a multifunctional Android client to access the distributed Fediverse, consisting of micro blogging, photo sharing and video hosting.
+Fedilab é um cliente Android multifuncional para aceder o distribuído Fediverse, composto por microblogging, compartilha de fotos e hospedagem de vídeos.
diff --git a/src/fdroid/fastlane/metadata/android/tr/short_description.txt b/src/fdroid/fastlane/metadata/android/tr/short_description.txt
index b5458a109..549e3b703 100644
--- a/src/fdroid/fastlane/metadata/android/tr/short_description.txt
+++ b/src/fdroid/fastlane/metadata/android/tr/short_description.txt
@@ -1 +1 @@
-Fedilab is a multifunctional Android client to access the distributed Fediverse, consisting of micro blogging, photo sharing and video hosting.
+Fedilab, mikro blog, fotoğraf paylaşımı ve video barındırma içeren dağıtılmış Fediverse'e erişmek için çok işlevli bir Android istemcisidir.
diff --git a/src/lite/fastlane/metadata/android/en-US/changelogs/380.txt b/src/lite/fastlane/metadata/android/en-US/changelogs/380.txt
new file mode 100644
index 000000000..79a8c8a35
--- /dev/null
+++ b/src/lite/fastlane/metadata/android/en-US/changelogs/380.txt
@@ -0,0 +1,6 @@
+Added:
+- notify when a followed user posts (subscribe by clicking the bell icon on profiles).
+
+Fixed:
+- Crash when importing media due to photo editor
+- Some crashes when doing actions
\ No newline at end of file