Skip to content

Commit

Permalink
messages: add timestamps to user header when copying messages
Browse files Browse the repository at this point in the history
  • Loading branch information
iTaysonLab committed Feb 11, 2021
1 parent be60611 commit 3a78263
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -18672,17 +18672,18 @@ private void restartSticker(ChatMessageCell cell) {
private String getMessageContent(MessageObject messageObject, int previousUid, boolean name) {
String str = "";
if (name) {
String formattedTime = LocaleController.getInstance().formatterDay.format((long) (messageObject.messageOwner.date) * 1000);
int fromId = messageObject.getFromChatId();
if (previousUid != fromId) {
if (fromId > 0) {
TLRPC.User user = getMessagesController().getUser(fromId);
if (user != null) {
str = ContactsController.formatName(user.first_name, user.last_name) + ":\n";
str = ContactsController.formatName(user.first_name, user.last_name) + "[" + formattedTime + "] :\n";
}
} else if (fromId < 0) {
TLRPC.Chat chat = getMessagesController().getChat(-fromId);
if (chat != null) {
str = chat.title + ":\n";
str = chat.title + "[" + formattedTime + ":\n";
}
}
}
Expand Down

0 comments on commit 3a78263

Please sign in to comment.