improve prpr

This commit is contained in:
Riko Sakurauchi 2019-06-20 21:38:20 +08:00
parent f09d8a39fe
commit 5e72c10925
No known key found for this signature in database
GPG Key ID: 25AC0345B92902AF

View File

@ -13119,7 +13119,18 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
showDialog(builder.create());
break;
} case 27: {
SendMessagesHelper.getInstance(currentAccount).sendMessage("/prpr", dialog_id, selectedObject, null, false, null, null, null);
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(selectedObject.messageOwner.from_id);
if (user.username != null) {
SendMessagesHelper.getInstance(currentAccount).sendMessage("/prpr@" + user.username, dialog_id, selectedObject, null, false,
null, null, null);
} else {
SpannableString spannableString = new SpannableString("/prpr@" + user.first_name);
spannableString.setSpan(new URLSpanUserMention(Integer.toString(user.id), 1), 6, spannableString.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
CharSequence[] cs = new CharSequence[]{spannableString};
ArrayList<TLRPC.MessageEntity> entities = DataQuery.getInstance(currentAccount).getEntities(cs);
SendMessagesHelper.getInstance(currentAccount).sendMessage(spannableString.toString(), dialog_id, selectedObject, null, false,
entities, null, null);
}
break;
} case 94: {
ArrayList<MessageObject> messages = new ArrayList<>();