Skip to content

Commit

Permalink
imgur migration notice
Browse files Browse the repository at this point in the history
  • Loading branch information
c99koder committed Jul 15, 2024
1 parent b6f7608 commit 330313a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/com/irccloud/android/IRCCloudApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public synchronized void onReceive(Context context, Intent intent) {
editor.remove("imgur_refresh_token");
editor.remove("imgur_token_type");
editor.remove("imgur_expires_in");
editor.putBoolean("imgur_removed", true);
editor.apply();
}

Expand Down
19 changes: 19 additions & 0 deletions src/com/irccloud/android/activity/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
import com.irccloud.android.IRCEditText;
import com.irccloud.android.NetworkConnection;
import com.irccloud.android.R;
import com.irccloud.android.data.IRCCloudDatabase;
import com.irccloud.android.data.collection.AvatarsList;
import com.irccloud.android.data.collection.BuffersList;
import com.irccloud.android.data.collection.ChannelsList;
Expand Down Expand Up @@ -2231,6 +2232,24 @@ public void onSuccess(@NonNull String s) {
sendBtn.setEnabled(conn.getState() == NetworkConnection.STATE_CONNECTED && messageTxt.getText().length() > 0);
photoBtn.setVisibility(bubble ? View.GONE : View.VISIBLE);
IRCCloudLinkMovementMethod.bubble = bubble;

if(prefs.getBoolean("imgur_removed", false)) {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("Imgur Uploading Unavailable");
builder.setMessage("Uploading images to imgur is no longer available due to limitations in imgur's API.\n\nNew images will be stored on IRCCloud, and your existing images will remain available on imgur.\n\nImages from imgur can still be shared by using the 'share' button in an external application.");
builder.setNegativeButton("Close", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
SharedPreferences.Editor editor = prefs.edit();
editor.remove("imgur_removed");
editor.apply();
dialogInterface.dismiss();
}
});
AlertDialog d = builder.create();
d.setOwnerActivity(MainActivity.this);
d.show();
}
}

CustomTabsServiceConnection mCustomTabsConnection = new CustomTabsServiceConnection() {
Expand Down

0 comments on commit 330313a

Please sign in to comment.