From 961f0cdc33ec3fd0ad03b863e5fea22389bd86c4 Mon Sep 17 00:00:00 2001 From: stom79 Date: Sun, 12 Nov 2017 09:34:57 +0100 Subject: [PATCH] Changes names in notif --- .../mastodon/jobs/NotificationsSyncJob.java | 16 ++++++++-------- .../services/LiveNotificationService.java | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/jobs/NotificationsSyncJob.java b/app/src/main/java/fr/gouv/etalab/mastodon/jobs/NotificationsSyncJob.java index 5ede03e6f..6043fd573 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/jobs/NotificationsSyncJob.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/jobs/NotificationsSyncJob.java @@ -167,9 +167,9 @@ public class NotificationsSyncJob extends Job implements OnRetrieveNotifications if( notificationUrl == null){ notificationUrl = notification.getAccount().getAvatar(); if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) - title = String.format("@%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getContext().getString(R.string.notif_mention)); + title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getContext().getString(R.string.notif_mention)); else - title = String.format("@%s %s", notification.getAccount().getUsername(),getContext().getString(R.string.notif_mention)); + title = String.format("@%s %s", notification.getAccount().getAcct(),getContext().getString(R.string.notif_mention)); } } break; @@ -179,9 +179,9 @@ public class NotificationsSyncJob extends Job implements OnRetrieveNotifications if( notificationUrl == null){ notificationUrl = notification.getAccount().getAvatar(); if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) - title = String.format("@%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getContext().getString(R.string.notif_reblog)); + title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getContext().getString(R.string.notif_reblog)); else - title = String.format("@%s %s", notification.getAccount().getUsername(),getContext().getString(R.string.notif_reblog)); + title = String.format("@%s %s", notification.getAccount().getAcct(),getContext().getString(R.string.notif_reblog)); } } @@ -192,9 +192,9 @@ public class NotificationsSyncJob extends Job implements OnRetrieveNotifications if( notificationUrl == null){ notificationUrl = notification.getAccount().getAvatar(); if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) - title = String.format("@%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getContext().getString(R.string.notif_favourite)); + title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getContext().getString(R.string.notif_favourite)); else - title = String.format("@%s %s", notification.getAccount().getUsername(),getContext().getString(R.string.notif_favourite)); + title = String.format("@%s %s", notification.getAccount().getAcct(),getContext().getString(R.string.notif_favourite)); } } break; @@ -204,9 +204,9 @@ public class NotificationsSyncJob extends Job implements OnRetrieveNotifications if( notificationUrl == null){ notificationUrl = notification.getAccount().getAvatar(); if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) - title = String.format("@%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getContext().getString(R.string.notif_follow)); + title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getContext().getString(R.string.notif_follow)); else - title = String.format("@%s %s", notification.getAccount().getUsername(),getContext().getString(R.string.notif_follow)); + title = String.format("@%s %s", notification.getAccount().getAcct(),getContext().getString(R.string.notif_follow)); } } break; diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/services/LiveNotificationService.java b/app/src/main/java/fr/gouv/etalab/mastodon/services/LiveNotificationService.java index c7a6a364b..d9c332f18 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/services/LiveNotificationService.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/services/LiveNotificationService.java @@ -263,33 +263,33 @@ public class LiveNotificationService extends Service { case "mention": if(notif_mention){ if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) - title = String.format("@%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_mention)); + title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_mention)); else - title = String.format("@%s %s", notification.getAccount().getUsername(),getApplicationContext().getString(R.string.notif_mention)); + title = String.format("@%s %s", notification.getAccount().getAcct(),getApplicationContext().getString(R.string.notif_mention)); } break; case "reblog": if(notif_share){ if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) - title = String.format("@%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_reblog)); + title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_reblog)); else - title = String.format("@%s %s", notification.getAccount().getUsername(),getApplicationContext().getString(R.string.notif_reblog)); + title = String.format("@%s %s", notification.getAccount().getAcct(),getApplicationContext().getString(R.string.notif_reblog)); } break; case "favourite": if(notif_add){ if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) - title = String.format("@%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_favourite)); + title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_favourite)); else - title = String.format("@%s %s", notification.getAccount().getUsername(),getApplicationContext().getString(R.string.notif_favourite)); + title = String.format("@%s %s", notification.getAccount().getAcct(),getApplicationContext().getString(R.string.notif_favourite)); } break; case "follow": if(notif_follow){ if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) - title = String.format("@%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_follow)); + title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true),getApplicationContext().getString(R.string.notif_follow)); else - title = String.format("@%s %s", notification.getAccount().getUsername(),getApplicationContext().getString(R.string.notif_follow)); + title = String.format("@%s %s", notification.getAccount().getAcct(),getApplicationContext().getString(R.string.notif_follow)); } break; default: