Changes names in notif

This commit is contained in:
stom79 2017-11-12 09:34:57 +01:00
parent 342e3bf6de
commit 961f0cdc33
2 changed files with 16 additions and 16 deletions

View File

@ -167,9 +167,9 @@ public class NotificationsSyncJob extends Job implements OnRetrieveNotifications
if( notificationUrl == null){ if( notificationUrl == null){
notificationUrl = notification.getAccount().getAvatar(); notificationUrl = notification.getAccount().getAvatar();
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) 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 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; break;
@ -179,9 +179,9 @@ public class NotificationsSyncJob extends Job implements OnRetrieveNotifications
if( notificationUrl == null){ if( notificationUrl == null){
notificationUrl = notification.getAccount().getAvatar(); notificationUrl = notification.getAccount().getAvatar();
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) 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 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){ if( notificationUrl == null){
notificationUrl = notification.getAccount().getAvatar(); notificationUrl = notification.getAccount().getAvatar();
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) 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 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; break;
@ -204,9 +204,9 @@ public class NotificationsSyncJob extends Job implements OnRetrieveNotifications
if( notificationUrl == null){ if( notificationUrl == null){
notificationUrl = notification.getAccount().getAvatar(); notificationUrl = notification.getAccount().getAvatar();
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) 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 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; break;

View File

@ -263,33 +263,33 @@ public class LiveNotificationService extends Service {
case "mention": case "mention":
if(notif_mention){ if(notif_mention){
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) 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 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; break;
case "reblog": case "reblog":
if(notif_share){ if(notif_share){
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) 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 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; break;
case "favourite": case "favourite":
if(notif_add){ if(notif_add){
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) 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 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; break;
case "follow": case "follow":
if(notif_follow){ if(notif_follow){
if( notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0 ) 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 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; break;
default: default: