( primaryDeviceID: string, keyserverDeviceID?: ?string, )
| 133 | } |
| 134 | |
| 135 | async function createAndSignSingletonDeviceList( |
| 136 | primaryDeviceID: string, |
| 137 | keyserverDeviceID?: ?string, |
| 138 | ): Promise<SignedDeviceList> { |
| 139 | const devices = keyserverDeviceID |
| 140 | ? [primaryDeviceID, keyserverDeviceID] |
| 141 | : [primaryDeviceID]; |
| 142 | const initialDeviceList = composeRawDeviceList(devices); |
| 143 | const rawDeviceList = JSON.stringify(initialDeviceList); |
| 144 | const { olmAPI } = getConfig(); |
| 145 | const curPrimarySignature = await olmAPI.signMessage(rawDeviceList); |
| 146 | return { |
| 147 | rawDeviceList, |
| 148 | curPrimarySignature, |
| 149 | }; |
| 150 | } |
| 151 | |
| 152 | async function signDeviceListUpdate( |
| 153 | deviceListPayload: RawDeviceList, |
no test coverage detected