Copy user names to clipboard, fixes issue #6.

This commit is contained in:
B. Petersen
2016-11-12 13:49:30 +01:00
parent 9f07a0cba6
commit 6f1d364d1d
2 changed files with 4 additions and 13 deletions
@@ -543,11 +543,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
public TLRPC.User getUser(Integer id) {
// EDIT BY MR
// EDIT BY MR - additional information should be loaded as needed by the caller
TLRPC.User u = new TLRPC.User();
u.id = id;
return u;
//return users.get(id); -- /EDIT BY MR
}
public TLRPC.User getUser(String username) {
@@ -6966,17 +6966,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
String str = "";
if (name) {
if (previousUid != messageObject.messageOwner.from_id) {
if (messageObject.messageOwner.from_id > 0) {
TLRPC.User user = MessagesController.getInstance().getUser(messageObject.messageOwner.from_id);
if (user != null) {
str = ContactsController.formatName(user.first_name, user.last_name) + ":\n";
}
} else if (messageObject.messageOwner.from_id < 0) {
TLRPC.Chat chat = MessagesController.getInstance().getChat(-messageObject.messageOwner.from_id);
if (chat != null) {
str = chat.title + ":\n";
}
}
long hContact = MrMailbox.MrMailboxGetContactById(MrMailbox.hMailbox, messageObject.messageOwner.from_id);
str += MrMailbox.MrContactGetDisplayName(hContact) + ":\n";
MrMailbox.MrContactUnref(hContact);
}
}
if (messageObject.type == 0 && messageObject.messageOwner.message != null) {