[android] Reload conversation when contact name changes

This commit is contained in:
Torsten Grote
2018-10-31 18:51:38 -03:00
parent 7059f376f1
commit aa15b68d24
2 changed files with 3 additions and 3 deletions

View File

@@ -203,6 +203,7 @@ public class ConversationActivity extends BriarActivity
if (deleted) finish();
});
viewModel.loadContact(contactId);
viewModel.getContactDisplayName().observe(this, name -> loadMessages());
setTransitionName(toolbarAvatar, getAvatarTransitionName(contactId));
setTransitionName(toolbarStatus, getBulbTransitionName(contactId));
@@ -243,8 +244,8 @@ public class ConversationActivity extends BriarActivity
notificationManager.blockContactNotification(contactId);
notificationManager.clearContactNotification(contactId);
displayContactOnlineStatus();
observeOnce(viewModel.getContactDisplayName(), this,
name -> loadMessages());
if (viewModel.getContactDisplayName().getValue() != null)
loadMessages();
list.startPeriodicUpdate();
}

View File

@@ -77,7 +77,6 @@ public class ConversationViewModel extends AndroidViewModel {
try {
contactManager.setContactAlias(contactId,
alias.isEmpty() ? null : alias);
// TODO also reload the conversation
loadContact(contactId);
} catch (DbException e) {
logException(LOG, WARNING, e);