Closed r10s closed 2 years ago
@r10s events like DC_EVENT_MSGS_CHANGED
are not emitted when sharing from DC to DC. I guess because they are sent from the extension app, which is a different context.
But maybe the core's dc_send_msg_sync
does't emit the event. It is not a very often used method, so bugs could hide for longer here.
A robust solution would be to reintroduce refreshInBg()
in onViewDidAppear
A robust solution would be to reintroduce refreshInBg() in onViewDidAppear
well, but also an expensive one :) and one with not-so-nice ux as the user will see the old state flashing up.
better we look out for why the update is missing in exactly that case (in other cases, things work as expected)
But maybe the core's dc_send_msg_sync does't emit the event.
dc_send_msg_sync emits MSGS_CHANGED, i just checked that. however, this does not really help as it is emitted to the share-instance, but we need to update the main-instance.
for other cases, this works by setting the flag UserDefaults.hasExtensionAttemptedToSend
in the share-instance and check the flag from the main-instance. we are doing this in applicationWillEnterForeground()
- probably this is the issue as the main app is already in foreground.
while the chatlist is updated when eg. sharing from gallery -> delta chat, the update is missing when sharing from delta chat -> delta chat.
example:
-> the chatlist is not updated.
this may also be buggy for sharing files or other things this way, i tested only for webxdc.
EDIT: also, the message-list is not updated when sharing to the same chat.