mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Show correct media information from the backend.
This commit is contained in:
@@ -731,28 +731,6 @@ public class MessageObject {
|
||||
return messageOwner.media != null && isNewGifDocument(messageOwner.media.document);
|
||||
}
|
||||
|
||||
public String getMusicTitle() {
|
||||
TLRPC.Document document;
|
||||
document = messageOwner.media.document;
|
||||
for (int a = 0; a < document.attributes.size(); a++) {
|
||||
TLRPC.DocumentAttribute attribute = document.attributes.get(a);
|
||||
if (attribute instanceof TLRPC.TL_documentAttributeAudio) {
|
||||
if (attribute.voice) {
|
||||
return LocaleController.formatDateAudio(messageOwner.date);
|
||||
}
|
||||
String title = attribute.title;
|
||||
if (title == null || title.length() == 0) {
|
||||
title = FileLoader.getDocumentFileName(document);
|
||||
if (title == null || title.length() == 0) {
|
||||
title = "ErrTitle"; // should never happen
|
||||
}
|
||||
}
|
||||
return title;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
TLRPC.Document document;
|
||||
document = messageOwner.media.document;
|
||||
@@ -765,33 +743,6 @@ public class MessageObject {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getMusicAuthor() {
|
||||
TLRPC.Document document;
|
||||
document = messageOwner.media.document;
|
||||
for (int a = 0; a < document.attributes.size(); a++) {
|
||||
TLRPC.DocumentAttribute attribute = document.attributes.get(a);
|
||||
if (attribute instanceof TLRPC.TL_documentAttributeAudio) {
|
||||
if (attribute.voice) {
|
||||
if (isOutOwner() ) {
|
||||
return mContext.getString(R.string.FromSelf);
|
||||
}
|
||||
else if (messageOwner.fwd_from != null ) {
|
||||
return messageOwner.fwd_from.m_name;
|
||||
} else {
|
||||
TLRPC.User user = MessagesController.getInstance().getUser(messageOwner.from_id);
|
||||
return UserObject.getUserName(user);
|
||||
}
|
||||
}
|
||||
String performer = attribute.performer;
|
||||
if (performer == null || performer.length() == 0) {
|
||||
performer = mContext.getString(R.string.AttachMusic);
|
||||
}
|
||||
return performer;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public TLRPC.InputStickerSet getInputStickerSet() {
|
||||
return getInputStickerSet(messageOwner);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user