Skip to content

Commit 309a51f

Browse files
vanshikaaroradomdomegg
authored andcommitted
Fix commons-app#2659: Nomination notification links to nomination page (commons-app#2667)
1 parent a261dbb commit 309a51f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/src/main/java/fr/free/nrw/commons/delete/DeleteTask.java

+8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package fr.free.nrw.commons.delete;
22

33
import android.app.NotificationManager;
4+
import android.app.PendingIntent;
45
import android.content.Context;
6+
import android.content.Intent;
7+
import android.net.Uri;
58
import android.os.AsyncTask;
69
import androidx.core.app.NotificationCompat;
710
import androidx.core.app.NotificationCompat.Builder;
@@ -14,6 +17,7 @@
1417

1518
import javax.inject.Inject;
1619

20+
import fr.free.nrw.commons.BuildConfig;
1721
import fr.free.nrw.commons.CommonsApplication;
1822
import fr.free.nrw.commons.Media;
1923
import fr.free.nrw.commons.R;
@@ -181,6 +185,10 @@ protected void onPostExecute(Boolean result) {
181185
.setProgress(0,0,false)
182186
.setOngoing(false)
183187
.setPriority(PRIORITY_HIGH);
188+
String urlForDelete = BuildConfig.COMMONS_URL + "/wiki/Commons:Deletion_requests/File:" + media.getFilename();
189+
Intent browserIntent = new Intent(Intent.ACTION_VIEW , Uri.parse(urlForDelete));
190+
PendingIntent pendingIntent = PendingIntent.getActivity(context , 1 , browserIntent , PendingIntent.FLAG_UPDATE_CURRENT);
191+
notificationBuilder.setContentIntent(pendingIntent);
184192
notificationManager.notify(NOTIFICATION_DELETE, notificationBuilder.build());
185193
}
186194
}

0 commit comments

Comments
 (0)