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,6 +1729,16 @@ class Client { | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     } else { |     } else { | ||||||
|  |       if (encrypted) { | ||||||
|  |         // Create new sessions with devices if there is no existing session yet. | ||||||
|  |         List<DeviceKeys> deviceKeysWithoutSession = | ||||||
|  |             List<DeviceKeys>.from(deviceKeys); | ||||||
|  |         deviceKeysWithoutSession.removeWhere((DeviceKeys deviceKeys) => | ||||||
|  |             olmSessions.containsKey(deviceKeys.curve25519Key)); | ||||||
|  |         if (deviceKeysWithoutSession.isNotEmpty) { | ||||||
|  |           await startOutgoingOlmSessions(deviceKeysWithoutSession); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|       for (int i = 0; i < deviceKeys.length; i++) { |       for (int i = 0; i < deviceKeys.length; i++) { | ||||||
|         DeviceKeys device = deviceKeys[i]; |         DeviceKeys device = deviceKeys[i]; | ||||||
|         if (!data["messages"].containsKey(device.userId)) { |         if (!data["messages"].containsKey(device.userId)) { | ||||||
|  | @ -1736,14 +1746,6 @@ class Client { | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (encrypted) { |         if (encrypted) { | ||||||
|           // Create new sessions with devices if there is no existing session yet. |  | ||||||
|           List<DeviceKeys> deviceKeysWithoutSession = |  | ||||||
|               List<DeviceKeys>.from(deviceKeys); |  | ||||||
|           deviceKeysWithoutSession.removeWhere((DeviceKeys deviceKeys) => |  | ||||||
|               olmSessions.containsKey(deviceKeys.curve25519Key)); |  | ||||||
|           if (deviceKeysWithoutSession.isNotEmpty) { |  | ||||||
|             await startOutgoingOlmSessions(deviceKeysWithoutSession); |  | ||||||
|           } |  | ||||||
|           List<olm.Session> existingSessions = |           List<olm.Session> existingSessions = | ||||||
|               olmSessions[device.curve25519Key]; |               olmSessions[device.curve25519Key]; | ||||||
|           if (existingSessions == null || existingSessions.isEmpty) continue; |           if (existingSessions == null || existingSessions.isEmpty) continue; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue