Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/adb/improve-notifications'
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Nov 30, 2024
2 parents 30a63dd + a5d2642 commit 7f89ece
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public void notifyMessage(int accountId, int chatId, int msgId) {
}

DcMsg quotedMsg = dcMsg.getQuotedMsg();
boolean isMention = quotedMsg != null && dcChat.isMultiUser() && quotedMsg.isOutgoing();
boolean isMention = dcChat.isMultiUser() && quotedMsg != null && quotedMsg.isOutgoing();

maybeAddNotification(accountId, dcChat, msgId, shortLine, tickerLine, true, isMention);
});
Expand All @@ -379,7 +379,8 @@ public void notifyReaction(int accountId, int contactId, int msgId, String react

DcContact sender = dcContext.getContact(contactId);
String shortLine = context.getString(R.string.reaction_by_other, sender.getDisplayName(), reaction, dcMsg.getSummarytext(2000));
maybeAddNotification(accountId, dcContext.getChat(dcMsg.getChatId()), msgId, shortLine, shortLine, false, true);
DcChat dcChat = dcContext.getChat(dcMsg.getChatId());
maybeAddNotification(accountId, dcChat, msgId, shortLine, shortLine, false, dcChat.isMultiUser());
});
}

Expand All @@ -406,7 +407,8 @@ public void notifyWebxdc(int accountId, int contactId, int msgId, String text) {
JSONObject info = parentMsg.getWebxdcInfo();
final String name = JsonUtils.optString(info, "name");
String shortLine = name.isEmpty()? text : (name + ": " + text);
maybeAddNotification(accountId, dcContext.getChat(dcMsg.getChatId()), msgId, shortLine, shortLine, false, true);
DcChat dcChat = dcContext.getChat(dcMsg.getChatId());
maybeAddNotification(accountId, dcChat, msgId, shortLine, shortLine, false, dcChat.isMultiUser());
});
}

Expand Down

0 comments on commit 7f89ece

Please sign in to comment.