Fixed wrong conversation opened when clicking on notification if there are more than one
This commit is contained in:
parent
8a811e9597
commit
91c1230eef
1 changed files with 28 additions and 18 deletions
|
@ -87,7 +87,7 @@ public class NotificationsManager {
|
||||||
|
|
||||||
PendingIntent pendingIntent =
|
PendingIntent pendingIntent =
|
||||||
PendingIntent.getActivity(
|
PendingIntent.getActivity(
|
||||||
mContext, 0, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
mContext, SERVICE_NOTIF_ID, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
mServiceNotification =
|
mServiceNotification =
|
||||||
Compatibility.createNotification(
|
Compatibility.createNotification(
|
||||||
mContext,
|
mContext,
|
||||||
|
@ -151,13 +151,6 @@ public class NotificationsManager {
|
||||||
long timestamp,
|
long timestamp,
|
||||||
Uri filePath,
|
Uri filePath,
|
||||||
String fileMime) {
|
String fileMime) {
|
||||||
Intent notifIntent = new Intent(mContext, LinphoneActivity.class);
|
|
||||||
notifIntent.putExtra("GoToChat", true);
|
|
||||||
notifIntent.putExtra("ChatContactSipUri", conferenceAddress);
|
|
||||||
notifIntent.putExtra("LocalSipUri", localIdentity.asStringUriOnly());
|
|
||||||
PendingIntent pendingIntent =
|
|
||||||
PendingIntent.getActivity(
|
|
||||||
mContext, 0, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
||||||
|
|
||||||
Bitmap bm = ImageUtils.getRoundBitmapFromUri(mContext, fromPictureUri);
|
Bitmap bm = ImageUtils.getRoundBitmapFromUri(mContext, fromPictureUri);
|
||||||
Notifiable notif = mChatNotifMap.get(conferenceAddress);
|
Notifiable notif = mChatNotifMap.get(conferenceAddress);
|
||||||
|
@ -176,6 +169,17 @@ public class NotificationsManager {
|
||||||
notif.setMyself(LinphoneUtils.getAddressDisplayName(localIdentity));
|
notif.setMyself(LinphoneUtils.getAddressDisplayName(localIdentity));
|
||||||
notif.setLocalIdentity(localIdentity.asString());
|
notif.setLocalIdentity(localIdentity.asString());
|
||||||
|
|
||||||
|
Intent notifIntent = new Intent(mContext, LinphoneActivity.class);
|
||||||
|
notifIntent.putExtra("GoToChat", true);
|
||||||
|
notifIntent.putExtra("ChatContactSipUri", conferenceAddress);
|
||||||
|
notifIntent.putExtra("LocalSipUri", localIdentity.asStringUriOnly());
|
||||||
|
PendingIntent pendingIntent =
|
||||||
|
PendingIntent.getActivity(
|
||||||
|
mContext,
|
||||||
|
notif.getNotificationId(),
|
||||||
|
notifIntent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|
||||||
Notification notification =
|
Notification notification =
|
||||||
Compatibility.createMessageNotification(
|
Compatibility.createMessageNotification(
|
||||||
mContext,
|
mContext,
|
||||||
|
@ -198,14 +202,6 @@ public class NotificationsManager {
|
||||||
long timestamp,
|
long timestamp,
|
||||||
Uri filePath,
|
Uri filePath,
|
||||||
String fileMime) {
|
String fileMime) {
|
||||||
Intent notifIntent = new Intent(mContext, LinphoneActivity.class);
|
|
||||||
notifIntent.putExtra("GoToChat", true);
|
|
||||||
notifIntent.putExtra("ChatContactSipUri", fromSipUri);
|
|
||||||
notifIntent.putExtra("LocalSipUri", localIdentity.asStringUriOnly());
|
|
||||||
PendingIntent pendingIntent =
|
|
||||||
PendingIntent.getActivity(
|
|
||||||
mContext, 0, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
||||||
|
|
||||||
if (fromName == null) {
|
if (fromName == null) {
|
||||||
fromName = fromSipUri;
|
fromName = fromSipUri;
|
||||||
}
|
}
|
||||||
|
@ -226,6 +222,17 @@ public class NotificationsManager {
|
||||||
notif.setMyself(LinphoneUtils.getAddressDisplayName(localIdentity));
|
notif.setMyself(LinphoneUtils.getAddressDisplayName(localIdentity));
|
||||||
notif.setLocalIdentity(localIdentity.asString());
|
notif.setLocalIdentity(localIdentity.asString());
|
||||||
|
|
||||||
|
Intent notifIntent = new Intent(mContext, LinphoneActivity.class);
|
||||||
|
notifIntent.putExtra("GoToChat", true);
|
||||||
|
notifIntent.putExtra("ChatContactSipUri", fromSipUri);
|
||||||
|
notifIntent.putExtra("LocalSipUri", localIdentity.asStringUriOnly());
|
||||||
|
PendingIntent pendingIntent =
|
||||||
|
PendingIntent.getActivity(
|
||||||
|
mContext,
|
||||||
|
notif.getNotificationId(),
|
||||||
|
notifIntent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|
||||||
Notification notification =
|
Notification notification =
|
||||||
Compatibility.createMessageNotification(
|
Compatibility.createMessageNotification(
|
||||||
mContext, notif, fromName, message, bm, pendingIntent);
|
mContext, notif, fromName, message, bm, pendingIntent);
|
||||||
|
@ -237,7 +244,10 @@ public class NotificationsManager {
|
||||||
missedCallNotifIntent.putExtra("GoToHistory", true);
|
missedCallNotifIntent.putExtra("GoToHistory", true);
|
||||||
PendingIntent pendingIntent =
|
PendingIntent pendingIntent =
|
||||||
PendingIntent.getActivity(
|
PendingIntent.getActivity(
|
||||||
mContext, 0, missedCallNotifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
mContext,
|
||||||
|
MISSED_CALLS_NOTIF_ID,
|
||||||
|
missedCallNotifIntent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|
||||||
int missedCallCount =
|
int missedCallCount =
|
||||||
LinphoneManager.getLcIfManagerNotDestroyedOrNull().getMissedCallsCount();
|
LinphoneManager.getLcIfManagerNotDestroyedOrNull().getMissedCallsCount();
|
||||||
|
@ -353,7 +363,7 @@ public class NotificationsManager {
|
||||||
notifIntent.putExtra("GoToInapp", true);
|
notifIntent.putExtra("GoToInapp", true);
|
||||||
PendingIntent pendingIntent =
|
PendingIntent pendingIntent =
|
||||||
PendingIntent.getActivity(
|
PendingIntent.getActivity(
|
||||||
mContext, 0, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
mContext, IN_APP_NOTIF_ID, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
|
||||||
Notification notif =
|
Notification notif =
|
||||||
Compatibility.createSimpleNotification(
|
Compatibility.createSimpleNotification(
|
||||||
|
|
Loading…
Reference in a new issue