use DC_EVENT_TRANSPORTS_MODIFIED to sync changes from remote devices

This commit is contained in:
adbenitez
2026-01-03 16:13:32 +01:00
parent 5bcdd4cf16
commit e0a71d0fff
2 changed files with 5 additions and 1 deletions
@@ -35,6 +35,7 @@ public class DcContext {
public final static int DC_EVENT_INCOMING_CALL_ACCEPTED = 2560;
public final static int DC_EVENT_OUTGOING_CALL_ACCEPTED = 2570;
public final static int DC_EVENT_CALL_ENDED = 2580;
public final static int DC_EVENT_TRANSPORTS_MODIFIED = 2600;
public final static int DC_IMEX_EXPORT_SELF_KEYS = 1;
public final static int DC_IMEX_IMPORT_SELF_KEYS = 2;
@@ -97,6 +97,7 @@ public class RelayListActivity extends BaseActionBarActivity
DcEventCenter eventCenter = DcHelper.getEventCenter(this);
eventCenter.addObserver(DcContext.DC_EVENT_CONFIGURE_PROGRESS, this);
eventCenter.addObserver(DcContext.DC_EVENT_TRANSPORTS_MODIFIED, this);
}
@Override
@@ -199,7 +200,9 @@ public class RelayListActivity extends BaseActionBarActivity
@Override
public void handleEvent(@NonNull DcEvent event) {
int eventId = event.getId();
if (eventId == DcContext.DC_EVENT_CONFIGURE_PROGRESS && event.getData1Int() == 1000) {
if (eventId == DcContext.DC_EVENT_CONFIGURE_PROGRESS) {
if (event.getData1Int() == 1000) loadRelays();
} else if (eventId == DcContext.DC_EVENT_TRANSPORTS_MODIFIED) {
loadRelays();
}
}