diff --git a/app/src/main/java/com/polar/nextcloudservices/Notification/Processors/spreed/NextcloudTalkProcessor.java b/app/src/main/java/com/polar/nextcloudservices/Notification/Processors/spreed/NextcloudTalkProcessor.java index 74276fc..4a8c999 100644 --- a/app/src/main/java/com/polar/nextcloudservices/Notification/Processors/spreed/NextcloudTalkProcessor.java +++ b/app/src/main/java/com/polar/nextcloudservices/Notification/Processors/spreed/NextcloudTalkProcessor.java @@ -84,6 +84,12 @@ static private PendingIntent getReplyIntent(Context context, } } + private Person getUserPerson(){ + Person.Builder builder = new Person.Builder(); + builder.setName("You"); + return builder.build(); + } + @NonNull private Person getPersonFromNotification(@NonNull NotificationController controller, @NonNull JSONObject rawNotification) throws Exception { @@ -332,7 +338,14 @@ private void appendQuickReply(NotificationController controller, NotificationCompat.Builder builder = new NotificationCompat.Builder(context, notification); NotificationCompat.MessagingStyle style = NotificationCompat .MessagingStyle.extractMessagingStyleFromNotification(notification); - style.addMessage(text, CommonUtil.getTimestamp(), "You"); + if(style == null){ + Log.wtf(TAG, "appendQuickReply: got null style"); + return; + } + style.addMessage(text, CommonUtil.getTimestamp(), getUserPerson()); + final String room = mChatController.getChatByNotificationId(notification_id).room; + mChatController.onNewMessageReceived(room, text, getUserPerson(), + CommonUtil.getTimestamp(), -1); notification = builder.setStyle(style).build(); controller.postNotification(notification_id, notification); }