Page MenuHomePhabricator

D12381.diff
No OneTemporary

D12381.diff

diff --git a/lib/tunnelbroker/use-peer-to-peer-message-handler.js b/lib/tunnelbroker/use-peer-to-peer-message-handler.js
--- a/lib/tunnelbroker/use-peer-to-peer-message-handler.js
+++ b/lib/tunnelbroker/use-peer-to-peer-message-handler.js
@@ -8,7 +8,10 @@
useBroadcastDeviceListUpdates,
useGetAndUpdateDeviceListsForUsers,
} from '../hooks/peer-list-hooks.js';
-import { getForeignPeerDevices } from '../selectors/user-selectors.js';
+import {
+ getAllPeerDevices,
+ getForeignPeerDevices,
+} from '../selectors/user-selectors.js';
import {
verifyAndGetDeviceList,
removeDeviceFromDeviceList,
@@ -40,6 +43,7 @@
const foreignPeerDevices = useSelector(getForeignPeerDevices);
const broadcastDeviceListUpdates = useBroadcastDeviceListUpdates();
const getAndUpdateDeviceListsForUsers = useGetAndUpdateDeviceListsForUsers();
+ const allPeerDevices = useSelector(getAllPeerDevices);
return React.useCallback(
async (message: PeerToPeerMessage, messageID: string) => {
@@ -143,7 +147,9 @@
userID,
deviceIDToLogOut,
);
- // TODO: broadcast device list update here
+ await broadcastDeviceListUpdates(
+ allPeerDevices.filter(deviceID => deviceID !== deviceIDToLogOut),
+ );
} catch (e) {
console.log(e);
}
@@ -257,6 +263,7 @@
identityClient,
olmAPI,
sqliteAPI,
+ allPeerDevices,
],
);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 7:47 PM (18 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2580832
Default Alt Text
D12381.diff (1 KB)

Event Timeline