aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-05-10 21:02:39 +0200
committerChristian Schneppe <christian@pix-art.de>2017-05-10 21:02:39 +0200
commit16d1dacf662d2a509363ae1cea8e042a285c6f10 (patch)
tree68487193d287db29085008bae985bf8144eb07d8 /src/main/java
parentc1d2b6690ce7f2a89a477f1076be1449a414bfa6 (diff)
jump directly to account on error
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index edc93d7b7..e351bbb89 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -41,6 +41,7 @@ import de.pixart.messenger.entities.Contact;
import de.pixart.messenger.entities.Conversation;
import de.pixart.messenger.entities.Message;
import de.pixart.messenger.ui.ConversationActivity;
+import de.pixart.messenger.ui.EditAccountActivity;
import de.pixart.messenger.ui.ManageAccountActivity;
import de.pixart.messenger.ui.TimePreference;
import de.pixart.messenger.utils.GeoHelper;
@@ -747,10 +748,22 @@ public class NotificationService {
mBuilder.setDeleteIntent(createDismissErrorIntent());
mBuilder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
mBuilder.setSmallIcon(R.drawable.ic_warning_white_24dp);
- mBuilder.setContentIntent(PendingIntent.getActivity(mXmppConnectionService,
- 145,
- new Intent(mXmppConnectionService, ManageAccountActivity.class),
- PendingIntent.FLAG_UPDATE_CURRENT));
+ if (errors.size() == 1) {
+ Intent intent = new Intent(mXmppConnectionService, EditAccountActivity.class);
+ Account mAccount = mXmppConnectionService.getAccounts().get(0);
+ intent.putExtra("jid", mAccount.getJid().toBareJid().toString());
+ intent.putExtra("init", false);
+ mBuilder.setContentIntent(PendingIntent.getActivity(mXmppConnectionService,
+ 145,
+ intent,
+ PendingIntent.FLAG_UPDATE_CURRENT));
+ } else {
+ mBuilder.setContentIntent(PendingIntent.getActivity(mXmppConnectionService,
+ 145,
+ new Intent(mXmppConnectionService, ManageAccountActivity.class),
+ PendingIntent.FLAG_UPDATE_CURRENT));
+ }
+
notificationManager.notify(ERROR_NOTIFICATION_ID, mBuilder.build());
}
}