Merge branch 'client-fix-claim-keys' into 'master'
[Client] Fix claim keys not in loop See merge request famedly/famedlysdk!240
This commit is contained in:
		
						commit
						ee3489561e
					
				|  | @ -1729,12 +1729,6 @@ class Client { | |||
|         } | ||||
|       } | ||||
|     } else { | ||||
|       for (int i = 0; i < deviceKeys.length; i++) { | ||||
|         DeviceKeys device = deviceKeys[i]; | ||||
|         if (!data["messages"].containsKey(device.userId)) { | ||||
|           data["messages"][device.userId] = Map<String, dynamic>(); | ||||
|         } | ||||
| 
 | ||||
|       if (encrypted) { | ||||
|         // Create new sessions with devices if there is no existing session yet. | ||||
|         List<DeviceKeys> deviceKeysWithoutSession = | ||||
|  | @ -1744,6 +1738,14 @@ class Client { | |||
|         if (deviceKeysWithoutSession.isNotEmpty) { | ||||
|           await startOutgoingOlmSessions(deviceKeysWithoutSession); | ||||
|         } | ||||
|       } | ||||
|       for (int i = 0; i < deviceKeys.length; i++) { | ||||
|         DeviceKeys device = deviceKeys[i]; | ||||
|         if (!data["messages"].containsKey(device.userId)) { | ||||
|           data["messages"][device.userId] = Map<String, dynamic>(); | ||||
|         } | ||||
| 
 | ||||
|         if (encrypted) { | ||||
|           List<olm.Session> existingSessions = | ||||
|               olmSessions[device.curve25519Key]; | ||||
|           if (existingSessions == null || existingSessions.isEmpty) continue; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue