mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Show name of message sender for groups in conversation list.
This commit is contained in:
@@ -34,6 +34,7 @@ public final class LiveRecipient {
|
||||
private final Context context;
|
||||
private final MutableLiveData<Recipient> liveData;
|
||||
private final LiveData<Recipient> observableLiveData;
|
||||
private final LiveData<Recipient> observableLiveDataResolved;
|
||||
private final Set<RecipientForeverObserver> observers;
|
||||
private final Observer<Recipient> foreverObserver;
|
||||
private final AtomicReference<Recipient> recipient;
|
||||
@@ -53,10 +54,11 @@ public final class LiveRecipient {
|
||||
o.onRecipientChanged(recipient);
|
||||
}
|
||||
};
|
||||
this.refreshForceNotify = new MutableLiveData<>(System.currentTimeMillis());
|
||||
this.refreshForceNotify = new MutableLiveData<>(new Object());
|
||||
this.observableLiveData = LiveDataUtil.combineLatest(LiveDataUtil.distinctUntilChanged(liveData, Recipient::hasSameContent),
|
||||
refreshForceNotify,
|
||||
(recipient, force) -> recipient);
|
||||
this.observableLiveDataResolved = LiveDataUtil.filter(this.observableLiveData, r -> !r.isResolving());
|
||||
}
|
||||
|
||||
public @NonNull RecipientId getId() {
|
||||
@@ -183,6 +185,10 @@ public final class LiveRecipient {
|
||||
return observableLiveData;
|
||||
}
|
||||
|
||||
public @NonNull LiveData<Recipient> getLiveDataResolved() {
|
||||
return observableLiveDataResolved;
|
||||
}
|
||||
|
||||
private @NonNull Recipient fetchAndCacheRecipientFromDisk(@NonNull RecipientId id) {
|
||||
RecipientSettings settings = recipientDatabase.getRecipientSettings(id);
|
||||
RecipientDetails details = settings.getGroupId() != null ? getGroupRecipientDetails(settings)
|
||||
|
||||
@@ -285,13 +285,13 @@ public final class ManageRecipientViewModel extends ViewModel {
|
||||
|
||||
String profileKeyBase64 = recipient.getProfileKey() != null ? Base64.encodeBytes(recipient.getProfileKey()) : "None";
|
||||
String profileKeyHex = recipient.getProfileKey() != null ? Hex.toStringCondensed(recipient.getProfileKey()) : "None";
|
||||
return String.format("-- Profile Name --\n%s\n\n" +
|
||||
return String.format("-- Profile Name --\n[%s] [%s]\n\n" +
|
||||
"-- Profile Sharing --\n%s\n\n" +
|
||||
"-- Profile Key (Base64) --\n%s\n\n" +
|
||||
"-- Profile Key (Hex) --\n%s\n\n" +
|
||||
"-- UUID --\n%s\n\n" +
|
||||
"-- RecipientId --\n%s",
|
||||
recipient.getProfileName().toString(),
|
||||
recipient.getProfileName().getGivenName(), recipient.getProfileName().getFamilyName(),
|
||||
recipient.isProfileSharing(),
|
||||
profileKeyBase64,
|
||||
profileKeyHex,
|
||||
|
||||
Reference in New Issue
Block a user