show name of forwarded in groups, keep title of forwarded messages in grey

This commit is contained in:
B. Petersen 2021-02-07 21:55:41 +01:00 committed by bjoern
parent ee33cdb7bc
commit 097da7c165
3 changed files with 12 additions and 3 deletions

View file

@ -113,6 +113,7 @@
<string name="audio">Audio</string>
<string name="voice_message">Voice message</string>
<string name="forwarded_message">Forwarded message</string>
<string name="forwarded_by">Forwarded by %1$s</string>
<string name="video">Video</string>
<string name="documents">Documents</string>
<string name="contact">Contact</string>

View file

@ -654,12 +654,15 @@ public class ConversationItem extends LinearLayout
private void setGroupMessageStatus() {
if (messageRecord.isForwarded()) {
this.groupSender.setText(context.getString(R.string.forwarded_message));
if (groupThread && !messageRecord.isOutgoing() && dcContact !=null) {
this.groupSender.setText(context.getString(R.string.forwarded_by, messageRecord.getSenderName(dcContact)));
} else {
this.groupSender.setText(context.getString(R.string.forwarded_message));
}
this.groupSender.setTextColor(context.getResources().getColor(R.color.unknown_sender));
}
else if (groupThread && !messageRecord.isOutgoing() && dcContact !=null) {
this.groupSender.setText(messageRecord.getSenderName(dcContact));
this.groupSender.setTextColor(dcContact.getArgbColor());
}
}

View file

@ -143,8 +143,13 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
authorView.setVisibility(GONE);
quoteBarView.setBackgroundColor(getForwardedColor());
} else if (quotedMsg.isForwarded()) {
DcContact contact = author.getDcContact();
authorView.setVisibility(VISIBLE);
authorView.setText(getContext().getString(R.string.forwarded_message));
if (contact == null) {
authorView.setText(getContext().getString(R.string.forwarded_message));
} else {
authorView.setText(getContext().getString(R.string.forwarded_by, quotedMsg.getSenderName(contact)));
}
authorView.setTextColor(getForwardedColor());
quoteBarView.setBackgroundColor(getForwardedColor());
} else {