update summaries for webxdc drafts, so one can see what one is sending

This commit is contained in:
B. Petersen
2022-01-29 23:02:12 +01:00
committed by bjoern
parent d6dd07fd7a
commit 645864217f
2 changed files with 14 additions and 0 deletions
@@ -326,6 +326,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
initializeDraft();
doReinitializeDraft = false;
}
attachmentManager.onResume();
}
@Override
@@ -399,6 +399,18 @@ public class AttachmentManager {
return result;
}
// should be called when the attachement manager comes into view again.
// if the attachment manager contains a webxdc, its summary is updated.
public void onResume() {
if (slide.isPresent()) {
if (slide.get().isWebxdcDocument()) {
if (webxdcView != null) {
webxdcView.setWebxdc(DcHelper.getContext(context).getMsg(slide.get().dcMsgId), context.getString(R.string.videochat_tap_to_open));
}
}
}
}
public boolean isAttachmentPresent() {
return attachmentViewStub.resolved() && attachmentViewStub.get().getVisibility() == View.VISIBLE;
}