mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Add support for private messages without text
This commit is contained in:
@@ -460,8 +460,8 @@ public class ConversationActivity extends BriarActivity
|
||||
observeOnce(viewModel.getContactDisplayName(), this,
|
||||
name -> addConversationItem(h.accept(visitor)));
|
||||
} else {
|
||||
// visitor also loads message text (if existing)
|
||||
addConversationItem(h.accept(visitor));
|
||||
loadMessageText(h.getId());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -535,7 +535,7 @@ public class ConversationActivity extends BriarActivity
|
||||
PrivateMessageHeader h = new PrivateMessageHeader(
|
||||
message.getId(), message.getGroupId(),
|
||||
message.getTimestamp(), true, false, false, false,
|
||||
emptyList());
|
||||
true, emptyList());
|
||||
textCache.put(message.getId(), text);
|
||||
addConversationItem(h.accept(visitor));
|
||||
} catch (DbException e) {
|
||||
|
||||
@@ -34,9 +34,7 @@ abstract class ConversationItemViewHolder extends ViewHolder {
|
||||
|
||||
@CallSuper
|
||||
void bind(ConversationItem item, ConversationListener listener) {
|
||||
if (item.getText() == null) {
|
||||
text.setText("\u2026");
|
||||
} else {
|
||||
if (item.getText() != null) {
|
||||
text.setText(trim(item.getText()));
|
||||
}
|
||||
|
||||
|
||||
@@ -52,8 +52,10 @@ class ConversationVisitor implements
|
||||
item = new ConversationMessageItem(
|
||||
R.layout.list_item_conversation_msg_in, h);
|
||||
}
|
||||
String text = textCache.getText(h.getId());
|
||||
if (text != null) item.setText(text);
|
||||
if (h.hasText()) {
|
||||
String text = textCache.getText(h.getId());
|
||||
if (text != null) item.setText(text);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user